perl (Swiss Army Knife of Programming) is quite efficient in data processing. Though though not enterprise class as python, perl has a substantial presence in many packages including
- - git downloads for Windows
- - present in all Linux Enterprise installations
- - PAR (Perl Archive Toolkit) acts like a JAR file to be packaged up
One of the main problems you hit is the non-availability of packages or modules within perl.
For instaance take the example of CSV module in perl. This is a very useful module if you want to play around with manipulating CSV.
If you need to do cross platform scripts, below script is an efficient way to check the packages that are available "locally" in that server or machine before you start configuring your complex code. This can be a life saver and thus you can include your packages alongside if you need.
If you need to do cross platform scripts, below script is an efficient way to check the packages that are available "locally" in that server or machine before you start configuring your complex code. This can be a life saver and thus you can include your packages alongside if you need.
#!/usr/bin/perl
# list all of the perl modules installed
use File::Find ;
for (@INC) { find(\&modules,$_) ; }
sub modules
{
if (-d && /^[a-z]/) { $File::Find::prune = 1 ; return }
return unless /\.pm$/ ;
my $fullPath = "$File::Find::dir/$_";
$fullPath =~ s!\.pm$!!;
$fullPath =~ s#/(\w+)$#::$1# ;
print "$fullPath \n";
}
Above code will check for all available packages. You can then do a check for particular module.
Also this script can be made as a function.