Anand Parthiban wrote:
Dear Team,
Hello,
I have a Issue while using Filesys::SmbClientParser
Below is my code :
#!/usr/bin/perl
use Filesys::SmbClientParser ;
$smb = new Filesys::SmbClientParser(undef, (user => $input_hash{DMS_USER},
password => $input_hash{DMS_PASS}));
$path = "\path\to\folder" ;
$share = "d$" ;
$ip = "192.168.0.125" ;
$file = "test.txt" ;
$rv =$smb->Host($ip);
$rv =$smb->Share($share);
$rv =$smb->cd($path);
$rv =$smb->put($file);
When i execute the above code i got the following Error :
sh: -c: line 0: unexpected EOF while looking for matching `"'
sh: -c: line 1: syntax error: unexpected end of file
Those are 'sh' shell errors, they are not related to Perl.
But With the Same Code ( With slight Change ) It works Fine
#!/usr/bin/perl
use Filesys::SmbClientParser ;
$smb = new Filesys::SmbClientParser(undef, (user => $input_hash{DMS_USER},
password => $input_hash{DMS_PASS}));
$path = "\path\to\folder" ;
$share = "d$" ;
$ip = "192.168.0.125" ;
$file = "test.txt" ;
$rv =$smb->Host($ip);
$rv =$smb->Share($share);
$rv =$smb->cd('/path/to/folder'); ( Embeded the Path in single Quotes )
( Even it is not working with Double Quotes )
$rv =$smb->put($file);
How Can i get rid of this issue
Have a look at the two strings you are using:
"\path\to\folder"
'/path/to/folder'
Now try printing them out:
#!/usr/bin/perl
use warnings;
use strict;
print "\path\to\folder";
print '/path/to/folder';
Can you see the difference in the output?
John
--
Any intelligent fool can make things bigger and
more complex... It takes a touch of genius -
and a lot of courage to move in the opposite
direction. -- Albert Einstein
--
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
http://learn.perl.org/