Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: rearranging a string.new

by VSarkiss (Monsignor)
on Nov 21, 2005 at 20:48 UTC ( [id://510555]=note: print w/replies, xml ) Need Help??


in reply to rearranging a string.new

The other responses in this thread are addressing your problem directly, but I wanted to point out an alternative.

In general, fixed-length string decomposition is easiest with unpack (and if necessary, its companion pack). Your particular example can be accomplished with:

my $newstring = join '' => reverse unpack('a4 a4', $string);
Golf anyone? :-)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (4)
As of 2024-03-29 15:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found