• Howdy! Welcome to our community of more than 130.000 members devoted to web hosting. This is a great place to get special offers from web hosts and post your own requests or ads. To start posting sign up here. Cheers! /Peo, FreeWebSpace.net
managed wordpress hosting

Great idea for any software programmers

Nick

Well-Known Member
NLC
I just had this kickass idea! Someone should write a program that changes the seebang line (#!/usr/bin/perl) in perl in multiple documents in seconds.

Look at it this way: have you ever tried to install ikonboard on Hypermart? You have to open like twenty some files and change #!/usr/bin/perl to #!/usr/local/bin/perl. This is annoying as hell!

Now just think if you had a small program that changed all those shebang lines in a matter of seconds. That would be the most kickass program ever.

Would someone who knows how to program software please make a program like this? Please :D :D :D?
 
If you really want one, I suppose I could write one for you... (or someone else on this board)

This is incredibly easy to write with PHP or even PERL so anyone can do it... (I will be busy for about another week or so doing a few more sites...)
 
Originally posted by cds
This is incredibly easy to write with PHP or even PERL so anyone can do it...

Yes, if I wanted it in PHP or Perl I'd write it myself, but I want to have it on my computer so I can work on road trips and stuff...
 
If you have perl for Win32 (I assume you're on Windows?), you can easily run your perl scripts from your computer. Pretty easy to do, then! :)
 
unix only (i think.. grep is a unix command):

#!/usr/bin/perl

$shebang = "#!/usr/bin/perl";

opendir DIR, ".";
my @files = grep /\.(pl|cgi)$/, readdir DIR;
closedir DIR;

foreach (@files) {
open FILE, "<./$_";
$first = <FILE>;
if ($file =~ /^#!/) {
$output = "$shebang\n";
while (<FILE>) { $output .= $_; }
close FILE;

open FILE, ">./$_";
print FILE $output;
close FILE;
}
}

test that out.. made it up on the spot.. try it in a directory with 1 pl or cgi file.. and if it works.. then i'm pretty sure it'll work in any case.. it doesn't go up directories.. ie: if you put it in cgi-bin.. it won't go up to cgi-bin/whatever.. its just a few changes to build a directory tree though.. there is a standard perl module to do it..
 
Back
Top