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 |