Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Read a variable backwards..

by Random_Walk (Parson)
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!


Comment on Re: Read a variable backwards..
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (4)
As of 2014-07-13 15:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (250 votes), past polls