[Tutor] Perl equivalent of $#var

Premshree Pillai premshree.pillai at gmail.com
Wed May 18 15:06:40 CEST 2005


On 5/18/05, Smith, Jeff <jsmith at medplus.com> wrote:
> Is there a more Pythonic way to get the Perl equivalent of
>         $#var
> other than
>         len(var) - 1

By Pythonic, if you mean OO, you can do this: ['foo', 2, 'baz'].__len__()

-- 
Premshree Pillai
http://www.livejournal.com/users/premshree/


More information about the Tutor mailing list