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';

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?
[Marshall]: stevieb wish you well with water problems, my water was off all day Monday for repairs. Any more progress on .exe info problem?.
[stevieb]: Marshall: no. I commented on the thread yesterday. Visual Studio updates the tags ok, but corrupts the exe
[stevieb]: I advised the OP that a possible workaround would be to add a version function/flag that displays the required copyright/license info instead
[Marshall]: Darn! I'll look at the thread. Must not be updatinga byte count somewhere. The .exe format is a complex critter.
[stevieb]: that way, it's still "hard coded" into the exe at least, despite not being visible via Properties
[Marshall]: I also looked into PerlApp from Active State, but they don't sell their Dev Kit independent of a very expensive ($1,200) per year license anymore.
[Corion]: I would assume that the PE format hasn't changed that much since the days of yore, but it seems that I would be wrong in that assumption
[Marshall]: When I bought my copy 15+ years ago, it was just a couple hundred bucks.

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (10)
As of 2016-12-08 18:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (144 votes). Check out past polls.