3 ms·
Cool Perl Tools To Know
- alexwestholm 16y agoThe article references some great modules for those actually writing perl code. For those that never learn to write full apps in perl, there are still a few gem 1-liners that are worth tucking away. For instance, perl -pi.bak -e 's/something/something_else/g' *.erl would act as a global substitution with backups (any file changed would have an original x.erl.bak). A list of some other useful 1-liners can be found here: http://blog.ksplice.com/2010/05/top-10-perl-one-liner-tricks/ http://blog.ksplice.com/2010/05/top-10-perl-one-liner-tricks...
- pixdamix 16y agoOne great tool also is Ack (apt-get install ack-greg) whish is kind of grep on steroids designed to search source files It ignore files in .git/.svn directories, you can define your own file type filters in its config file .ackrc
- hsmyers 16y agoI've changed my whole style of programming using Data::Dumper::Simple It does the obvious, but instead of a more or less anonymous (unless you use extra key strokes) dump of a given variable, Simple allows named dumps of multiple values one per line (complex structures arrayed in a vertical fashion) I used for years something like print "\$variable = '$variable'\n"; and this completely replaced that with much clearer code. I combine this with a trailing if $debug; and life is very good since my code allows turning $debug on and off selectively. If I combine this approach with some of the things mentioned in the post, I can greatly extend my ability to know what the hell is going on with my program :)