Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: reverse a string in place

by Anonymous Monk
on Feb 28, 2016 at 08:13 UTC ( [id://1156358]=note: print w/replies, xml ) Need Help??


in reply to reverse a string in place

Toady Tim. Is map() a function, technically?

#! /usr/bin/perl -lw my @a = split //, shift; print "INPUT = <@a>"; # @a[0..$#a] = @a[map -1-$_, 0..$#a]; @a[$_,~$_] = @a[~$_,$_] for 0..$#a/2; print "OUTPUT = <@a>";

Log In?
Username:
Password:

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

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

    No recent polls found