Dear Masters,
I have the following directory structure for storing my code and one binary executable use by the Perl's code.
~/MyPerl | | |__ src/ |_ mycode.pl | |_ a_program.out
Currently in mycode.pl, I have
use strict; use warnings; my @output = `./a_program.out -f someparam`; # line 217 # This also does not work # my @output = `home/myname/MyPerl/src/a_program.out -f someparam`; chomp @output; # do something with @output # Rest of the code
Although I have no problem running the following:
~/MyPerl $ perl -c src/mycode.pl mycode.pl syntax OK
But I have problem when doing this:
~/MyPerl $ perl src/mycode.pl
It gives:
Can't exec "./a_program.out": No such file or directory at src/mycode.pl line 217.
I've tried setting full path under backtick also but it still give the same error. What's wrong with my path setting under backtick? Did I miss anything?

Update: Thanks a lot for the answer. It works fine now.

---
neversaint and everlastingly indebted.......

In reply to Backtick and problem with setting path within it by neversaint

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.