my $fileext = prompt("\nEnter extension of files to look in (example: log or txt):\n"); my $playertofind = prompt("\nEnter exact name of player to find and replace:\n"); my $newplayer = prompt("\nEnter exact name of player to replace $playertofind with:\n"); sub prompt { my $message = shift; print $message; chomp ( my $response = ); print "\nConfirmed: $response\n\n"; return $response; }