Warning: Function ereg() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 4

Warning: Function split() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 19

Warning: Function ereg() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 4

Warning: Function split() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 19

Warning: Function ereg() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 4

Warning: Function split() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 19

Warning: Function ereg() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 4

Warning: Function split() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 19

Warning: Function ereg() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 4

Warning: Function split() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 19
PERL: system and grabbing STDOUT
Results 1 to 5 of 5

Thread: PERL: system and grabbing STDOUT

  1. #1
    Senior Member
    Join Date
    Apr 2002
    Posts
    417

    PERL: system and grabbing STDOUT

    Hi,

    If I use the system command in perl

    system('/usr/bin/perl', 'pc.somedomain.com');

    it returns 0 if successful and prints the pings to STDOUT(commandline)

    how can I get all the info that is printed to STDOUT(the commandline?)

    thanx,

  2. #2

    Re:PERL: system and grabbing STDOUT

    [quote author=Blaqb0x link=board=9;threadid=7006;start=0#65043 date=1052764046]
    ...
    system('/usr/bin/perl', 'pc.somedomain.com');
    ...
    [/quote]
    Can't you just do this:

    $info=system('usr/bin/perl', 'pc.somedomain.com');

  3. #3
    Senior Member
    Join Date
    Apr 2002
    Posts
    417

    Re:PERL: system and grabbing STDOUT

    I wish.

    No, the system function returns 0 if it is successful.

  4. #4

    Re:PERL: system and grabbing STDOUT

    Can you pipe it to something else or append it to a file?

    system('/usr/bin/perl', 'pc.domain.com') > $file;

    Then just read the file into a variable, close and delete it?

  5. #5
    Senior Member
    Join Date
    Apr 2002
    Posts
    417

    Re:PERL: system and grabbing STDOUT

    No that doesn't work but I figured out that this does.


    $output = `ping somemachine`;

    print $output;


    >> this prints out the ping

Similar Threads

  1. perl system mail
    By svar in forum Linux - Hardware, Networking & Security
    Replies: 2
    Last Post: 02-08-2009, 05:19 AM
  2. procmail calling Perl, making a system call?
    By daroo in forum Linux - General Topics
    Replies: 9
    Last Post: 11-19-2008, 02:01 PM
  3. Perl Help
    By pwrhouse in forum Linux - Software, Applications & Programming
    Replies: 4
    Last Post: 04-06-2003, 11:57 PM
  4. perl question from a perl newb
    By tolstoy in forum Linux - Software, Applications & Programming
    Replies: 4
    Last Post: 09-06-2002, 01:16 AM
  5. STDOUT?
    By Killer_Penguin in forum Linux - Software, Applications & Programming
    Replies: 1
    Last Post: 02-25-2002, 01:22 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •