Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^5: Can I get a -S switch that doesn't care about the execute bit?

by Anonymous Monk
on Aug 23, 2011 at 08:24 UTC ( #921843=note: print w/ replies, xml ) Need Help??


in reply to Re^4: Can I get a -S switch that doesn't care about the execute bit?
in thread Can I get a -S switch that doesn't care about the execute bit?

It should be fairly trivial, simply locate the point where -x is tested, and add conditional (!SvTRUE( get_sv("sx::y"))

In file util.c in function Perl_find_script

if (S_ISREG(PL_statbuf.st_mode) && cando(S_IRUSR,TRUE,&PL_statbuf) #if !defined(DOSISH) && !SvTRUE( get_sv("sx::y") && cando(S_IXUSR,TRUE,&PL_statbuf) #endif ) { xfound = tmpbuf; /* bingo! */ break; }
and accompanying badly named pragma
package sx::y; $sx::y = $VERSION = 0.01; 1;

when you recompile perl, use as perl -Msx::y -S foo

Untested, so not in patch form


Comment on Re^5: Can I get a -S switch that doesn't care about the execute bit?
Select or Download Code
Re^6: Can I get a -S switch that doesn't care about the execute bit?
by DrWhy (Chaplain) on Aug 23, 2011 at 18:43 UTC
    Of course the pragma should be properly named 'sexy.pm'.

    --DrWhy

    "If God had meant for us to think for ourselves he would have given us brains. Oh, wait..."

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (17)
As of 2015-07-02 19:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (44 votes), past polls