Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Recursive File Substitution

by Aristotle (Chancellor)
on Jul 14, 2002 at 21:24 UTC ( [id://181649]=note: print w/replies, xml ) Need Help??

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};
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://181649]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (2)
As of 2024-04-20 04:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found