in reply to return value of chomp is false?

You're trying to be too clever (edit: in that you likely don't need the return value of chomp):

my $names = join '|', map { chomp; $_ } <STDIN>;

Replies are listed 'Best First'.
Re^2: return value of chomp is false?
by babel17 (Acolyte) on Sep 29, 2009 at 16:50 UTC
    That's what I tried first, but that returns (1,$_) for each value of $_

      Not it doesn't. I suspect you used a comma instead of a semi-colon.

      By the way, there's also

      use List::MoreUtils qw( apply ); my $names = join '|', apply { chomp } <STDIN>;
      and
      use Nested::Loops qw( Filter ); my $names = join '|', Filter { chomp } <STDIN>;