DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

Start Stop Script Template In Perl

03.29.2009
| 3919 views |
  • submit to reddit
        // Start Stop script template in perl

#!/usr/bin/perl

use warnings;
use strict;




my $dispatch_table = {

        'start' => \&start,
        'stop' => \&stop,

};

my $options = join ' | ', sort keys %$dispatch_table;

die "Usage $0 [ $options ] " unless @ARGV;
my $argument = lc shift @ARGV;
die "Invalid option \"$argument\" \n Usage $0 [ $options ] " unless exists $dispatch_table->{ $argument };

$dispatch_table->{ $argument }->(  );

exit 0;


# Define all function which you want to put in distpatch table below this line

sub start {

}


sub stop {

}


    

Comments

Snippets Manager replied on Mon, 2009/03/30 - 12:55am

buy wow gold,cheap wow gold,wow power leveling.