CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Need a Custom or Prewritten Perl Program?: Throw Down The Gauntlet:
change shebang line automatically

 



inlimbo
User

Dec 22, 2004, 3:27 AM

Post #1 of 5 (20233 views)
change shebang line automatically Can't Post

Im sure this is very very very simple to do.

I just want a script whereby i can pass in a cgi file and it checks the first line - i.e. the shebang. If the shebang line is #!/perl/bin/perl change it to #!/usr/bin/perl .

Similarly if Ive got -wT on the end of the shebang line I want it to stay there. Maybe the code could automatically put on -wT and use CGI qw(:standard); and use CGI::Carp qw(warningsToBrowser fatalsToBrowser); and use strict; in case I forget. Yeah that would be ace.

I write and test all my scripts on my home PC running Apache on Winblows XP and the path to perl is #!/perl/bin/perl but the path to perl on my website is #!/usr/bin/perl. Its a little bit annoying when i forget this i get a 500 error and I scream "What the #$*@! ....[calms down] Opps forgot about the shebang" :)

it would be extra way cool if it could automatically FTP the file to a predetermined directory on my web server and chmod it to 755. That would blow my mind.

But all im really after is code for changing the shebang line so that i can attempt (my first attempt at non-web based perl) to make a win32 app using it.

inlimbo... Laugh


kencl
User

Jan 10, 2006, 10:54 PM

Post #2 of 5 (18445 views)
Re: [inlimbo] change shebang line automatically [In reply to] Can't Post

Why do you even need a shebang line in XP? Try taking it out completely and see if it run without it.

Then just white a script which opens your file(s) and prepends a standard header with whatever you wanted (use strict etc).

>> If you can't control it, improve it, correlate it or disseminate it with PERL, it doesn't exist!


MrPJ
User

Jan 17, 2006, 9:05 AM

Post #3 of 5 (18436 views)
Re: [inlimbo] change shebang line automatically [In reply to] Can't Post

Install perl into:

/usr/bin

...on your pc instead of /perl/bin


rork
User

Jan 22, 2006, 11:50 AM

Post #4 of 5 (18419 views)
Re: [MrPJ] change shebang line automatically [In reply to] Can't Post

That's one of the things I didn't like of ActiveState perl, I never find out how to change the directory where it's installed in.

And on windows you probably can use #!/usr/bin/perl as shebang line, it doesn't bother about it anyways.
--
Don't reinvent the wheel, use it, abuse it or hack it.

(This post was edited by rork on Jan 22, 2006, 11:51 AM)


MrPJ
User

Jan 22, 2006, 12:22 PM

Post #5 of 5 (18417 views)
Re: [rork] change shebang line automatically [In reply to] Can't Post

>>
That's one of the things I didn't like of ActiveState perl, I never find out how to change the directory where it's installed in.
<<

The installer lets you choose.

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives