Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: Text manipulation

by Anonymous Monk
on Nov 09, 2012 at 17:46 UTC ( #1003192=note: print w/ replies, xml ) Need Help??


in reply to Text manipulation

use 5.014; use strict; use warnings; my @f1 = qw( >qppq ATATATTTATTATTA TATATATTATATTAT TA >lsl ATTATTATTATTATT AGGAGGAG ); my @f2 = qw( >dfj TATTATTATTTT ATAT >ghg ATATATAT ); { my $i = 1; sub get_lines { my $array_ref = shift; $i = shift if @_; my $old = $i - 1; while (exists $array_ref->[$i] and chr ord $array_ref->[$i] ne '>') { $i++; } return splice($array_ref) if $#{$array_ref} <= $old; return splice($array_ref, $old, $i - $old); } while (@f1 && @f2) { my $j = $i; say join("\n", get_lines(\@f1, $j), get_lines(\@f2, $j)); say "============"; } } # TZN


Comment on Re: Text manipulation
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (4)
As of 2014-10-25 04:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (141 votes), past polls