"Mark" <[EMAIL PROTECTED]> writes:

> I have looked at the perlopen tuturial, but I  am still not sure how to 
> accomplish this.  I just can't believe that it is as easy as,
> open(INFO,      "datafile") || die("can't open datafile: $!");  In other 
> words how does it know what software to open the "datafile" with?
> If I could get a look at sample code of this, that would be a HUUGE help.

Maybe you are looking for the pipe operator used in an `open'

./mynewscript.pl filename

## Pass in file name to be read
  my $Fname = shift;

## Give perl the address and program name of needed program
  my $cmd = '/path/to/SoftwareThatRunsProgram';

## Open file with the needed command <$cmd> ..
## Note pipe operator (|) after $cmd
  open(CMD,"$cmd|") or die "Cannot open $mcd; $!';
    while(CMD){
      ## Code here to manipulate lines that are being read 
      [...]
    }


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to