- publishing free software manuals
Perl Language Reference Manual
by Larry Wall and others
Paperback (6"x9"), 724 pages
ISBN 9781906966027
RRP £29.95 ($39.95)

Sales of this book support The Perl Foundation! Get a printed copy>>>

Use of freed value in iteration

(F) Perhaps you modified the iterated array within the loop? This error is typically caused by code like the following:

@a = (3,4);
@a = () for (1,2,@a);

You are not supposed to modify arrays while they are being iterated over. For speed and efficiency reasons, Perl internally does not do full reference-counting of iterated items, hence deleting such an item in the middle of an iteration causes Perl to see a freed value.

ISBN 9781906966027Perl Language Reference ManualSee the print edition