Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

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

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1003192]
[LanX]: seems like my boss has activated an extra UTF8 encoding such that my JSON stuff arives twice encoded in the browser ... oO
[LanX]: he loves to do this with regexes ...
LanX considers looking for a new project ...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (4)
As of 2018-03-19 23:24 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (246 votes). Check out past polls.