Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re^3: chopping the beginning and end of lines in 2 files

by ChOas (Curate)
on Nov 13, 2008 at 08:46 UTC ( #723372=note: print w/replies, xml ) Need Help??


in reply to Re^2: chopping the beginning and end of lines in 2 files
in thread chopping the beginning and end of lines in 2 files

I kind of like this one:

[...] for ($start=0;$arr[$start]<15;++$start) {}; for ($end=$#arr;$arr[$end]<15;--$end) {}; print "@seq[$start..$end]\n"; print "@arr[$start..$end]\n";

Just don't understand if you were looking for a number smaller than 10 or 15 :)


GreetZ!,
    ChOas

print "profeth still\n" if /bird|devil/;

Replies are listed 'Best First'.
Re^4: chopping the beginning and end of lines in 2 files
by GrandFather (Sage) on Nov 13, 2008 at 10:40 UTC

    then you might like:

    $_->[1] >= 15 && last or ++$beg for @data; $_->[1] >= 15 && last or ++$end for reverse @data;

    Perl reduces RSI - it saves typing
Re^4: chopping the beginning and end of lines in 2 files
by heidi (Sexton) on Nov 13, 2008 at 09:58 UTC
    10 or 15...anything is fine. i can always change the parameters. it was just a sample program. :)

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://723372]
help
Chatterbox?
[erix]: scd: maybe you like John Mayall better :)
[erix]: (mayall = british blues)
[planetscape]: sleep well, Corion
[stonecolddevin]: erix seems pretty good, i listened to "So Many Roads" and it was nice. Not everyone's cup of tea but this guy can absolutely shred, he and the guy from Mastodon are definitely up there: https://www. youtube.com/watch? v=VzhMkSN9dQc
[erix]: ha, good stuff - loud and fast...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (11)
As of 2017-06-22 21:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How many monitors do you use while coding?















    Results (531 votes). Check out past polls.