Greenguy's Board


Go Back   Greenguy's Board > Programming & Scripting
Register FAQ Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
Old 2005-12-12, 09:11 PM   #1
Mattinblack
Asleep at the switch? I wasn't asleep, I was drunk
 
Join Date: Nov 2005
Location: London UK in a house share with three 28 yr old girls...perv perv
Posts: 215
Something that may be of use to you guys

With many perl and other scripts it is necessary to know the FULL system path to your programs. Often Aliased paths do not work for calls in perl like Exec and System. One of my clients got an account with a host whose tech support was CRAP and after a week they still hadnt mailed me with the system path so I got annoyed and found out how to
write a perl script that searched their entire server from the root directory down for my executable files.

As a utility its useful to people who dont code themselves but just install/ mod others scripts so I have tarted it up slightly and present it here. When I get time I will host it on my webmasters resource page at http://kwikfire.com .... Please note that on a huge distributed server network it might take a good few minutes to run

==========Cut below here =======================

#!/usr/bin/perl
use CGI::Carp qw(fatalsToBrowser);
############################################
$myfile="sa231er45.pl";
##############################################################
#Simply change shebang line to suit your server if needed....#
# then change $myfile to be the *unique* filename of a file in #
# your script directory - make one named with random text #
# run this script by typing in its url in your browser...wait#
##############################################################
print "Content-type: text/html\n\n";
print "Pathfinder by Mattinblack.... Searching for $myfile<p>";
print "Please wait this may take a few minutes!<br>";
require "find.pl" or die "No find.pl on this system";


&find('/');
print"<P>Above are either fully qualified paths or nothing!....DONE";
exit;

sub wanted {
/^$myfile$/ && print("$name\n<P>");
}

===============Cut above here==================

Dont send me mails asking why the sub wanted is never called....
or where $name is defined or.... just read the documentation about the find utility....lol Course if your server does not have find installed you are stuffed but it has been part of the standard perl distribution for Ages now.
__________________
Mattinblack - <a href="http://pornlinks.kwikfire.com">PornLinks</a> - <a href="http://strange-attractor.kwikfire.com">Strange Attractor</a> - <a href="pnav.kwikfire.com">PORNavigator</a> - <a href="http://ukescort.kwikfire.com/">Fem Escorts</a> - <a href="http://kwikfire.com/">Hosting</a>
Mattinblack is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 10:29 AM.


Mark Read
Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
© Greenguy Marketing Inc