Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid

Re: question about perl

by defyance (Curate)
on Mar 12, 2002 at 23:51 UTC ( #151269=note: print w/replies, xml ) Need Help??

in reply to How do I change the shebang line for all perl scripts in a directory

If I'm understanding what you are saying, you have a whole bunch of perl scripts, and you need to change one line (#!/usr/bin/perl??) to #!/usr/local/bin/perl on all of the perl files in a dir? If that is the case technically you could write a perl script to do it. It wouldn't take long, or much to hack one out. Is my understanding correct?

-- Yes, I am a criminal. My crime is that of defyance.

Replies are listed 'Best First'.
Auto shebang hacking
by rinceWind (Monsignor) on Mar 13, 2002 at 00:30 UTC
    I had some thoughts about this very subject posted to a different forum.

    We spend a lot of effort with modules, verifying that all files are present, they work, etc. before putting them live.

    What about their poor relations, the scripts? A script writer could implement tests in an equivalent of make test. The install step could copy to cgi-bin or wherever the script needs to go, changing the shebang line in the process, having worked out where perl lives.

    Could Extutils::MakeMaker be used to do this, or is this too hard-coded for modules and h2xs?

      Check the only entry in my CPAN directory for my script that does shell-to-Perl translation. It shows how to hack the shebang line during installation, and also shows tests for the script.

      -- Randal L. Schwartz, Perl hacker

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (3)
As of 2020-10-22 01:09 GMT
Find Nodes?
    Voting Booth?
    My favourite web site is:

    Results (225 votes). Check out past polls.