Michael Goldshteyn wrote:

What does different environments mean? Why should the two uses of dir differ in their output?

because system calls rely on you ENV via CLI and %ENV when called in perl. (IE *you* are executing it in CLI and *perl* is executing it when using backticks = different environments = different results (possibly))

To find out exactly why "dir" behaves that way you'd need to ask the "dir" program developers or look at its source code.

For reliablity its best to use Moduells instead of system calls for just such a portability issue as you see in your OP.

"Mr. Shawn H. Corey" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]

On Thu, 2006-06-04 at 10:42 -0500, Michael Goldshteyn wrote:

That is, why does the output differ between:

perl -e "print join(\"\n\",@{[`dir`]});"

and

dir | perl -pne ""

Different environments. Use File::Find instead. See `perldoc File::Find`
for details.

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to