Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Re: Re: spliting arrays

by arthas (Hermit)
on Nov 05, 2003 at 09:58 UTC ( [id://304661]=note: print w/replies, xml ) Need Help??


in reply to Re: Re: spliting arrays
in thread spliting arrays

Hi!

This should do what you need:

use strict; my $ident="aaa bbb ccc-ddd eee fff-ggg hhh iii-jjj kkk lll-"; my @id = split /-|\s/, $ident; foreach my $i(0..$#id) { print $id[$i]; if ((($i+1) % 3) == 0) { print "\n"; } else { print ' '; } }

Michele.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (2)
As of 2024-04-16 21:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found