Category Archives: Perl

How to find and replace text in a string using Perl

To replace specific text in a string with other text, using perl, the syntax is…

$fullString =~ s/$findString/$replaceString/;

How to tell if a Perl Module is Installed

Want to check if a perl module is installed on your system? There’s a oneliner for that! Here’s an example…

perl -e "use Text::CSV"

… which would of course check if Text::CSV could be loaded. If it can, nothing will be printed. If not, you’ll get an error with some possibly useful information to figuring out why not.