Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

RE: Re: Creating comma-delimited lists

by BlaisePascal (Monk)
on Aug 24, 2000 at 23:26 UTC ( [id://29513]=note: print w/replies, xml ) Need Help??


in reply to Re: Creating comma-delimited lists
in thread Creating comma-delimited lists

This is the easy way, but it ignores the requirement to print "and" before the last known item. You would print "I know about this,that,the other,the last thing.", not "I know about this, that, the other, and the last thing.".

Replies are listed 'Best First'.
RE: RE: Re: Creating comma-delimited lists
by mrmick (Curate) on Aug 25, 2000 at 16:49 UTC
    It FIGURES that I would overlook that. Thank you, BlaisePascal, for spotting it. It's nice comments like yours that will help to keep me on my toes. :-)

    Well, in an attempt to redeem myself, here's an oversimplified (and crude)fix:

    @a = ('this', 'that', 'the other', 'the last thing'); $lastone=pop(@a); $tmpstring=join(',',@a); $string = "I know about $tmpstring, and $lastone."; print $string;

    Mick

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (4)
As of 2024-04-25 13:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found