in reply to invoke shell with `` failed

This is similar to node 684300.
Depending on the version of *NIX you are using, there are limitations on the length or number of command line arguments, set in kernel. Some platforms have a limit of 255 entries, Linux has a size limit instead which defaults to (last time I looked) 32 pages (128kb on 32-bit Intel), but this can be changed by tweeking a kernel parameter.
Check the number, and size, of parameters being sent in the command.

Replies are listed 'Best First'.
Re^2: invoke shell with `` failed
by jiangliguo (Initiate) on Apr 15, 2009 at 09:09 UTC
    It seems my problem is not the same as node 684300. since when i use
    $begin_load = `cat /proc/loadavg`;
    I will also encounter the same issue.
      Clearly,
      my $variable = `cat some.file`;
      works fine for "well-behaved" files. I suspect the problem you are having is due to the contents of the file you are listing. Either it is too large (i.e. larger than your RAM so Perl cannot fit it into the scalar, which is unlikely) or it contains some character sequence that causes problems. Does your shell list the file OK?

      Cheers - Pat