# New Ticket Created by Ekkehard Horner
# Please include the string: [perl #76896]
# in the subject line of all future correspondence about this issue.
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=76896 >
The script:
use v6;
my %fs = ();
%fs{ lc( 'A' ) } = &fa;
sub fa() {
return 'fa called.';
}
;
%fs{ lc( 'B' ) } = &fb;
sub fb() {
return 'fb called.';
}
my $fn = lc( @*ARGS[ 0 ] || 'A' );
printf "%s\n", %fs{ $fn }();
exit( 0 );
works as expected:
PARROT E:\proj\xpl\perl6\archive\00
perl6 -v
This is Rakudo Perl 6, version 2010.07-47-g9fd5eaa built on parrot 2.6.0
Copyright 2008-2010, The Perl Foundation
PARROT E:\proj\xpl\perl6\archive\00
perl6 xpl02.pl6 B
fb called.
but if I delete the lonesome ; in line 10, I get this error:
PARROT E:\proj\xpl\perl6\archive\00
perl6 xpl02.pl6 A
Could not find sub &fs
in main program body at line 12:xpl02.pl6
(I asked about this in de.comp.lang.perl.misc and was advised to submit a
bug report.)