>It's hard to remember the sequence of values that the following
>builtins return:
> stat/lstat
> caller
> localtime/gmtime
> get*
>and though it's easy to look them up, it's a pain to look them up
>Every Single Time.
>Moreover, code like this is far from self-documenting:
use File::stat;
> if ((stat $filename)[7] > 1000) {...}
> if ((lstat $filename)[10] > time()-1000) {...}
use Time::localtime;
> if ((localtime(time))[3] > 5) {...}
use User::pwent;
> if ($usage > (getpwent)[4]) {...}
use Net::hostent;
> @host{qw(name aliases addrtype length addrs)} = gethostbyname $name;
Don't have one for that.
> warn "Problem at " . join(":", @{[caller(0)]}[3,1,2]) . "\n";
>It is proposed that, when one of these subroutines is called in the new
>HASHREF context (RFC 21), it should return a reference to a hash of values,
>with standardized keys. For example:
Which is what the modules listed above do. And more.
--tom