Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re^2: Split at specific spaces

by k_manimuthu (Monk)
on May 12, 2010 at 09:26 UTC ( #839573=note: print w/ replies, xml ) Need Help??


in reply to Re: Split at specific spaces
in thread Split at specific spaces

And Another One Way

$name=qq(1 AC2 34 TRP A 6 ALA A 7 ILE A 14 GLY A 15); split (/ /, $name); ### Process the temp array for ( $i=0; $i<=$#_; $i++) { push @get, (join ' ', @_[$i..$i+2]); $i=$i+2; } print "\n$_" for @get;


Comment on Re^2: Split at specific spaces
Download Code
Re^3: Split at specific spaces
by toolic (Bishop) on May 12, 2010 at 12:46 UTC
    While this code does produce correct results in this case, you are ignoring a warning message because you do not use strict and warnings:
    Use of implicit split to @_ is deprecated

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (12)
As of 2015-07-03 11:49 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 (51 votes), past polls