Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re^4: perl -pi -e s'/^\s+//'g $file

by Anonymous Monk
on Mar 22, 2012 at 10:55 UTC ( #960975=note: print w/ replies, xml ) Need Help??


in reply to Re^3: perl -pi -e s'/^\s+//'g $file
in thread perl -pi -e s'/^\s+//'g $file

Actually you'd need

local @ARGV = @_; require ARGV::readonly; ARGV::readonly->import; ## THIS!!!

But if you're going to write all that, which might confuse some, you might as well just steal ARGV::readonly verbatim

local @ARGV = @_; # Tom Christiansen in Message-ID: <24692.1217339882@chthon> # reccomends essentially the following: for (@ARGV){ s/^(\s+)/.\/$1/; # leading whitespace preserved s/^/< /; # force open for input $_.=qq/\0/; # trailing whitespace preserved & pipes forbidden };


Comment on Re^4: perl -pi -e s'/^\s+//'g $file
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (9)
As of 2014-12-23 02:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (133 votes), past polls