[Pdx-pm] Accessing File::Monitor attribute
Daniel Herrington
herda05 at gmail.com
Tue Aug 11 13:51:32 PDT 2009
All,
I'm new to classes in perl and I've hit a roadblock using the
File::Monitor class. From the doc for File::Monitor
http://search.cpan.org/~andya/File-Monitor-0.10/lib/File/Monitor/Object.pm
<http://search.cpan.org/search?mode=module&query=File%3A%3AMonitor>:
The state of the monitored file or directory at the time of the last
scan can be queried. Before scan is called these methods will all return
undef. The following methods return the value of the corresponding field
from "stat" in perlfunc.
For example:
my $modified = $object->mtime;
Now I've instantiated my object as per the instructions:
use File::Monitor; use File::Monitor::Object; my $wFileMonitor =
File::Monitor->new(); $wFileMonitor->watch($wFile); $wFileMonitor->scan;
my $modified = $wFileMonitor->mtime
But I get the following error:
Can't locate object method "mtime" via package "File::Monitor" at
/home/workspace/watchFile.pl line 65.
I know it's getting lost in the reference to mtime, but I'm at a loss on
how to access it. The doc simply refers to $object->mtime and my read of
it says that $wFileMonitor should be $object.
thanks,
--
Daniel B. Herrington
Director of Field Services
Robert Mark Technologies
dherrington at robertmarktechnologies.com
o: 651-769-2574
m: 503-358-8575
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.pm.org/pipermail/pdx-pm-list/attachments/20090811/fc0a531e/attachment.html>
More information about the Pdx-pm-list
mailing list