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

Re: Re: Re: spliting arrays

by arthas (Hermit)
on Nov 05, 2003 at 09:58 UTC ( #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? | Other CB clients
Other Users?
Others musing on the Monastery: (7)
As of 2022-08-08 06:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?