Assign program result or die
From: Martin Nilsson (martin_rufus_at_hotmail.com)
Date: 07/15/04
- Previous message: penguinista: "Re: Program design in perl?"
- Next in thread: Jürgen Exner: "Re: Assign program result or die"
- Reply: Jürgen Exner: "Re: Assign program result or die"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 14 Jul 2004 23:01:23 -0700
Hi,
I'm new to Perl and have a question about return statuses and
errorhandling. I want to do the following.
Execute a program and assign the result to an array and if the program
return an error I want to show the error. Something like this:
my @files = system("$ncftpls -1 -u $USER -p $PASSW
ftp:\/\/$HOST$remote_dir") && die "Could not execute NcFTPLS. Error:
$????";
Of course this does not work but maybe it shows what I want to do? How
do I get the error code ($????) from the program $ncftpls and how
should I write the code?
For info: $ncfptls is NcFTPLS found at http://www.ncftp.com/
Any hints?
Br,
Martin
- Previous message: penguinista: "Re: Program design in perl?"
- Next in thread: Jürgen Exner: "Re: Assign program result or die"
- Reply: Jürgen Exner: "Re: Assign program result or die"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|