in reply to sending arguements to external program

if you whant to send an input to an external program and trap the output the you need IPC::Open2 (perldoc IPC::Open2)
the error message you posted suggest your program interpretes command line arguments as names of file to open
however a vast majority of programs also works with input from STDIN so IPC::Open2 should work...
  • Comment on Re: sending arguements to external program

Replies are listed 'Best First'.
RE: Re: sending arguements to external program
by Anonymous Monk on Nov 09, 2000 at 19:06 UTC
    I'm trying to avoid using any exertanl modules ... the system that it iwll ultimately run on only has a standard perl install.

    Is it possible to pass an external program a variable at the command line that contains the contents of a file, so that the program runs it as such?
      No. Command line arguments cannot exceed a small size. If you want to be passing larger amounts of data between applications, you need to use standard IPC techniques (see perlipc). Something like this:
      # in parent open(CHILD, "|other_program arg1 arg2") or die "other: $!"; print CHILD $large_amount_of_data; close(CHILD); # in child local $/; $large_amount_of_data = <STDIN>;
      Again, see perlipc for more examples and alternatives.