Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re^2: renaming files question

by Tanktalus (Canon)
on Jan 06, 2006 at 16:44 UTC ( [id://521528]=note: print w/replies, xml ) Need Help??


in reply to Re: renaming files question
in thread renaming files question

If you're going to do this in shell, then you can avoid a bit of work:

$ echo lbn9.pd.cnt | cut -d. -f1,3 lbn9.cnt
However, since I think you're advocating writing the above in perl (with the backticks), it seems kind of redundant:
join '.', (split '.', $name)[0,2]
which avoids all the overhead of forking and execing multiple (2-3) subprocesses. Personally, I find the backticks (or even system in general) to be vastly overused in perl, mostly by people pretending it's the shell rather than using it as perl.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (2)
As of 2024-04-26 06:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found