Perl Style: Defensive Programming
- use strict
- #!/usr/bin/perl -w
- Check all syscall return values, printing $!
- Watch for external program failures in $?
- Check $@ after
- Parameter asserts
- #!/usr/bin/perl -T
- Always have an
elseafter a chain of
- Put commas at the end of lists to so your program won’t break if someone inserts another item at the end of the list.
Forward to The Art of Commenting Code
Back to Elegance
Up to index
Copyright © 1998, Tom Christiansen All rights reserved.
Something wrong with this article? Help us out by opening an issue or pull request on GitHub