in reply to while (<FH>) always ends with "Couldnt read from remote file: End of file at"
[... some stuff here ] if ( $var eq "*" ) { $file = "name*"; # is some real file with an Asterix to search only + on them in the real code my $ls = $sftp->ls (wanted => qr/$file}/ ) or die "unable to retri +eve directory: ".$sftp->error; print "$_->{longname}\n" for (@$ls); } else { $file = "realname.ext"; # existing file say $file; # reading - default method - from the remote file $fh1 = $sftp->open("$file") or die $sftp->error; while (<$fh1>) { print if /ORA-/ || /Fehler/ || /ORACLE-Fehler/; # my $last = $_; # print $last; } exit 0;
|
|---|