Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Read a variable backwards..

by Random_Walk (Prior)
on Jan 06, 2014 at 12:11 UTC ( #1069500=note: print w/replies, xml ) Need Help??


in reply to Read a variable backwards..

my $var = "11223344556677889900"; for (1..length $var) { print substr $var, -$_, 1; # or do anything else with it }
or as a one liner perl -E '$v="11223344556677889900";say substr $v, -$_, 1 for (1..length $v)'

Cheers,
R.

Pereant, qui ante nos nostra dixerunt!

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1069500]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (4)
As of 2016-12-08 01:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (133 votes). Check out past polls.