Thanks japhy and Wags ;)
It works fine now with the backslashes!
Bhanu
On Feb 21, Wagner-David said:
> The $1 and $2 come out of reqex with parens.
That's not helping, though. The answer he seeks is:
backslash the $
signs.
--
Jeff "japhy" Pinyan [EMAIL PROTECTED]
htt
On Feb 21, Bhanu Prakash said:
>my $myname='hi There';
>system "ls","-la";
>system "echo","$myname";
>qx{awk '{ if ($myname==$1) { do something } else print
>$2,$1 }'};
>
>My script is complaining about uninitialized
>variables..
>I suspect it is talking about $1 and $2s .Can I not
>place them he
On Feb 21, Wagner-David said:
> The $1 and $2 come out of reqex with parens.
That's not helping, though. The answer he seeks is: backslash the $
signs.
--
Jeff "japhy" Pinyan [EMAIL PROTECTED] http://www.pobox.com/~japhy/
RPI Acacia brother #734 http://www.perlmonks.org/
>
To: <[EMAIL PROTECTED]>
Sent: Friday, February 22, 2002 2:05 AM
Subject: [Q] How can I pass Perl variables into shell?
> Hi,
> Can I not do something like...
>
> #!/usr/local/bin/perl
> use strict;
> my $myname='hi There';
> system "ls",&quo
Wags,
Let me try to explain what I wanted to do with awk
script. When the user enters some data in the form, I
want to search for this data as key in a datafile and
update the information next to that information with
another field entered by user .
e.g.,
my input file..
bhanu tclprogrammer
w
akash [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 21, 2002 23:25
To: Wagner-David; [EMAIL PROTECTED]
Subject: [Q] How can I pass Perl variables into shell?
Wags,
Didn't get you there?! Any examples?! which does
similar thing?!
Thanks
Bhanu.
The $1 and $2 come out of reqex w
bject: [Q] How can I pass Perl variables into shell?
Hi,
Can I not do something like...
#!/usr/local/bin/perl
use strict;
my $myname='hi There';
system "ls","-la";
system "echo","$myname";
qx{awk '{ if ($myname==$1) { do something } else pr
The $1 and $2 come out of reqex with parens.
Wags ;)
-Original Message-
From: Bhanu Prakash [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 21, 2002 23:05
To: [EMAIL PROTECTED]
Subject: [Q] How can I pass Perl variables into shell?
Hi,
Can I not do something like
Hi,
Can I not do something like...
#!/usr/local/bin/perl
use strict;
my $myname='hi There';
system "ls","-la";
system "echo","$myname";
qx{awk '{ if ($myname==$1) { do something } else print
$2,$1 }'};
My script is complaining about uninitialized
variables..
I suspect it is talking about $1 an