Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Your favourite gory detail...

by QM (Parson)
on Jun 21, 2004 at 01:51 UTC ( #368350=note: print w/replies, xml ) Need Help??


in reply to Your favourite gory detail...

Not really weird, but I sometimes get caught being too fancy. I try to do a s///, and expect it to return the matches as a list. Sometimes I write this:
if ( ( $a, $b, $c ) = $current_text =~ s/$some_regex// ) { # do something useful next READ_MORE_DATA }
in a parserish way. Then I have that forehead-slapping moment, and change it to this:
if ( $current_text =~ s/$some_regex// ) { ( $a, $b, $c ) = ( $1, $2, $3 ); # do something useful next READ_MORE_DATA }

-QM
--
Quantum Mechanics: The dreams stuff is made of

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://368350]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (5)
As of 2021-10-27 23:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My first memorable Perl project was:







    Results (95 votes). Check out past polls.

    Notices?