in reply to Re^3: Half-serious quest for prefix anonymous refs taking
in thread Half-serious quest for prefix anonymous refs taking
The prototypes allow you to skip your parentheses, which makes the sub act more like a built-in. Since you said you wanted a built-in, I thought I'd fake it as well as can be done.
I personally believe you'll find that you don't need prototypes at all, to allow one to skip parens:
C:\temp>cat mkaref.pl #!/usr/bin/perl use strict; use warnings; use Data::Dumper; sub mkaref { [@_] } print Dumper mkaref qw<foo bar baz>; __END__ C:\temp>mkaref.pl $VAR1 = [ 'foo', 'bar', 'baz' ];
However I did hope it was clear enough that my "quest" is not for builtin (looking) functions, because in that case I can write them myself full well, but for builtin (hypothetical) syntax.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^5: Half-serious quest for prefix anonymous refs taking
by TGI (Parson) on May 30, 2008 at 21:42 UTC | |
by blazar (Canon) on May 31, 2008 at 09:17 UTC |