| |||||||||||
| |||||||||||
Context Posted by admin (Graham Ellis), 22 December 2002 Perl uses the concept of "context" to work out what to do with a list - if you write @stuff in your code, it depends whether it's somewhere that a list actually makes sense (in which case the list is used), somewhere where a list does not make sense (in which case Perl uses the length of the list), or in double quotes (in which case Perl concatenates all elements of the list with a copy of the variable $" - default a space character - between each).Here's a sample piece of code that I wrote during the Perl course I was running last week - I think I had the opportunity to add a few comments for once! Code:
This page is a thread posted to the opentalk forum
at www.opentalk.org.uk and
archived here for reference. To jump to the archive index please
follow this link.
|
| ||||||||||
PH: 01144 1225 708225 • FAX: 01144 1225 793803 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho |