Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Do pigs get athlete's foot?

by t'mo (Pilgrim)
on Jun 28, 2001 at 21:27 UTC ( #92385=poem: print w/replies, xml ) Need Help??

#!perl -w # athlete_piggy.pl -- a poem of sorts use strict; my @toes = map 'This little piggy ' . chomp($_) . '.', <DATA>; print "$_\n" for @toes; __DATA__ went to the market did not got dried well did rot went "scratch, scratch, scratch" all the way home

Replies are listed 'Best First'.
Re: Do pigs get athlete's foot?
by srawls (Friar) on Jun 29, 2001 at 02:13 UTC
    um... Did you test this? You might want to check the return value of chomp. If you don't want the newline you can do this:
    /(.*)/
    but why even bother, just change that last print to
    print @toes
    Then you don't have to take off those new lines in your map statement.

    The 15 year old, freshman programmer,
    Stephen Rawls

      "Did you test this?" Test 'poetry'? No. But after you pointed it out, I did and see what you mean. Note the revised edition:

      ... my @toes = map "This little piggy " . $_, <DATA>; print @toes; ...

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: poem [id://92385]
Approved by root
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (4)
As of 2018-07-21 13:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    It has been suggested to rename Perl 6 in order to boost its marketing potential. Which name would you prefer?















    Results (449 votes). Check out past polls.

    Notices?