develooper Front page | perl.perl6.users | Postings from August 2017

split and one liner problem

Thread Next
From:
ToddAndMargo
Date:
August 4, 2017 18:55
Subject:
split and one liner problem
Message ID:
326fb9c1-0ec6-c903-ec98-c742fa12be6a@zoho.com
Hi All,


What am I doing wrong here?

$ echo -e "abc\ndef\nghi" | perl6 -e 'for ( split "\n", lines )  { say 
"<$_>"; }'

<abc def ghi>


I am trying to get

<abc>
<def>
<ghi>

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About