According to the documentation File::HomeDir defines a method called users_home() (among others):
users_home
CPAN::Forum
File-HomeDir - I'm missing something here
| Posted on Wed Mar 8 22:46:37 2006 by tonyw |
| I'm missing something here |
|
According to the documentation File::HomeDir defines a method called users_home() (among others):
users_home
$home = File::HomeDir->users_home('foo');
The users_home method takes a single param and is used to locate the parent home/profile directory for an identified user on the system.
However when I try to use it:
#!/usr/local/bin/perl -w
use File::HomeDir;
$roothome = home('root');
print "via home(), $roothome\n";
$roothome = File::HomeDir->users_home('root');
print "via users_home: $roothome\n";
I get
via home(), /var/root
Can't locate object method "users_home" via package "File::HomeDir" at ./homes.pl line 9.
This is using version 0.54 of File::HomeDir on Darwin (Perl 5.8.8). I get the same result (with "'/" instead of "/var/root", which makes sense) on Solaris 10 using the same Perl and File::HomeDir versions. I have to be doing something stupid here as I can't believe that no-one else has noticed that the method described in the documentation appears not to be there! What have I missed? |
| Write a response |
(4)
]