What does this perl crash means?

Can someone tell me what this means?

if (not defined $config{'crontab'}) {
  die "no crontab defined!";
}

I want to open a file crontab.txt but the perl script crashes at this line and I don't really know any perl.


EDIT 1

It goes like this:

sub main()
{
    my %config = %{getCommandLineOptions()};
    my $programdir = File::Spec->canonpath (    (fileparse ( Win32::GetFullPathName($PROGRAM_NAME) ))[1] );
    my $logdir = File::Spec->catdir ($programdir, 'logs');
    $logfile = File::Spec->catfile ($logdir, 'cronw.log');

    configureLogger($logfile);
    $log = get_logger("cronw::cronService-pl");

    # if --exec option supplied, we are being invoked to execute a job
    if ($config{exec}) {
        execJob(decodeArgs($config{exec}), decodeArgs($config{args}));
        return;
    }

    my $cronfile = $config{'crontab'};

    $log->info('starting service');
    $log->debug('programdir: '.$programdir);
    $log->debug('logfile: '.$logfile);
    if (not defined $config{'crontab'}) {
        $log->error("no crontab defined!\n");
        die "no crontab defined!";
        # fixme: crontab detection?
    }
    $log->debug('crontab: '.$config{'crontab'});

And I'm trying to load this 'crontab.txt' file...


sub getCommandLineOptions()
{
my $clParser = new Getopt::Long::Parser config => ["gnu_getopt", "pass_through"];
my %config = ();
my @parameter = (   'crontab|cronfile=s',
    'exec=s',
    'args=s',
    'v|verbose'
                          );

$clParser->getoptions (\%config, @parameter);
if (scalar (@ARGV) != 0)  { $config{'unknownParameter'} = $true; }

return \%config;
}

Probably I have to give the script an argument

Answers


Probably I have to give the script an argument

I would say so.

$ script --cronfile=somefile


Need Your Help

Is it possible to apply position: sticky to <thead> or <tr> element?

css css-position html-table sticky

Is it possible to apply position: sticky to &lt;thead&gt; or first &lt;tr&gt; tag to make table header stuck at the top of viewport while scrolling the table body?

How to get response status 404 in casper.js within thenOpen instead of undefined?

node.js web-scraping phantomjs casperjs

Any idea why code below doesn't catch 404 in either response var or in the http.status.404 event?

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.