Why use Perl when we've got Python?!

John W. Stevens jstevens at basho.fc.hp.com
Fri Aug 13 23:04:39 EDT 1999


> 
>      [courtesy cc of this posting mailed to cited author]
> 
> In comp.lang.perl.misc, 
>     "John W. Stevens" <jstevens at basho.fc.hp.com> writes:
> :list.append( newElement )
> :
> :to Perl's closest equivalent:
> :
> :list[ $#list + 1 ] = $newElement
> 
> Don't be silly.  That's merely
> 
>     push @array, $new_element;
> 
> Although you can use the other way if you'd like.
> I hope that freedom doesn't bug you too much.

However, using a stack operation on an array that you are currently
attempting to use to represent a list provides many opportunities
for misunderstandings, and out right bugs.

John S.





More information about the Python-list mailing list