perl hash and refrnce
http://www.tutorialspoint.com/perl/perl_hashes.htm http://perl101.org/hashes.html http://docstore.mik.ua/orelly/perl2/prog/ch09_02.htm http://perlmaven.com/perl-hash
http://www.tutorialspoint.com/perl/perl_hashes.htm http://perl101.org/hashes.html http://docstore.mik.ua/orelly/perl2/prog/ch09_02.htm http://perlmaven.com/perl-hash
use Date::Parse; print str2time("12/5/2014 12:27PM")."\n";
The post below will show you how to generate the Config.pm Then if you still need configuration changes (for example proxy) just modify the file by hand. To initially configure perl cpan. Make note of the config file & directory, for example below its /user/.cpan/CPAN/MyConfig.pm perl -MCPAN -e shell [..] snip Would you like to …
Modifying perl config by hand – just modify Config.pm Read More »
Below you can asee a subrutine that will cause perl to undrtsnad this as numbers foreach (@full_cpu_data) { $_ =~ s/K//; @cpu_data = split(':', $_); @cpu_data = map { $_ += 0 } @cpu_data; push @cpu_plot, { cpu => @cpu_data[3], core => @uptime[6], disk => @disk[4] }; $i++; }
How to Email Attachments in Perl Below as a small snipped that can be used to email attachments sub Mail { # Handles attachments # my($from, $to, $subject, $body, @attachments) = @_; my $cmd = ‘/util/sendEmail’; foreach $attachment (@ARGV) { $cmd .= qq# -a “$attachment”# if -r “$attachment”; } $cmd .= qq# -u “$subject”# if …
To list all installed perl modules #!/usr/bin/perl # ## # #!/usr/bin/perl use ExtUtils::Installed; my $instmod = ExtUtils::Installed->new(); foreach my $module ($instmod->modules()) { my $version = $instmod->version($module) || “???”; print “$module — $version\n”; }