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
* Wagner-David ([EMAIL PROTECTED]) wrote:
> 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;
> which is not what you are after.
>
> If you really want the regex then:
>
> $ARGV[0] =~ s/$ARGV[0]/\($ARGV[0]\)/g;
> would work for you.
>
> Wags ;)
>
> -----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 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 won't.
>
> Thanks,
> --
> ------------------------------------------------
> Martin Karlsson [EMAIL PROTECTED]
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
--
------------------------------------------------
Martin Karlsson [EMAIL PROTECTED]
11.pl
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]