hi I am learning to write automation for running some tests,to begin with I have written the following code.I need to know how I can create a perl module so I can make calls to check if a host is alive
#!/usr/bin/perl use strict; use warnings; use lib '/home/suse/junk/automation1/emulex'; use Config::Simple; use Net::Ping::External qw(ping); use 5.010; #myconf.cfg is a file with all hosts my $cfg = new Config::Simple('/home/suse/junk/automation1/emulex/mycon +f.cfg'); #accessing values my $host = $cfg->param("host1"); print "checking $host is reachable or not\n"; my $alive = ping(hostname => "$host", count => 5, size => 1024, timeou +t => 3); print "$host is alive!\n" if $alive or die"Could not ping host '$host' + ";
In reply to perl module help by janasec
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |