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
Hi! Thanks for your help, I really appreciate it. However, I just don't seem able to figure out how to do it; please have a look at the attached script. Perhaps you can find some stupid rookie-mistake in it which could explain why it's not working the way I want :-). Have a nice week, /Martin * W

RE: regexp with $ARGV

2001-11-04 Thread Wagner-David
If you only want to place parens around the input, then you can just place it parans like: $ARGV[0] = '(' . $ARGV[0] . ')'; In your original code, you want to work with $ARGV[0] but the regex w/o inputs assumes: $_ =~ s/$ARGV[0]/\($ARGV[0]\)/g;