Gossamer Forum
Home : General : Perl Programming :

split -> array, fast count

Quote Reply
split -> array, fast count
Is there a quick way to get (count) how many times it has been splited? How many $data[uptonumber] are found.

@data=split(/:/);
Quote Reply
Re: [robyone] split -> array, fast count In reply to
I'm not quite sure what you are asking...could you elaborate please?

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [robyone] split -> array, fast count In reply to
Hello robyone,

Do you mean how many items are now in @data after the split is finished ?

Try:

$size = @data;
$size = scalar @data;

$size = $#data + 1;

Hope this helps

kode