I have two stories related to files. I'll start with the failure:

I wanted to write a Test::Harness wrapper that would monitor all the
files/directories that the .t files of my test suite opened, and
when they change to rerun only the affected tests.

I am still planning on hacking this unportably using fs_usage on OSX
and strace on linux, using FAM or whatever as the monitoring
backend, but i would much rather have a mechanism like LD_PRELOAD
for perl, with which i could add fancy hooks for IO operations
without resorting to deep magic.

The second story is abou Devel::FIXME. Devel::FIXME installs a
subreference in @INC, that is always triggerred first. Then it
recursively re-requires the file that was asked for, and this time
when the callback is triggerred it pretends to fail.

When it finds the file using the "normal" require, it will then read
the file line by line, and report all FIXMEs using a cool api to
filter unwanted ones.

It then has additional boilerplate code to fake the "success" of an
included module. Luckily all require return values are passed in
scalar context so I didn't have to worry about *that* ;-)

Audrey subsequently told me about the (undocumented) feature that
lets you *return* a subroutine ref from a subroutine ref in @INC,
that lets you get the source of the file that was normally found
line by line for filtering. THat's what
Acme::use::strict::with::pride, but I didn't  know of it at the
time. It's still pretty brutal ;-)

Conclusions:

I would have been happier if I could have a nice hook interface with
which i could trap both module includes, and all IO operations and
insert my own magic into the mess to aid me in my *DEVELOPMENT*
process (not production related at all =)

-- 
 ()  Yuval Kogman <[EMAIL PROTECTED]> 0xEBD27418  perl hacker &
 /\  kung foo master: /me sneaks up from another MIME part: neeyah!!!!!

Attachment: pgp61QjerriQA.pgp
Description: PGP signature

Reply via email to