Help for this page

Select Code to Download


  1. or download this
          my $eol = qr/\015|\012|\015\012/;
    
  2. or download this
        $hash{
          $something + $long / $and * $hairy
        } = $foo;
    
  3. or download this
          if ( /blah (foo) gibber/ )
          {
              $var =~ s/\Q$1\E/bar/g;
          }
    
  4. or download this
          if ( /blah (foo) gibber/ )
          {
              my $thingy = $1;
              $var =~ s/\Q$thingy\E/bar/g;
          }
    
  5. or download this
          $file =~ s/<<(\w+);.*\n\1\n//sg;
    
  6. or download this
          print <<EOT;
          this is short.
    ...
          print <<EOT;
          this is also short;
          EOT
    
  7. or download this
          $file =~ s/[;\n]\s*#[^\n]*//sg; # Delete comments
    
  8. or download this
          print "foo; #bar";
    
  9. or download this
          print <<HTML, $end_of_stream;
          ...
          ...
          HTML
    
  10. or download this
          print <<P1, <<P2;
          ...
    ...
          ...
          ...
          P2
    
  11. or download this
          sub twiddle ( $ )
          {
             my ( $arg ) = @_;
             ...
          }
    
  12. or download this
        LOOP:
          for ( my $I = do { ... }; $i < 20; ++$i ) { ... }
    
  13. or download this
    #!/usr/bin/perl
    
    ...
        my $hash_display = join '', unique_elements @hash_disp;
        eval $hash_display;
    }