Re: perl -pi -e s'/^\s+//'g $fileby goibhniu (Hermit)
|on Apr 12, 2011 at 18:37 UTC||Need Help??|
I often build up proofs-of-concept from one-liners before I finally write them into a "real" script. invaluable to me in this process is perlrun. Perlrun has "actual" code that is equivalent to many of the commandline switches. For instance, under the section for -i[extension]:
From the shell, saying
This is a great starting place for converting your on-liner and also a great place to learn how to do it from scratch the next time.
The only other thing I would urge you to do is not to forget your strictures when you start making it a longer script. your code example:
What I want you to do:
#my sig used to say 'I humbly seek wisdom. '. Now it says:
I humbly seek wisdom.