Help for this page

Select Code to Download


  1. or download this
    use strict;
    use warnings;
    ...
    my $line = '$Word $ $ $ $test';
    $line =~ s/(\$\w*)/exists $words{$1} ? $1 : " dollar "/eg;
    print "$line\n\n";
    
  2. or download this
    $line =~ s/(\$(\w*))/exists $words{$1} ? $1 : "dollar$2"/eg;