Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: reverse a string in place

by kcott (Archbishop)
on Mar 24, 2013 at 09:23 UTC ( [id://1025135]=note: print w/replies, xml ) Need Help??


in reply to reverse a string in place

Perhaps this will satisfy your teacher:

$ perl -e ' + $x = "abcdefghi"; print +($x =~ /./g)[-$_] for (1 .. $#{[$x =~ /./g]} + 1); ' ihgfedcba

-- Ken

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (4)
As of 2024-04-25 11:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found