$ perldoc perlre
The \A anchors the search at the beginning of the string. A ^ anchors a search at the beginning of the LINE in a string. Documentation is a wonderful thing.
-- [ e d @ h a l l e y . c c ] | [reply] [d/l] |
I don't understand why you want to act in such an obscure manner, because without the /m modifier, as here, there is no difference between /^\s*/ and /\A\s*/. So you might just as well use the far more familiar form, with the caret.
The difference between /\Z/, /\z/ and /$/ is far more significant.
Well, I do agree with you on the RTFM part... it's all in there. Looking there should become a more natural response, than asking here.
I'd prefer
s/^\s+//;
anyway, as this wouldn't do an empty substitution if the string doesn't start with whitespace. | [reply] [d/l] |