in reply to Re^2: Unshift and push inside of map operation.
in thread Unshift and push inside of map operation.

I suspect you haven't tested this. It might seem reasonable to assume that shift on an empty array returns an empty list. However, my testing on Perl 5.8.8 and 5.10 shows that shift @empty returns a single undef, not an empty list and your example produces an endless loop.

- tye        

  • Comment on Re^3: Unshift and push inside of map operation. (test)

Replies are listed 'Best First'.
Re^4: Unshift and push inside of map operation. (test)
by JadeNB (Chaplain) on Sep 23, 2008 at 18:17 UTC
    However, my testing on Perl 5.8.8 and 5.10 shows that shift @empty returns a single undef, not an empty list
    This is actually the documented behaviour, not (just) a quirk of implementation: shift.