in reply to Re: invoke shell with `` failed
in thread invoke shell with `` failed

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.

Replies are listed 'Best First'.
Re^3: invoke shell with `` failed
by parv (Parson) on Apr 15, 2009 at 10:07 UTC
Re^3: invoke shell with `` failed
by pat_mc (Pilgrim) on Apr 15, 2009 at 10:01 UTC
    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