Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hello,

Is it possible, (I'm sure it is) to execute a system call in windows, and direct the output to a variable?

Replies are listed 'Best First'.
Re: system call variable
by Zaxo (Archbishop) on Dec 18, 2002 at 22:56 UTC

    Use backticks: my $foo = `bar.exe args`;

    After Compline,
    Zaxo

      So is it possible to do?
      my $foo = 'wc $filename -l'; #in a cgwin environment on windows?
      Thanks

        Look closely at the quotes ZAxo was using and yours.

        Eg. Zaxo used ````` these, you used '''''' these. The difference is important.


        Examine what is said, not who speaks.

A reply falls below the community's threshold of quality. You may see it by logging in.