http://www.perlmonks.org?node_id=1006094


in reply to Re: Sorting array, getting modification of read-only value error
in thread Sorting array, getting modification of read-only value error

I think I get what you are trying to say, but I can print out the array with no problems, so the whole thing should be defined, correct? So I am not sure how I would go about fixing this.
  • Comment on Re^2: Sorting array, getting modification of read-only value error

Replies are listed 'Best First'.
Re^3: Sorting array, getting modification of read-only value error
by tobyink (Canon) on Nov 28, 2012 at 20:04 UTC

    You can print out undefined values. (Though if you have warnings enabled, that kind of behaviour will earn you one.)

    I'm not entirely sure how you'd fix it. Some self-contained code which doesn't rely on files from your system that I don't have on my computer might help.

    perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'