foreach my $thing (qw/foo bar baz/) { print "$thing -> "; my $c = chop ${\$thing}; print " $thing,$c\n"; }