Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Swapping a record in a File

by rob_au (Abbot)
on Dec 29, 2003 at 12:37 UTC ( #317417=note: print w/ replies, xml ) Need Help??


in reply to Swaping a record in a File

For this problem, I would consider the use of Tie::File with some code similar to the following:

use Tie::File; tie my @array, 'Tie::File', 'test.data' or die $!; for my $index (0 .. $#array) { unshift @array, splice(@array, $index, 1) if $array[$index] =~ /33 +3/; } untie @array;

 

perl -le "print+unpack'N',pack'B32','00000000000000000000001010100010'"


Comment on Re: Swapping a record in a File
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (16)
As of 2014-07-30 13:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (233 votes), past polls