Basically, $message =~ s/[\r\n]+$//; does a substitution on the string $message, replacing one or more ([...]+) characters in the given class ([\r\n], the escape sequences for carriage return and line feed), as long as they're right before the end of the string ($). That's a really bare explanation of the regular expression; see perlrequick and perlretut for more detail.
Regular expressions are one of Perl's sharpest tools: they can help you get a lot of work done in a hurry, but they aren't easy to use. Spending some time learning about them would be a good idea, but don't get discouraged if you don't "get it" right away.
--
F
o
x
t
r
o
t
U
n
i
f
o
r
m
Found a typo in this node? /msg me
The hell with paco, vote for Erudil!
|