D'oh! I would have caught that for you sooner, but it looks like I was using one of the proposed solutions instead of the OP code.
The reason for the difference is that 'dir' is not a program, it's a built-in command defined by the cmd.exe shell. When people start using Monad more I anticipate more people running into this issue when they try to invoke cmdlets as executables. -----Original Message----- From: news [mailto:[EMAIL PROTECTED] On Behalf Of Michael Goldshteyn Sent: Thursday, April 06, 2006 12:02 PM To: beginners@perl.org Subject: Re: Why does dir produce different results when called from Perl The answer to my own question in the OP. There is a difference, because the following should be performed to get the behavior of: dir | perl -pne "" perl -e "print `cmd /C dir`;" the cmd /C part is required to get equivalent behavior. Mystery solved! -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>