Have a look at tie.
In reply to Re: $! context behavior by busunsl in thread $! context behavior by eak