Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
______________________________________________________ OK now the weird thing and I have no idea what to do anymore. The File doesn´t seem to have a end of line. Neither Notepad nor Perl "can see" the End of Line. If I get the File manually via DOS command box and the ftp command the file does have a normal End of Line. If I open the file downloaded with the Perl code with a Texteditor like Ultraedit, Ultraedit thinks that this is a Hex File. Changing to "normal" mode the End of Line exists. So I think the Problem is with Net::FTP it gets the file correctly but doesnt convert the End Of Line correctly to ASCII. Question: Is there any way to fix this Problem, is it a problem in the Net::FTP or what can I do to get the File correctly??? Thanx in advance Ausbyuse strict; use Net::FTP; my $hostname = 'localhost'; my $username = 'slip'; my $password = 'knot'; my $file = 'version.txt'; my ($ftp, $code, $msg); $ftp = Net::FTP->new($hostname); if($@) { print "Error connecting to $hostname: $@"; exit; } $ftp->login($username,$password); $code = $ftp->code; unless ($code == 230) { $msg = $ftp->message; print "Error logging in: $code $msg"; exit; } $ftp->ascii(); $ftp->get($file); $code = $ftp->code; unless ($code == 150 || $code == 226 || $code == 250) { $msg = $ftp->message; print "Error getting $file: $code $msg"; exit; } $ftp->quit;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Serious Problem with Net::FTP and TSO End of Line "Missing"?!
by Limbic~Region (Chancellor) on Feb 23, 2003 at 20:05 UTC | |
|
Re: Serious Problem with Net::FTP and TSO End of Line "Missing"?!
by pg (Canon) on Feb 23, 2003 at 20:31 UTC | |
by Anonymous Monk on Feb 24, 2003 at 08:28 UTC | |
|
Re: Serious Problem with Net::FTP and TSO End of Line "Missing"?!
by tachyon (Chancellor) on Feb 24, 2003 at 13:03 UTC |