$rt is false (0) after the run

Is it false because there was not output (empty string) or is it undefined because the command failed to execute at all?  In the latter case, you could print out the system error message to see if it might provide some hint as to what's going wrong (that would typically be "No such file or directory", for example, if the command isn't found along the configured search path):

my $rt = `...your command...`; print "error: $!\n" unless defined $rt;

Are you running your Perl script from exactly the same command line / environment that you can successfully execute it in without the backticks wrapper?

In cases like these, it's usually best to start with whatever works, and then modify things in small steps until it no longer works. For example, you could try to run the command within backticks from the shell, or run it with system from Perl... both with and without the 2>&1 redirection, etc. — and all from the same command line, to begin with.

If all else fails, you could trace the system calls being made to get a clearer picture of what's going on, e.g.

$ strace -f ./686679.pl or, to redirect the output to a file: $ strace -f -o strace.out ./686679.pl or, to trace only specific system calls, like execve, $ strace -f -e execve ./686679.pl or the set of 'file' system calls, etc. $ strace -f -e file ./686679.pl

(If you're having difficulties interpreting strace's output, post the last 20-30 lines here...)


In reply to Re^3: Help with sql*loader by almut
in thread Help with sql*loader by martino

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.