Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: mocking overloading filetest operator callback -f -d -e -X

by Athanasius (Archbishop)
on Dec 18, 2013 at 12:24 UTC ( [id://1067618]=note: print w/replies, xml ) Need Help??


in reply to mocking overloading filetest operator callback -f -d -e -X

A Super Search on “Operation """"” finds this 2009 thread: overload op requires stringify overload ?? Applying Bloodnok’s “fix of sorts” —

#! perl -- BEGIN { package OOO; sub new { my( $pkg, $path ) = @_; bless \$path, $pkg; } sub filetest { warn "its fake @_\n"; 'fake' } use overload '-X' => \&filetest, fallback => 1; $INC{'OOO.pm'} = __FILE__; } use strict; use warnings; use OOO; -f OOO->new('.');

gives:

22:15 >perl 804_SoPW.pl its fake OOO=SCALAR(0x1c15434) f 22:19 >

Is that what you were wanting?

Anyway, hope it helps,

Athanasius <°(((><contra mundum Iustus alius egestas vitae, eros Piratica,

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1067618]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (6)
As of 2024-04-25 08:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found