Respond to Implementing Typed Lexical Variables

Re: Implementing Typed Lexical Variables

Written by Anonymous Coward (0) on 2009-5-2 (土) at 8:41 pm

This is dazzling, but what's an inlineable function and how do I get one? I can avoid the 'No such class' error by declaring a package, but not by declaring a sub.

perl -le 'my foo $bax = q{bax}; print $bax;'
No such class foo at -e line 1, near "my foo"
Execution of -e aborted due to compilation errors.



perl -le 'package foo; package main; my foo $bax = q{bax}; print $bax;'
bax

  perl -le 'sub foo { q{bob} };  my foo $bax = q{bax}; print $bax;'
No such class foo at -e line 1, near ";  my foo"


Note: you're not logged in. To identify yourself, please login or PGP sign your message (either clearsign or ASCII-armored is OK).

Title:

Captcha text:

captcha -- if you can't see it, log in instead

Format:

Caveat poster: if you decide to digitally sign your post, add something to it mentioning that it is attached to this article. Otherwise, someone could just paste it into another discussion, out of context, and the signature would still validate.


Navigation

Categories

Tags

Login