Input Delimiter

in Perl Tips, Files & Directories
by William Ward on July 29, 2002 3:41 pm

Normally, reading from a file is done one line at a time. But sometimes that is not very convenient. What if you want to read in text one paragraph at a time? Or maybe your data is separated by TAB characters rather than newline characters?

(more…)

Unique Arrays

in Perl Tips, Data Structures
by William Ward on July 21, 2002 4:37 pm

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…)