Help for this page

Select Code to Download


  1. or download this
    my $var if $test;
    
  2. or download this
    my $var = 1 if $test;
    
  3. or download this
    my $var = 1 if $test;
    
  4. or download this
    my $value = $1 if $foo =~ /^\w+(\d+)/;
    do_something($value) if defined $value;
    
  5. or download this
    $ perl -Mstrict -Mwarnings -e  ' my $c = 1 if 1; print $c;'
    1
    ...
    $ perl -Mstrict -Mwarnings -e  ' my $c if 1; print $c;'
    Use of uninitialized value $c in print at -e line 1.
    
  6. or download this
    my $var = 1 if $test;