in reply to Quick Regex question

Bind the string to the operation using =~ (see perlop):
$blah2 =~ s/\w+//;

Update: Note this doesn't prevent you from doing this:

my ($word) = $string =~ /(\W+)/;
But you should be careful about maintainability. This trick appears to only work with the m// construct in list context.

Replies are listed 'Best First'.
Re: Re: Quick Regex question
by runrig (Abbot) on Nov 18, 2000 at 02:45 UTC
    Mistake. sorry. This node scheduled for removal (hopefully!).