Re: [Ssh-sftp-perl-users] Error: Wide character in subroutine entry at /usr/lib/perl5/vendor_perl/5.
Brought to you by:
dbrobins
From: Robert L. <rla...@ao...> - 2005-07-25 14:30:37
|
On Thu, Jul 21, 2005 at 09:51:42PM -1000, Kr@nX wrote: > use Cwd 'abs_path'; > $currentpath = abs_path($ENV{'PWD'}); > > my %args = ("user", 'user', "password", 'passwd', "debug", '1'); > my $host = 'node2'; > my $sftp = Net::SFTP->new($host,%args); > > for ($a=0; $a < scalar(@node2_files); $a++) { > my $localfile = $currentpath . "/". $node2_files[$a]; > #my $remotefile = 'test'; > my $remotefile = '/home/user/' . $node2_files[$a]; > > $sftp->put($localfile,$remotefile); > } > [snip] > master: channel 1: open confirm rwindow 0 rmax 32768 > master: sftp: Sending SSH2_FXP_INIT > master: sftp: Remote version: 3 > master: sftp: Sent SSH2_FXP_OPEN I:0 P:/home/user/epoch104.TXT > Wide character in subroutine entry at /usr/lib/perl5/vendor_perl/5.8.0/Digest/HMAC.pm line 59. > I'm just guessing here, but I bet there's some garbage at the end of the filename... Something like a newline or carriage return. Or a null. Right after the assignment, try doing something like $remotefile =~ s/\r|\n|\0//g; And just FYI, I think use Cwd; $currentpath = cwd(); will do what you want, at least most of the time. Hope that helps, Rob |