jdlev has asked for the wisdom of the Perl Monks concerning the following question:
So for instance, if I have the following:
@array = qw(a b c);
And the user enters "b", the array would become:
@array = qw(a c);
Grep doesn't seem too fond of feeding it variables though. Anyways, here's my code:
@priority = qw(RB1 RB2 FL1 FL2 QB1 QB2 TE1 WR1 WR2 DST); $continue = 'Y'; while($continue == 'Y') { @mypri = grep(!/ $position /, @priority); print "Random position iterations in order of priority: \n"; foreach (@mypri) { print "$_\n"; } print "Do you wish to lock another player position? Enter 'Y' to add a +nother player or press Enter to continue"; $continue = <>; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Grep & Regex Question
by choroba (Cardinal) on Dec 01, 2013 at 08:37 UTC | |
|
Re: Grep & Regex Question
by atcroft (Abbot) on Dec 01, 2013 at 08:36 UTC | |
by jdlev (Scribe) on Dec 01, 2013 at 09:41 UTC | |
by choroba (Cardinal) on Dec 01, 2013 at 09:54 UTC | |
|
Re: Grep & Regex Question
by ysth (Canon) on Dec 01, 2013 at 09:24 UTC | |
|
Re: Grep & Regex Question
by Corion (Patriarch) on Dec 01, 2013 at 08:27 UTC | |
|
Re: Grep & Regex Question
by Kenosis (Priest) on Dec 01, 2013 at 22:53 UTC |