Pantek Library
Hosting Provided By
CybrHost
High Speed Hosting

Re: Can System() of Perl be bypassed?

From: Brian Reichert <reichert(at)numachi.com>
Date: Tue Jan 28 2003 - 17:58:24 EST

On Tue, Jan 28, 2003 at 04:35:30PM -0600, NESTING, DAVID M (SBCSI) wrote:
> > open2(\*READ, \*WRITE, '/bin/grep', $sanitized_arg,

I wrote System2 to collect STDOUT and STDERR, in a manner that bypasses the shell as well. Output is returned in a a scalar, not a FH, which an important distinction.

  use System2;
  my ($out, $err) = system2("/bin/grep", $sanitized_arg, "/usr/dict/words");   my ($exit_value, $signal_num, $dumped_core) = &System2::exit_status($?)

See <http://search.cpan.org/author/REICHERT/System2-0.82/System2.pm>

Same kinda approach, and behaves on older perl versions.

-- 
Brian 'you Bastard' Reichert		
37 Crystal Ave. #303			Daytime number: (603) 434-6842
Derry NH 03038-1713 USA			BSD admin/developer at large	
Received on Tue Jan 28 18:09:24 2003

This archive was generated by hypermail 2.1.8 : Wed Aug 23 2006 - 14:02:46 EDT


Contact Us  Legal Notices  Order Services Online 
Pantek Home  Privacy Policy  IT news  Site Map  Pantek Library