As an interpreted language, Perl scripts can generally be run unmodified on any platform. But there are situations where the differences between platforms make it necessary to test what platform you are running on and act accordingly. (more…)
Here’s an easy way to find the largest file in a directory.
(more…)
Your file system keeps track of when each file was last modified. But have you ever wanted to edit a file without affecting its timestamp? Using the "utime" function, which is built in to Perl, you can! Here’s how:
(more…)
It is often useful to have a configuration file for a program, where you can specify certain variables that are used in the program. Examples of configuration parameters might include files, email addresses, usernames, or passwords the program uses, etc. If your Perl program needs to read a configuration file, there are lots of ways to do it.
(more…)
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…)
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