not really... =~ indicates the match should be on the var on the LHS of the
operator.. in this case, $strip.
however, $strip is the variable where he wants the word chars STORED that
are in $_ (implicitly set from the while loop),
not the variable he wishes to match on. Furthermore, to capture, you must
use parenthesis....
the correct syntax would be:
while(<TEMP>){ my ($strip) = /(\w+)/; do_stuff }
NOTE:
$_ in this case will still hold a \n, so if you want to get rid of that, add
a 'chomp' in there
hth
Jos Boumans
> you want that to be:
>
> $strip =~ /\w+/; #??
>
> see the ~ thingie
>
-----Original Message-----
> I'm running perl version 5.005_03 and I have a simple
> match and capture that I can't seem to get to work.
>
> while (<TEMP>) {
>
> $strip = /\w+/;
> print "$strip \n";
> }
>
> This just returns to me a 1.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]