Trihedralguy has asked for the wisdom of the Perl Monks concerning the following question:
I was in the chat this morning trying to figure this out. But i'm still having problems. Basically I have a string $contact that is formated with letter,letter,letter. It will always be the same letters (P,F,T) I took that and split it up into a list and eventually I would like to check each tag to see if its set. But for now, i'm just trying to pull the information out of the list. The example element I'm trying has: "P,F," as contact. I was wondering if someone could show me the way in what I'm doing wrong and how I can do this correctly?my @letters = split (/,/, $contact); my $i = 3; foreach $i (0..$#letters-1) { print "Flag $i is $letters[$i]"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Variable into list
by Corion (Patriarch) on Jan 03, 2008 at 17:15 UTC | |
|
Re: Variable into list
by McDarren (Abbot) on Jan 03, 2008 at 17:22 UTC | |
|
Re: Variable into list
by Trihedralguy (Pilgrim) on Jan 04, 2008 at 16:22 UTC |