in reply to system & shell metacharacters

Are you sure you want to pass XML data on the command line? Why not have bar.pl read the XML data from stdin? Or, for that matter, why not just give bar.pl the name of the file and have it read the XML file itself?

Replies are listed 'Best First'.
Re: Re: system & shell metacharacters
by snax (Hermit) on Jul 23, 2003 at 00:46 UTC
    I'm with you. I'd use something like
    open BAR, '|bar.pl' || die qq(Useful msg: $!); print BAR $xmldata;
    and let bar.pl read from STDIN. No shell at all. OP might want a glance at perlipc.
      open BAR, '|bar.pl' || die qq(Useful msg: $!);

      ... is wrong, because it is interpreted as:

      open BAR, ('|bar.pl' || die qq(Useful msg: $!));

      ... so remember to use "or die" rather than "|| die".

        Really? Ya learn something new every day :) I have a great number of scripts to modify, it would seem....
Re: Re: system & shell metacharacters
by bunnyman (Hermit) on Jul 23, 2003 at 16:02 UTC
    Do not pass large amounts of data on the command line. The system only provides a certain amount of memory for that data and you can not exceed that amount.