Help for this page

Select Code to Download


  1. or download this
    my %skip = (
       'gif'  => 1,
       'jpg'  => 1,
       'jpeg' => 1,
       'png'  => 1
    );
    
  2. or download this
    my %skip_for;
    @skip_for{qw( gif jpg jpeg png )} = ();
    
  3. or download this
      my ($nil,$ext) = $file =~ /^(.*?)\.(.*?)$/gs;
  4. or download this
      my ($ext) = $file =~ /^.*?\.(.*?)$/gs;
  5. or download this
      my ($ext) = $file =~ /[.]([^.]+)$/gs;
  6. or download this
    #!/usr/bin/perl -w
    use strict;
    use Fcntl;
    ...
        },
        (@ARGV) || "." # NB: parens required
    );
    
  7. or download this
    sysopen FH, $_, O_RDWR
        or (warn "Couldn't open $File::Find::name: $!\n", return);
    s/\r//g, $content .= $_ while (
        defined (sysread FH, $_, 65536)
        or (warn "Couldn't open $File::Find::name: $!\n", return)
    );
    
  8. or download this
    return if -d or /^[.]/;
    return if /[.]([^.]+)$/ and exists $skip_for{$1};