Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Start Stop Script Template In Perl

DZone's Guide to

Start Stop Script Template In Perl

· ·
Free Resource
// Start Stop script template in perl


#!/usr/bin/perl

use warnings;
use strict;




my $dispatch_table = {

        'start' => \☆t,
        '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 {

}


Topics:

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}