in reply to how to store the output of a 'system' call to a variable

Hi,

     You can use backtick operator.Example:
my $result = `./script.pl`;

     But dont rely on this backtick operator or 'system' functions. Because of two reasons,

  • They will not give us the error messages. To get them, we need to explicitly redirect them. Example,
     my $result = `./script.pl 2>&1`;
  • Next, if you go for this OS depended functions, your code needs change for another OS to get the same functionality. Instead of this we can go for the builtin functions which is available in perl itself.

    Regards,
    S.Venni Rajan.
    "A Flair For Excellence."
                    -- BK Systems.