Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re^4: Filename change with regular expression

by Laurent_R (Canon)
on Aug 09, 2013 at 21:51 UTC ( [id://1048854]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    while (<$IN>) {
         next if /^XYZ/ or /ZYX/ or /XZY/ or /YZZ$/; # removes all special
    + cases where substitution should not occur
         s/foo/bar/g;
         # do something with $_
    }
    
  2. or download this
    foreach $file (@filelist) {
         next unless file =~ /_00001\.\w+$/;
         # now only start for looking for a random number to replace _0000
    +1
         # ...
    }
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (5)
As of 2024-04-23 17:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found