Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: spliting a lengthy text

by Samy_rio (Vicar)
on Nov 27, 2006 at 10:15 UTC ( #586217=note: print w/ replies, xml ) Need Help??


in reply to splitting and coloring

Hi sanku, First thing is look into How (Not) To Ask A Question and How do I post a question effectively?, then you try like this,

use strict; use warnings; my $str = 'MKTVEQTSPTMTSEKARWIYQKMVEIRMFEDRVHDIFSKGEIPGFVHLYAGEEAIAVGL +CAHLDHNDYITSTHRGHGHCIAKGCELDGMMAEIYGKSTGLCKGKGGSMHIADLDRGMLGANGIVGGGF +TLAAGAALTAKFKQTGGVAVCFFGDGANNQGTFHEGINLAAIWDLPVVFVAENNGYGEATPFHYASACE +QITDRAKGYNIPGVKVDGKDVVAVYEVAREAVERARRGEGPTLIECITYRNYGHFEGDAQTYKTGREKE +EHTEERDAITLFEKYALSNNLLTEEAIQTVRHEVEQSVDRAVDFANASDYPQPEELLTDVYVSYDHEGR +NG'; $str =~ s/(.{10})/$1 /gsi; $str =~ s/((?:[^ ]+ ){5})/$1\n/gsi; print $str;

davorg++

Updated : Thanks BrowserUK

Regards,
Velusamy R.


eval"print uc\"\\c$_\""for split'','j)@,/6%@0%2,`e@3!-9v2)/@|6%,53!-9@2~j';


Comment on Re: spliting a lengthy text
Select or Download Code
Re^2: spliting a lengthy text
by BrowserUk (Pope) on Nov 27, 2006 at 10:23 UTC

    Using $& (and friends) can be nasty. See Devel::SawAmpersand for why.


    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (9)
As of 2014-08-20 08:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (107 votes), past polls