Help for this page

Select Code to Download


  1. or download this
    #!/usr/bin/perl
    
    ...
    my $line = 'substitute for $foo in $bar here';
    $line =~ s/(\$\w+)/"defined $1 ? $1 : ''"/eeg;
    print $line, "\n";
    
  2. or download this
    hairbear% ./test2.pl
    Use of uninitialized value in substitution iterator at ./test2.pl line
    + 11.
    substitute for  in  here