sub len { length; } my @array = qw( fu bar baaaaz ); foreach ( @array ) { print len; }
If that's all you want, there you go. Beware of a couple of things though. First, you'll need to make sure that Perl knows what len means -- either declare the sub before, as I have done, or use a forward declaration. Second, some built-ins have special prototypes. You can use prototype to discover them. There are a couple of gotchas I always have to look up documented there.
In reply to Re: Aliasing a builtin?
by chromatic
in thread Aliasing a builtin?
by xiper
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |