more useful options | |
PerlMonks |
Re: Applying a regular expression to a stringby ysth (Canon) |
on Apr 04, 2005 at 11:54 UTC ( [id://444634]=note: print w/replies, xml ) | Need Help?? |
=~ is not related to the ~ operator; the assignment variant of ~ would be ~=, except that ~ is a unary operator and so has no assignment variant.
What you want is to select everything before the first \s, and assign that to $message_id; use a match, not a substitution, to do that: (Note the parentheses around $message_id that make it a list assignment; you need to do the
In Section
Seekers of Perl Wisdom
|
|