Help for this page

Select Code to Download


  1. or download this
    while (my @parsed = &parseInput) {
        &dispatch(@parsed);
    ...
        return 0 if $parsed[0] eq `q`;
        ...
    }
    
  2. 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      
    }
    
  3. or download this
    c:\@Work\Perl\monks>perl -wMstrict -le
    "BEGIN {
    ...
    boff
    do not know how to 'boff'
    Q
    
  4. 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)