develooper Front page | perl.beginners | Postings from January 2002

What are the uses of the =~ operator?

Thread Previous | Thread Next
From:
rabs
Date:
January 16, 2002 16:50
Subject:
What are the uses of the =~ operator?
Message ID:
018a01c19ee1$0698ec40$5ad5c150@l6m7q4
I am new to regualr expressions and becoming  accqainted with the =~
operator. It appears to me that the =~ allows me to match a pattern in a
REGEX against a variable. As such it  replaces the $_ varible.

$name =~ /[rabs]/;

mtaches with a string containing   any of the following characters   r a b s

is this correct? I am quite confused....


Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About