#!/usr/bin/perl # weathermon use warnings; use strict; use Daemon::Control; use Getopt::Long; GetOptions( \ my %OPT, 'city=s', ); exit Daemon::Control->new( name => "Weather watch daemon", path => '/home/arun/test/weathermon', program => '/home/arun/test/weather_watch.pl', program_args => [ '--city', $OPT{city} ], pid_file => '/tmp/weathermon.pid', )->run;