Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: chopping new line while counting length

by andye (Curate)
on Jan 15, 2009 at 11:51 UTC ( #736519=note: print w/replies, xml ) Need Help??


in reply to chopping new line while counting length

An alternative way to do it:

#!/usr/bin/perl -w undef $/; use strict; $_ = <DATA>; while (m/\G(>IDnumber\d+ length=)350\n([^\n]+)\n([^\n]+)\n/g) { print $1.length($2.$3)."\n$2$3\n"; } __DATA__ >IDnumber1 length=350 AGCTG AAGTCGCT >IDnumber2 length=350 AGAACGT ACC >IDnumber3 length=350 AGC ACTTCGCTAACT

Hope that's helpful to you.

Best wishes, andye

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://736519]
help
Chatterbox?
[atcroft]: Lady_Aleena: I found the L<name|section> syntax, which describes linking to a perl manual page, and L<text|url> to link to a web page. The reason I asked was because I was on search.cpan.org looking at a module,
[atcroft]: and it referred to several other modules, but the links went to metacpan.org. I found that a bit of a surprise, and it got me wondering if there was a "standard" way to link to other modules in the documentation on CPAN.
[Lady_Aleena]: atcroft. maybe look at raw PODs. There is also L<foo|http://foo. com> and some might be linking directly to meta::cpan.
[Lady_Aleena]: Oops, didn't read the L<text|url> right.

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (3)
As of 2017-05-27 03:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?