in reply to return a value from perl script to perl module call ing the script

Assuming there is a good reason why you can't move the contents of test.pl to a module, to avoid such shelling out...

The test.pl can return a value to the shell as the argument of an exit() call. This will then be picked up by the system() call to run test.pl that occurs in test.pm.

Caveat: Also see perlport for the impact of different platforms on the behaviour of the system() call.

-M

Free your mind

  • Comment on Re: return a value from perl script to perl module call ing the script