in reply to Re: Perl on cygwin
in thread Perl on cygwin

system('sh -c "cd ..;ls"');

That is better written as:

system('cd ..;ls');

- tye        

Replies are listed 'Best First'.
Re^3: Perl on cygwin (sh -c)
by sgt (Deacon) on Nov 19, 2007 at 23:24 UTC

    Yes, it does save one process besides being shorter. Still it could give wrong results if cd fails. A true shell hacker ;) would write system('cd ... && ls') (would even use 'ls -1' to avoid terminal issues).

    cheers --stephan