What's the purpose of use statement below which I stumbled across in some Perl 6 module?
use CGI:from<perl5>;
...
...
The rest of the code is just mundane usage of the Perl 5 CGI module, as far as I can tell.
Is the ":from" suffix used to invoke some kind of a Perl 5 compatibility layer. Can't seem to find any documentation about it.
Look at the perl6 Synopsis 11: Modules:
The use statement allows an external language to be specified in addition to (or instead of) an authority, so that you can use modules from other languages. The from adverb also parses any additional parts as short-form arguments. For instance:
use Whiteness:from<perl5>:name<Acme::Bleach>:auth<cpan:DCONWAY>:ver<1.12>;
use Whiteness:from<perl5 Acme::Bleach cpan:DCONWAY 1.12>; # same thing
So indeed, it's a scheme to support "other languages", perl5 in this instance.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With