Gossamer Forum
Home : General : Perl Programming :

Problem

Quote Reply
Problem
Hi,

I am just going to give an example. I tried to explain it but I couldnt even understand what I was saying so here is the example of what I want to be able to do.

i have the following code:

($pos[0],$pos[1],$pos[2],$pos[3],$pos[4]) = split(/-/,$setmembers);

$setmembers is equal to 1-2-3-4-5

so I know that i need $pos[0] through $pos[4]. But what if I didnt know that it was 1-2-3-4-5 and lets say it was 1-2-3-4-5-6-7-8 how would I be able to know how many $pos variables i need?

Any help would be greatly appreciated.

Thanks,
Kurt
Quote Reply
Re: [snowdude46] Problem In reply to
Code:
my @pos = split /-/, $setmembers;

Ivan
-----
Iyengar Yoga Resources / GT Plugins
Quote Reply
Re: [yogi] Problem In reply to
Works like a charm.
Thanks Yogi

Kurt