Check Perl portability

For those of you who have learned the joys of Perl (programming that is), you may have heard or said that Perl code is extremely portable.

Well, yes and no. There is no such thing as "perfectly portable." There are only levels of ease in writing code that will run on all targeted platforms. Perl is no exception; portability issues include pathnames, end-of-line characters, "endian-ness" and more.

Once I started to make an actual list of the issues, it was surprising just how fast the list grew. In practice, few had ever caused but minor stumbles in my code on various platforms, but the holes were waiting to be stepped in. After starting to work on a list of these issues (for this tip) a Web search seemed apropos.

Then I felt silly. Turns out there is a Perl documentation page titled Perl Portability Issues. So I didn't write up a list, but I would suggest issuing the following command at a prompt near you: 'perldoc perlport'.

This is a very large document. It's not only a list of areas to watch out for, but very informative stuff on how to accomplish portability in each of the areas discussed.

Check it out. While you are at it, try 'perldoc perl' to get a list of all documentation pages available. It has been a while since I had done that, and the list is nearly doubled. There are several tutorial-based pages for a good introduction to what new Perl programmers might call 'more complex' features (such as OO and References).

Requires Free Membership to View

Fred Mallett is founder of FAME Computer Education, which provides standup delivery of educational classes on a variety of UNIX and Win32 related subjects.

This was first published in June 2003

There are Comments. Add yours.

TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

Disclaimer: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.