[VPM] FW: FW: overriding perl 'our','my' keywords

Peter Scott Peter at PSDT.com
Tue Mar 17 17:28:16 PDT 2009


At 04:35 PM 3/17/2009, Jer A wrote:
>so what people are saying, there is no way to override keywords 'our' or 'my'
>
>optimally i would like something that follows this psuedo code
>
>sub keyword {
>($valueref) = @_;
>call internal keyword with argument eg. my or our on valueref...dunno, 
>but would i have to declare by val?
>if $valueref is a string, clear it "",undef
>if $valueref is an array or hash , clear it ()
>
>}

You can do this with source filters.  Filter::Simple if you must.  I 
*strongly* counsel against it.  There are inherent problems with source 
filtering such that I would only use them in novelty code.

IIRC it is also possible to diddle Perl's optree, maybe with 
B::Generate, although ISTR there is a newer and easier way, anyone know 
what I'm thinking of?  But, like, gross.  This kind of thing is a sure 
sign that you're headed down the wrong path.  And even if you got it 
working the code would be horrible for anyone to understand.
-- 
Peter Scott
Pacific Systems Design Technologies
http://www.perldebugged.com/
http://www.perlmedic.com/




More information about the Victoria-pm mailing list