Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number

Re: Re: Re: backtick problems with perl

by stephen (Priest)
on Mar 27, 2002 at 20:39 UTC ( #154807=note: print w/ replies, xml ) Need Help??

in reply to Re: Re: backtick problems with perl
in thread backtick problems with perl

It's true, typing:

perl -e "@dir=`dir`; print qq{hello, $dir[0]};"
Does print
However, this is because the first line of output from the Windows "dir" command is a blank line. If instead you use
perl -e "@dir=`dir`; print qq{hello, $dir[1]};"
you'll get
hello, Volume in drive C has no label


Clarification: My response only referred to the example in the parent node. I'm sorry that my response wasn't helpful. I tested my example code on running on Windows 98, and it gave the results I stated. Perhaps I've got an incorrect assumption running around someplace.

Comment on Re: Re: Re: backtick problems with perl
Select or Download Code
Replies are listed 'Best First'.
Re: Re: Re: Re: backtick problems with perl
by particle (Vicar) on Mar 27, 2002 at 21:17 UTC
    i --'ed your node. as ruffing stated, the first line is not blank. you might have seen this had you looked closely at my example:

    H:\perllib\Tk800.024>perl -e "@dir=`dir`;print \"hello, $dir[0]\"" hello, Volume in drive H is Disk#1 H:\perllib\Tk800.024>

    ~Particle ;

Re: Re: Re: Re: backtick problems with perl
by ruffing (Acolyte) on Mar 27, 2002 at 20:48 UTC
    Actually, it did work without a problem as I later posted and had nothing to do with the first line being blank (which it isn't). I've got the command line to work as stated in a later post but it still doesn't seem to be working through the web, which is an IIS5 setup.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://154807]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (4)
As of 2015-11-29 08:07 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (749 votes), past polls