in reply to Troubleshooting a character reference converter script

while (<IN>) { my %entity; # <--- ...
I think your problem is that you're clearing the lookup table %entity for every line (within the loop). The BEGIN block runs only once however...

Set it up outside of the loop instead.

Replies are listed 'Best First'.
Re^2: Troubleshooting a character reference converter script
by elef (Friar) on Oct 27, 2010 at 18:15 UTC
    *hangs head in shame*

    That's it, thank you.

    The backstory is that the original script didn't have the "my" lines in it - I added them because with strict on, perl complained. I somehow dropped them inside the while loop without thinking about the consequences of redefining the variables in every iteration of the loop.