Expect - Problem with UNIX crontab

Posted on Tue Nov 28 17:35:22 2006 by chiarappadomenico
Problem with UNIX crontab
Hi, when I launch my perl script manually, it works very good but when I used crontab for scheduling the script, I have this output:
From x2693 Tue Nov 28 16:28:02 2006 Return-Path: <x2693> Received: (from x2693@localhost) by suncbk11.far.it (8.11.7p1+Sun/8.11.7) id kASFS2313312 for x2693; Tue, 28 Nov 2006 16:28:02 +0100 (MET) Date: Tue, 28 Nov 2006 16:28:02 +0100 (MET) From: x2693 Message-Id: <200611281528.kASFS2313312@suncbk11.bgl.lu> To: x2693 Subject: Output from "cron" command Content-Type: text Content-Length: 264 Your "cron" job on suncbk11 /usr/local/bin/perl /export/home/x2693/project/v02/appliancemanagement.pl produced the following output: Can't call method "expect" on an undefined value at /export/home/x2693/project/v02/FWcheckpoint.pm +line 127, <FWMODEL> line 57.
P.S. In the line 127 I call the first time expect. Following some lines of the scripts:
line 126 my $ssh = Expect->spawn("ssh -l $User $Host"); line 127 unless ($ssh->expect($Time_ex,-re,$Prompt)) {$self->send_alarm($Action);}
Direct Responses: 3640 | 3657 | Write a response