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 => <=

In reply to Re: "Use of uninitialized value" question by dbwiz
in thread "Use of uninitialized value" question by Not_a_Number

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.