in reply to open with pipe
If I read your post correctly, you're basically wanting to issue a system command from Perl and read the output of that command back into Perl. Based on that, I personally would go with what I consider in my mind to be the "quick and dirty" method, which is to use back ticks to issue the command.
In my sample code below, I'm storing a command in $cmd and then using back ticks issue that command and store the output in $cmd_out.
use strict; my $cmd = 'cat /proc/cpuinfo'; my $cmd_out = `$cmd`;
There's a few things to keep in mind with this method:
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: open with pipe
by afoken (Chancellor) on Aug 01, 2010 at 07:21 UTC | |
by ikegami (Patriarch) on Aug 01, 2010 at 16:59 UTC | |
by afoken (Chancellor) on Aug 01, 2010 at 19:05 UTC | |
by ikegami (Patriarch) on Aug 02, 2010 at 03:34 UTC | |
by afoken (Chancellor) on Aug 02, 2010 at 15:26 UTC | |
by dasgar (Priest) on Aug 01, 2010 at 13:50 UTC |