in reply to How is outputting to an array different from outputting to a file


you can also do:

open ( RI,"lpstat -v -d -p -l -D |") || die "Can't run
lpstat:$!\n";

my $data = do { local $/; <RI> }; # or however you load it.


(but in this case is better $data=`lpstat -v -d -p -l -D`...unless you modify the script and you work on lpstat output line by line)
  • Comment on Re: How is outputting to an array different from outputting to a file