sh1tn has asked for the wisdom of the Perl Monks concerning the following question:

Hello Monks,

File test operators overload obviously doesn't work, neither override. Is it possible operators like -x -e -d -f to be overridden?

Thank You!


Replies are listed 'Best First'.
Re: file test operators
by davidrw (Prior) on Feb 22, 2006 at 15:14 UTC
    What are you trying to do that you would want to? My first look was the same as Fletch -- at perlop which points to overload ..

    Maybe subclassing File::stat and using that will provide you with a close enough (for your purposes) interface that lets you overload underneath?

    or maybe (i don't know how or if you can) overloading CORE::stat() will work?
Re: file test operators
by Fletch (Bishop) on Feb 22, 2006 at 15:07 UTC

    What would their absence from the section "Overloadable Operations" in perldoc overload lead one to think?

    A reply falls below the community's threshold of quality. You may see it by logging in.