laziness, impatience, and hubris | |
PerlMonks |
Re: perl -pi -e s'/^\s+//'g $fileby goibhniu (Hermit) |
on Apr 12, 2011 at 18:37 UTC ( [id://899025]=note: print w/replies, xml ) | 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: use strict; use warnings; I humbly seek wisdom.
In Section
Seekers of Perl Wisdom
|
|