in reply to perl and shell

Whydid you first discuss this with us in the CB but then ignore and not even mention our advice or the problem you're trying to solve? Why don't you even post the code you have so far??

I'm confident you have read system and the section in perlop about "backticks", so maybe you can tell us how the sample code there could be improved, or at least where you have problems with it.

Replies are listed 'Best First'.
Re^2: perl and shell
by editi (Novice) on Jun 30, 2007 at 17:37 UTC
    Monks, My code is
    #!/usr/bin/perl system('./hello.sh FileOpen.pl') == 0 or die "Couldn't launch './hell +o.sh': $! / $?";
    and output is
    perl Sample.pl Hello Madam It is Working ./hello.sh: line 3: #!/usr/bin/perl: No such file or directory Couldn't launch './hello.sh': / 32512 at Sample.pl line 2.
    The script is
    #!/bin/bash echo 'Hello Madam It is Working'; `cat $1`;
    I am new to perl with shell thats why i added in this portion
    and i have a doubt is there any module "shell" . please help me from where i have to download.
    Thanks in advance
      `cat $1`

      That doesn't make much sense. You're trying to run the contents of FileOpen.pl as a shell command...

      Just write ./$1 instead and everything will be fine. The "./" part might be required, as on Unix, "." (the current directory) is typically not in the searchpath for executables (for security reasons).