#!/usr/bin/perl -w #exec /usr/bin/perl /research-sar/sarexec.pl use strict; #### #!/usr/bin/perl use strict; use warnings; #### if($ARGV[0] eq 'start') { # Checking for correct parameters.. if (exists $ARGV[1] && exists $ARGV[2] && exists $ARGV[3]) { #print "present all things\n"; } else { #print "Missing parameters..cant continue..\n"; exit; } #### my %action=(start => \&start, stop => \&stop); my $todo=shift || ''; die "Wrong parameters\n" unless $action{$todo}; goto $action{$todo}; # a "good" goto; # # ... # sub $start () { die "Missing parameters, can't continue!\n" unless @ARGV==3; my ($file_param,$file_location,$interval)=@ARGV; # ... } #### open(FH,"> fileloc") or die"cant open the file"; #### open my $fh, '>', 'fileloc' or die "Can't open `fileloc': $!\n"; #### my $pid = fork();