The & is the sigil for code. &foo is for subroutines what $foo is for scalars and @foo is for arrays and so on. &POSIX::O_RDWR is probably defined in package POSIX as a sub O_RDWR { ... }
In Perl5, the & does not necessarily take a reference to the subroutine; it could be calling the routine, depending on several things. In Perl6 this will get cleared up, and the & sigil will always take a coderef.
$;=sub{$/};@;=map{my($a,$b)=($_,$;);$;=sub{$a.$b->()}} split//,".rekcah lreP rehtona tsuJ";$\=$ ;->();print$/
In reply to Re: Ampersand prefix for package constants ?
by jonadab
in thread Ampersand prefix for package constants ?
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |