Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re^2: return value of chomp is false?

by babel17 (Acolyte)
on Sep 29, 2009 at 16:50 UTC ( #798160=note: print w/ replies, xml ) Need Help??


in reply to Re: return value of chomp is false?
in thread return value of chomp is false?

That's what I tried first, but that returns (1,$_) for each value of $_


Comment on Re^2: return value of chomp is false?
Replies are listed 'Best First'.
Re^3: return value of chomp is false?
by ikegami (Pope) on Sep 29, 2009 at 17:57 UTC

    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>;

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://798160]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (9)
As of 2015-07-08 03:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (93 votes), past polls