PDA

View Full Version : Oh great Geek Gods help me with my PERL script please!


Still Learning
11-13-05, 16:26
:cool:

ok I am trying to get my site search to work I use Globat as a host right now.
It seems to work so far kind of but doesnt pull any search results Please help me with this! I would greatly apprciate it below is the attached code, are my variables wrong? thanks!!

Still Learning
11-14-05, 01:47
Ok, guess not everyone is that axious to help a newb. :)

I called Globat and got the official unix path for the $basedir defin (I think)
still search is not working. If you do not know how to fix this can someone suggest a good script to use for what im trying to accomplish? ( a local website seach script for just my site) I just want a simple search for my site script. Or how I can search all my forums threw that search channel? I honestly really apprciate the help, or atleast helping me figure this out with some kind of hints or SOMETHING. thanks

Kodo
11-14-05, 06:44
it's not that no one is anxious to help.. rather perl is an old language and lots of the younger crowd don't know it. I HAD to learn it in school but I'm not very good at it.

QuickSilver
11-14-05, 06:51
Ahhh ok I see that AbbySue has moved your code into an attachment - FYI there is a pretty cool 'paste code' feature on the forum where you can paste large sections of code and it doesn't take up large amounts of screen-space and preserves the formatting for tab-spaced code... its the '#' button up there... but you're new here and its an easy mistake to make :)

Ok I had a quick look at your code but haven't had chance to have a deep look at everything there... My advice to you at this stage is therefore to add lots of debug to the code to work out why it isn't working.
For lines like:

$ls = `ls -l`;

I noticed that you are then applying a regex to the output... when there is a problem where something isn't working but the code is syntactically correct the first thing to do is find out exactly why it isn't working... An easy way to do that is to inspect the output of lines like the one above. I pick on the line above because it is running a system command and storing the output...

So where applicable add print statements to inspect your scalars/lists/hashes to see whether you are getting the expected results at each stage. Where you are no longer getting expected results is a good place to start looking for the problem...

Unfortunatley I don't have the means to debug your code fully at the moment, and so apologies if this is not the easy-fix answer you are looking for... Im just suggesting how I would look at tackling the problem...

Hope that helps some.

Still Learning
11-14-05, 16:41
Awesome thank you everyone. If you thought PERL was ancient I learned Turbo Pascal in school :rolleyes: lol a little C++ but that was along time ago
do they have any good Debuggers the site here for download? I have PHPDesigner but havent got the play with it I just sort of copy and paste code and modify it to get the results I want - thanks