Re: regexp with $ARGV

2001-11-08 Thread Dave Storrs
On Mon, 5 Nov 2001, Martin Karlsson wrote: > Thanks a lot for your help and your time! I think I've got it solved > now. You're welcome. :> > Could any of you recommend a good book for (learning) Perl? There seems > to be quite a few to choose from... Oddly enough, that's w

RE: regexp with $ARGV

2001-11-04 Thread Peter Scott
At 11:38 AM 11/4/01 -0800, Wagner-David wrote: > If you only want to place parens around the input, then you can > just place it parans like: > $ARGV[0] = '(' . $ARGV[0] . ')'; Somewhat clearer: $ARGV[0] = "($ARGV[0])"; > In your original code, you want

Re: regexp with $ARGV

2001-11-04 Thread Dave Storrs
Martin, I'm not entirely clear on what you're trying to do here, so if this doesn't help, let me know and I'll try again. I think the problem is that you're doing this: s/$ARGV[0]/\($ARGV[0]\)/g ...when you want to affect $ARGV[0]. But remember that s/// and m// are, b

Re: regexp with $ARGV

2001-11-04 Thread Martin Karlsson
t; > -Original Message- > From: Martin Karlsson [mailto:[EMAIL PROTECTED]] > Sent: Sunday, November 04, 2001 03:54 > To: [EMAIL PROTECTED] > Subject: regexp with $ARGV > > > Could anyone please show me the way to think here? > > If I execute a script with a

RE: regexp with $ARGV

2001-11-04 Thread Wagner-David
To: [EMAIL PROTECTED] Subject: regexp with $ARGV Could anyone please show me the way to think here? If I execute a script with an argument, e.g monkey, then monkey will be found in $ARGV[0]. If I then want to highlight the word monkey by putting it in parentheses, i thought something like s/$ARGV[0]/

regexp with $ARGV

2001-11-04 Thread Martin Karlsson
Could anyone please show me the way to think here? If I execute a script with an argument, e.g monkey, then monkey will be found in $ARGV[0]. If I then want to highlight the word monkey by putting it in parentheses, i thought something like s/$ARGV[0]/\($ARGV[0]\)/g would do the trick; however it