Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
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
Replies are listed 'Best First'.
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 taking refuge in the Monastery: (6)
As of 2015-08-01 03:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (285 votes), past polls