Help for this page

Select Code to Download


  1. or download this
      $myfile =~ s!([A-Z]+)!<i>$1</i>!g;
    
  2. or download this
      $ perl -lwe '$_="hi MOM and DAD"; print;
                   s!([A-Z]+)!<i>$1</i>!g; print'
      hi MOM and DAD
      hi <i>MOM</i> and <i>DAD</i>
    
  3. or download this
      $myfile =~ s!\b([A-Z]+)\b!<i>$1</i>!g;
    
  4. or download this
      perl -i~ -plwe 's/mom/dad/g' *.txt
    
  5. or download this
      open my $fh, "source-data.txt"
        or die "opening source-data.txt: $!";
    ...
      print $fh "</blockquote>\n";
      close $fh
        or die "closing source-data.txt: $!";
    
  6. or download this
      while ( <$fh> )
      {
    ...
          # output the result
          print $fh $_;
      }