Lee Goddard wrote:
Perhaps my original question wasn't clear.
I do not want $#_-10, I want literally $_[-10].
What's the difference which way it is if you access it only by
using negative offsets ?

In other words:

Does anyone know if there is there a module that
will allow me to have negative array indices...?

Still not clear.
No.

I suppose I could use a hash, but what a pain in the
arse that'll be....
Maybe it would help if we knew why you want to do something so strange. :)

Questions:
Do you know the size of the array ?  Are all of the indices negative ?

Workarounds to using negative indices:
If all are negative, you could just posify them by [0-$index] if not,
and you know the range of the indices, you could bias them positive or
make sure the array is created large enough to include the full range
of indices.  If there are positive and negative indices, there is always
the possibility that they could overlap (eg: a negative and a positive
could point to the same cell).

The important thing is to make sure the size of the array is defined
before accessing the elements (or check for defined before using) so
that negative offsets are coming from the same starting point.

--
  ,-/-  __      _  _         $Bill Luebkert   ICQ=162126130
 (_/   /  )    // //       DBE Collectibles   Mailto:[EMAIL PROTECTED]
  / ) /--<  o // //      http://dbecoll.tripod.com/ (Free site for Perl)
-/-' /___/_<_</_</_     Castle of Medieval Myth & Magic http://www.todbe.com/

_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to