Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: "Use of uninitialized value" question

by dbwiz (Curate)
on Oct 04, 2003 at 19:02 UTC ( [id://296564]=note: print w/replies, xml ) Need Help??


in reply to "Use of uninitialized value" question

It skips the warning only if the uninitialized value is at the beginning of the string, and only in Perl 5.6.1.

Using Perl 5.8, it does warn you all right.

1 #!/usr/bin/perl -w 2 use strict; 3 4 print "Perl $] \n"; 5 my %hash = ( a => undef, b => 'foo', c => undef ); 6 7 print "$_ => $hash{$_}\n" for keys %hash; 8 print "$hash{$_} <= $_\n" for keys %hash; 9 10 my $var = undef; 11 print "$var <= at the beginning\n"; 12 print "in the middle => $var <= \n"; __END__ Perl 5.006001 Use of uninitialized value in concatenation (.) or string at hash_prob +.pl line 7. a => b => foo Use of uninitialized value in concatenation (.) or string at hash_prob +.pl line 7. c => <= a foo <= b <= c <= at the beginning Use of uninitialized value in concatenation (.) or string at hash_prob +.pl line 12. in the middle => <= Perl 5.008 Use of uninitialized value in concatenation (.) or string at hash_prob +.pl line 7. c => Use of uninitialized value in concatenation (.) or string at hash_prob +.pl line 7. a => b => foo Use of uninitialized value in concatenation (.) or string at hash_prob +.pl line 8. <= c Use of uninitialized value in concatenation (.) or string at hash_prob +.pl line 8. <= a foo <= b Use of uninitialized value in concatenation (.) or string at hash_prob +.pl line 11. <= at the beginning Use of uninitialized value in concatenation (.) or string at hash_prob +.pl line 12. in the middle => <=

Replies are listed 'Best First'.
Re: Re: "Use of uninitialized value" question
by Not_a_Number (Prior) on Oct 04, 2003 at 19:30 UTC

    Thanks, so it's a bug, apparently (you're right, I use 5.6.1)

    dave

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://296564]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (4)
As of 2024-04-19 06:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found