Friday, March 04, 2011

perl oneliners

perl -p -i -e 's/oldstring/newstring/g' filename.
This will change the oldstring to newstring in the file.



Perl oneliner to install modules. (Note should have internet access and should have CPAN configuration done)


perl -MCPAN -e 'install HTML::Template'
                 OR

cpan -i 'install HTML::Template'



No comments: