Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Applying a regular expression to a string

by ambs (Pilgrim)
on Apr 04, 2005 at 11:42 UTC ( #444628=note: print w/replies, xml ) Need Help??


in reply to Applying a regular expression to a string

If $a=+1 is not the same as $a=$a+1. This is just true in case $a is undef or zero. So, you might want to say $a+=1 is the same as $a=$a+1. In any case, $a=$a+1 changes $a, so that is not what you want.

Your second code snipet is correct. You can also use

($message_id = $message)=~s/\s.*//;

Alberto Simões

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (1)
As of 2023-09-26 23:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?