use vars qw($sku, $description, $price, $qty); foreach my $item (@items) { local($sku, $description, $price, $qty) = @$item; write(PURCHASEORDER); } #### use strict; format STDOUT = @<<<<<<< $::foo . local $::foo = 'a string'; write STDOUT; __output__ a string