If you’ve done much Perl programming you’ve probably encountered the Anonymous Hash, Anonymous Array, and probably Anonymous Subroutines as well. Did you know there’s also an Anonymous Scalar? It’s one of those things that is not very useful most of the time, but is the perfect tool for some situations. Here are two situations where you can use them, however:
(more…)
It is often necessary to make changes to the elements of an array while copying it to a new variable. You might be making a regular expression substitution on each element, or only copying elements that match a certain pattern. In this column I’ll show you three different approaches to this problem, in the spirit of Perl’s motto, "There’s More Than One Way To Do It" (TMTOWTDI):
(more…)
If you have an array that may contain the same value in several places, and you would like to sort the array and remove all duplicates, here’s one way to do it…
(more…)
Copyright © 1995-2007 William R. Ward dba Bay View
Training. All Rights Reserved. “Bay View Training”,
“Bay View Consulting Services”, “Bay View
Software”, the sailboat logo, and the domain name
“bayview.com” are trademarks and/or service marks of
William R. Ward dba Bay View Training. For more information,
contact
webmaster@bayview.com