- or download this
while (my @parsed = &parseInput) {
&dispatch(@parsed);
...
return 0 if $parsed[0] eq `q`;
...
}
- or download this
sub dispatch {
my $cmd = shift;
...
catch { print STDERR "Unrecognised command $cmd\n"; }
# the above is a non-GUI example which would need adaptation
}
- or download this
c:\@Work\Perl\monks>perl -wMstrict -le
"BEGIN {
...
boff
do not know how to 'boff'
Q
- or download this
c:\@Work\Perl\monks>perl -wMstrict -le
"dispatch(qw(foo 9 8 7 6));
...
sub foo { print qq{'in Foo:' (@_)} }
"
'in Foo:' (9 8 7 6)