in reply to Re^2: Passing globals and magic variables safelyin thread Passing globals and magic variables safely
I usually just go
my ($foo, $bar) = $data =~ /$pattern/ or die "horribly!"; [download]
ihb
See perltoc if you don't know which perldoc to read!