Thread:       qx_broken_on_Win98
Message:      001_0002_0010
From:         "Keith C. Dandelion" <kcivey@some.web.address.com>
Text:

lang@some.web.address.com wrote:

> 	C:\cygwin\home\greg\smoke>perl -e "qx/cd/"
> 
> 	C:\cygwin\home\greg\smoke>perl -e "system( q/cd/ )"
> 	C:\cygwin\home\greg\smoke
> 
> here it is from a bash shell:
> 
> 	greg@momotaro ~/smoke
> 	$ perl -e 'qx/pwd/'  
> 
> 	greg@momotaro ~/smoke
> 	$ perl -e 'system( "pwd" )'
> 	/home/greg/smoke

And?  What is it that you think is wrong?  Have you read the 
documentation for qx()?  It's not the same as system() -- it's 
the same as backticks.

It's not impossible for something to be broken in perl, but 
whenever you suspect it is, remember that it's orders of 
magnitude more likely that what's broken is your program or 
your understanding of the situation.

-- 
Keith C. Dandelion <kcivey@some.web.address.com>
Washington, DC

--__--__--

Thread:       qx_broken_on_Win98
Message:      001_0002_0007
From:         lang@some.web.address.com
Text:

qw// seems to be
broken when perl is built with GNU tools, and dmake on Win98.
Or is it something wrong with my system?

here it is from a bash shell:

Here is some id:
C:\s\home\greg>perl -v

C:\perl\bin>.\perl -e "qx/cd/"

C:\perl\bin>.\perl -e "system( q/cd/ )"
C:\perl\bin

What do you make of this?

-- 
Greg Marlinson, TAiwan

--__--__--

Thread:       qx_broken_on_Win98
Message:      001_0002_0008
From:         Tobias Heinrich <thoellri@some.web.address.com>
Text:

Works fine, once you know what the difference between system and qx is (read
"perldoc -f system" and "perldoc perlop" [search for `STRING` in the later
one]). 

(on FreeBSD):
frisco% pwd
/usr
frisco% perl -v

frisco% perl -e 'qx{pwd};'      
frisco% perl -e 'print qx{pwd};'
/usr
frisco% 

(on Windows XP):
C:\>cd
C:\

Hope this helps
 Tobias

--__--__--

Thread:       qx_broken_on_Win98
Message:      001_0002_0012
From:         Greg Marlinson <lang@some.web.address.com>
Text:

Looking up the docs for system,

           The return value is the exit status of the program as returned
           by the "wait" call. To get the actual exit value shift right by
           eight (see below). See also "exec". This is *not* what you want
           to use to capture the output from a command, for that you should
           use merely backticks or "qx//", as described in "`STRING`" in
           perlop. Return value of -1 indicates a failure to start the
           program (inspect $! for the reason).

I always interpreted that passage to mean it was optional, which one 
you used, if you were only interested in the output!

For qx//

   qx/STRING/
   `STRING`
           A string which is (possibly) interpolated and then executed as a
           system command with "/bin/sh" or its equivalent. Shell
           wildcards, pipes, and redirections will be honored. The
           collected standard output of the command is returned; standard
           error is unaffected. 

What does that unaffected mean? The same thing happens to it as any
error message the program generates?

-- 
Greg Marlinson, Taiwan

--__--__--

Thread:       qx_broken_on_Win98
Message:      001_0002_0009
From:         Odysseus <kalinabears@some.web.address.com>
Text:

lang@some.web.address.com wrote:
> qw// seems to be
> broken when perl is built with GNU tools, and dmake on Win98.
> Or is it something wrong with my system?
> 
> 	C:\cygwin\home\greg\smoke>cd
> 	C:\cygwin\home\greg\smoke
> 
> 	C:\cygwin\home\greg\smoke>perl -e "qx/cd/"
> 
> 	C:\cygwin\home\greg\smoke>perl -e "system( q/cd/ )"
> 	C:\cygwin\home\greg\smoke
> 

I get the same behaviour on Win2k, with both AS-built perl and 
Mingw-built perl (cmd.exe shell).

Should it be different ? (Not a rhetorical question ..... I don't know 
the answer :-)

Cheers,
Rob

--__--__--

Thread:       qx_broken_on_Win98
Message:      001_0002_0011
From:         Greg Marlinson <lang@some.web.address.com>
Text:

On Tue, 10 Feb 2004, Tobias Heinrich wrote:

> Works fine, once you know what the difference between system and qx is (read
> "perldoc -f system" and "perldoc perlop" [search for `STRING` in the later
> one]). 

Thanks. Here too,

the right results. Trying that with system

That's interesting. That first line must be coming out as STDERR
and the O is STDOUT, I think. There is no error in 

An error message about mistaken specification of directory.

-- 
Greg Marlinson, Taiwan

--__--__--

