Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

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

by Anonymous Monk
on Aug 23, 2011 at 06:45 UTC ( [id://921837]=note: print w/replies, xml ) Need Help??


in reply to Re^2: 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?

Hmm... Thanks for the feedback. I don't suppose anyone has thought about creating a pragma module that lets you make modifications to find_script's behavior? Or does that come to early in perl execution to be amenable to modification by a pragma. If it could work of course it would be something that could only be usefully used as a -m/-M argument on the perl command line, I would guess.

There was this one guy, but a rock fell from the sky and crushed him :)

Hey, my Win32 doesn't croak if there is no execute bit, you can switch to Win32 :D

No, it doesn't happen too early ... UTSL

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

Replies are listed 'Best First'.
Re^4: Can I get a -S switch that doesn't care about the execute bit?
by DrWhy (Chaplain) on Aug 23, 2011 at 07:55 UTC
    Will wonders never cease??? Something Win32 is good for...

    I don't have time to learn how to make my own pragma to accomplish this, so I'll probably go the make-all-the-scripts-executable route.

    --DrWhy

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

      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

        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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://921837]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (3)
As of 2025-03-20 18:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    When you first encountered Perl, which feature amazed you the most?










    Results (61 votes). Check out past polls.