Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Printing last two characters

by olus (Curate)
on Jan 03, 2008 at 11:36 UTC ( [id://660168]=note: print w/replies, xml ) Need Help??


in reply to SOLVED Printing last two characters

If you want a regexp, this will work
/(.{2})$/
The '$' means the end of the string.
perl -le 'my $str="qwerty"; $str=~m/(.{2})$/; print $1;' #output ty

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (6)
As of 2024-04-24 01:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found