in reply to setting up boolean parameters from keywords
$4 eq 'play' is true only if $4 exactly matches 'play' - no more, no less. You may be thinking of index: my $auto = (-1 != index $4, 'play'). But even that isn't how I'd do this. A bit more perlish is:
This creates a hash, %control, with the keys that are specified. Instead of $auto, you would use $control{play}. Instead of $loop, you would use $control{loop}, etc.my %control = map { $_ => 1 } split ' ', $4;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: setting up boolean parameters from keywords
by rand0mmm (Acolyte) on Mar 18, 2006 at 04:02 UTC | |
by Tanktalus (Canon) on Mar 18, 2006 at 04:06 UTC | |
by rand0mmm (Acolyte) on Mar 18, 2006 at 04:16 UTC | |
by Tanktalus (Canon) on Mar 18, 2006 at 15:04 UTC | |
by rand0mmm (Acolyte) on Mar 20, 2006 at 21:57 UTC | |
by rand0mmm (Acolyte) on Mar 18, 2006 at 04:19 UTC | |
by ff (Hermit) on Mar 18, 2006 at 04:49 UTC | |
by rand0mmm (Acolyte) on Mar 21, 2006 at 00:43 UTC | |
by ff (Hermit) on Mar 24, 2006 at 05:16 UTC |