| CPAN Ratings PerlIO-Util reviews | |
| Home | Search | About | Bitcard Account | Login |
RSS | Module Info | Add a review of PerlIO-Util
PerlIO::Util is one of those simple gems that make your life easier. It provides a couple of PerlIO layers (think open() modes) that are damn convenient. Maybe it's best to give an example, this is for file locking:
use Fcntl qw/:flock/;
open my $fh, '<', "file" or die "Some error: $!";
flock $fh, LOCK_SH or die "Could not get lock on file 'file': $!";
#...
close $fh;
becomes simply
use PerlIO::Util;
open my $fh, '< :flock', "file" or die "Some error: $!"
#...
close $fh;
and it checks your open mode to see whether you'd need a shared or exclusive lock. Also, no magic constants from Fcntl. Not a big deal, but just one less thing to worry about.
Steffen Müller - 2008-07-17T07:43:59
|
Perl.org sites
: bugs
| dev
| history
| jobs
| learn
| lists
| use
Site Information and Contacts |
|