M
Martin Nilsson
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
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