Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2003
    Posts
    56

    Unanswered: Shell module problem...

    I've been succesfully using the Shell module for a while now, but today I ran into a problem.

    I need to run an executable that is not in the search path. I did:

    Code:
    my $sh = /path/to/executable (' some option');
    print $sh;
    And was rewarded with a "Division by Zero" error message... I tried a few types of quotes around the command but it keeps failing with different error messages.

    Any clues how to do this without resorting to:
    Code:
    my $sh = ksh (' /path/to/executable some options');
    ?

  2. #2
    Join Date
    Jan 2004
    Location
    Germany
    Posts
    167
    you can do it this way
    Code:
    my $sh = '/path/to/executable'; # use single quotes
    my $ret = `$sh param1 param2`; # use backticks, NOT single quotes!
    board.perl-community.de - The German Perl-Community

  3. #3
    Join Date
    Dec 2003
    Posts
    56

    Talking

    Thanx! Works like a charm

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •