Loading ...
Sorry, an error occurred while loading the content.

RE: [PBML] Questions about a return value from a script

Expand Messages
  • Bobby Jafari
    Hi All, I have two scripts. The first script is called runsuite.pl and it uses Test::Harness. This script invokes all the other scripts that I have. i.e.
    Message 1 of 5 , Oct 23, 2005
    • 0 Attachment
      Hi All,

      I have two scripts. The first script is called runsuite.pl and it uses
      Test::Harness. This script invokes all the other scripts that I have.
      i.e.

      runtests (myscript.pl);

      I need to know the value of global scalar variable $Failures from within
      runsuite.pl and after myscript.pl has ended. Randal told me that when
      runtests () invokes a scripts, using global variables in this way will
      not work. Now I am trying to figure out a way to have the scripts pass a
      value back to runsuite.pl

      Part of the problem may be the was I have used the module Test::Harness.
      I like the fact that I can use runtests() to invoke my scripts, but
      runtests () looks for OK / not OK in the STDOUT return from the scripts
      it running.

      So am considering to change runsuite so that it invokes my test scripts
      in the following manner:

      system (perl myscript.pl) so that I can capture the return value from
      the script. So the question is, How do I return a SCALAR value, when a
      script ends its execution?

      Thanks all for reading my long email.

      Regards,
      Bobby

      -----Original Message-----
      From: perl-beginner@yahoogroups.com
      [mailto:perl-beginner@yahoogroups.com] On Behalf Of Jeff 'japhy' Pinyan
      Sent: Monday, 24 October 2005 0:41
      To: perl-beginner@yahoogroups.com
      Subject: Re: [PBML] Questions about a return value from a script

      On Oct 23, Bobby Jafari said:

      > @ARGV is used to pass argument to a script. Is thers anything that we
      >can use to get a return value from a script (similar to return from
      >subroutine but return is not allowed outside of a subroutine.)

      All programs have one return value, the system return value; 0 denotes
      success, non-0 denotes failure of some sort.

      If you want to send data back of some sort, you probably just want to
      print it and have the other program read it.

      What do you have in mind?

      --
      Jeff "japhy" Pinyan % How can we ever be the sold short or
      RPI Acacia Brother #734 % the cheated, we who for every service
      http://www.perlmonks.org/ % have long ago been overpaid?
      http://princeton.pm.org/ % -- Meister Eckhart


      ------------------------ Yahoo! Groups Sponsor --------------------~-->
      Get Bzzzy! (real tools to help you find a job). Welcome to the Sweet
      Life.
      http://us.click.yahoo.com/A77XvD/vlQLAA/TtwFAA/ndFolB/TM
      --------------------------------------------------------------------~->

      Unsubscribing info is here:
      http://help.yahoo.com/help/us/groups/groups-32.html
      Yahoo! Groups Links
    Your message has been successfully submitted and would be delivered to recipients shortly.