Welcome to the Monastery | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
When you are having trouble with regex matching, and you are certain your regex is correct, then it's time to check exactly what's in the string you're matching. One trick is to do this:
Any trailing whitespace will be apparent:
And if there is a newline at the end of the string, you'll see something like this:
Or if you want to reveal every character's ascii code, you can do this: Edit: the printf applies ord() to the characters, so the printf is not limited to ascii characters. In reply to Re: Printing Last Element of a line using perl memory?
by 7stud
|
|