Help for this page

Select Code to Download


  1. or download this
    $ perl -MO=Deparse -e '<*>'
    use File::Glob ();
    glob('*');
    -e syntax OK
    
  2. or download this
        foreach $file (@files) {
            open FH, $file or
                die "Error opening $file: $!\n";
    
  3. or download this
    for my $file (@files) {
        open my $fh, '<', $file or
    ...
        # ...
        # no need for an explit close() 
    }
    
  4. or download this
    $ cat foo.pl
    #!/usr/bin/perl
    ...
    
    $ cat foo.pl
    Gotcha!
    
  5. or download this
          elsif ( data =~ /^\x89PNG\x0d\x0a\x1a\x0a/) {
             type = 'PNG';
          }