| "When I use a symbol," Humpty Dumpty said, in a rather scornful
| tone, "it means just what I choose it to mean - neither more nor
| less."
| "The question is," said Alice, "whether you can make symbols mean so
| many different things."
| "The question is," said Humpty Dumpty, "which is to be master -
| that's all."
|
| -- With apologies to Lewis Carroll (1832-1898) Through The Looking
| Glass 1871

Threads
=======

Packing (#62)
-------------

Ruby Quiz this week comes from Ilmari Heikkinen: write a program to pack
boxes of different dimensions as tightly as you can.

Regexps: Perl vs. Ruby
----------------------

Sam Dela Cruz inquired why the regular expression /^[\d\.]+$/ matched
differently in Perl and Ruby. David A Black responded, "^ and $ match
start and end of line, not string. For start and end of string, you want
\A and \z (or \Z to ignore final newline)."

String#split, respecting quotes?
--------------------------------

Richard Livsey asked how to split a string %Q{some words "some quoted
text" some more words} into an array ["some", "words", "some quoted text",
"some", "more", "words"]. Solutions using regexps flew in. Tim Hearney
noted that the CSV module can do just that:

Share This Page

Welcome to The Coding Forums!

Welcome to the Coding Forums, the place to chat about anything related to programming and coding languages.

Please join our friendly community by clicking the button below - it only takes a few seconds and is totally free. You'll be able to ask questions about coding or chat with the community and help others.
Sign up now!