in reply to Re^2: Global vs. local?
in thread Global vs. local?

See Corion's reply below: if you make a copy of that variable first (with my, not local, it should work.