Dec 20, 2013, 4:01 AM
Post #1 of 8
Hi Perl Gurus,
Running shell commands within perl script
This is my first post, so please forgive me if i violate any norms.
I have been trying to run the shell command like the one below
$cmd=[[`echo hello`]] || [[`echo hellohello`]] && sleep 10;
actually i need to check the return value if null or not, if not null the the succeeding command should run.
The above command will run fine in bash shell, when i tried within perl like `$cmd` it issues error [[ not found.
But when i use eval command it seems to be working.
eval $cmd, does not produce any error but "sleep" command is not called.
Can someone help to solve this issue?