#!/usr/bin/env perl use strict; use warnings; $_ = "foo\n"; print "in: '$_'\n"; chomp (my $output = $_); print "out: '$output'\n";