Help for this page

Select Code to Download


  1. or download this
    $ perl -wMstrict -e 'my $x; print length $x'
    Use of uninitialized value in print at -e line 1.
    $ perl -wMstrict -e 'my $x; print length $x if defined $x'
    $
    
  2. or download this
    $ perl -wMstrict -e 'my $x; print "yes" if $x=~/foo/'
    Use of uninitialized value $x in pattern match (m//) at -e line 1.
    $ perl -wMstrict -e 'my $x; print "yes" if defined $x && $x=~/foo/'
    $
    
  3. or download this
    $ perl -wMstrict -e 'my $x; print "yes" if defined $x && length $x'
    $ perl -wMstrict -e 'my $x; print "yes" if length $x'
    $