Beefy Boxes and Bandwidth Generously Provided by pair Networks vroom
Think about Loose Coupling
 
PerlMonks  

Re: "Use of uninitialized value" question

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

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


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 15: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
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.