my $stuff; for(return_value()) { chomp; s/foo//g; tr/x/y/; $stuff = $_; } #### my $stuff = return_value(); for($stuff) { chomp; s/foo//g; tr/x/y/; }