use strict; use warnings; my $ans = <>; chomp $ans; print $ans eq 'ham' ? $ans : $ans.'ham';