On Wed, 17 Apr 2002 15:01:50 -0400, Michael G Schwern wrote:

>On Wed, Apr 17, 2002 at 02:34:20PM -0400, Bill -Sx- Jones wrote:

>> Actually, the input data looks more like
>> 
>> [SNEEX]
>> ....
>> [ADMIN]
>> ....
>> [END]
>
>    # setup %Dispatch as before, then...
>
>    while( $vData =~ /\[([A-Z])\]/g ) {
>        $Dispatch{$1}->();
>        last if $End;
>    }

Somebody forgot a "+" here.

And I assume line by line processing...

        while(<>) {
            if(/^\[([A-Z]+)\]$/) {
                ($Dispatch{$1} || \&default)->();
                last if $1 eq 'END';
            }
        }

        sub default {
            die "Something doesn't compute."
        }

-- 
        Bart.

Reply via email to