Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
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 having an uproarious good time at the Monastery: (5)
As of 2025-07-18 10:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.