>[MacPerl-AnyPerl] overriding filetest operators >Re: [MacPerl-AnyPerl] overriding filetest operators > >---------------------------------------------------------------------- > >Date: Fri, 30 Jun 2000 15:06:07 -0500 >From: Randal Cox <randal@integratedGenomics.com> >Subject: [MacPerl-AnyPerl] overriding filetest operators > >I was wondering if anyone knows how to override file test operators >(like -s of -d). It's easy to override normal functions (e.g., open, >etc), but Perl issues an error for any subroutine like "sub -r {}" > >Any ideas? > >Date: Fri, 30 Jun 2000 18:44:11 -0400 (EDT) >From: Simply Hao <hao@netaxs.com> >Subject: Re: [MacPerl-AnyPerl] overriding filetest operators > >Are you sure you want to do that? Why not use _s and _d? > >Otherwise, you'll probably have to abuse autoload: > > http://ucan.foad.org/~abigail/Perl/Talks/Japhs/autoload.html > >Or wrap certain code sections in substitution eval.... > >- -Hao Yes, I'd like to do some name checking on file names without having to rewrite a bunch of other people's scripts. It is important that the function work just like the -X file tests, so that no code needs to be altered. What I really want to do, is allow for some Unix scripts to run unmodified on the Mac. Unfortunately, those scripts have '/' path seperators hard coded. Finally, it would be really cool to be able to add new file tests... but that's just a little whim.... Randal ==== Want to unsubscribe from this list? ==== Send mail with body "unsubscribe" to macperl-anyperl-request@macperl.org