Jump to content

heero11yuy

Members
  • Posts

    22
  • Joined

  • Last visited

Posts posted by heero11yuy

  1. So, you have a list of words (one word per line?) and 26 directories which may contain multiple files and you need to check the filenames for these files to verify that they do NOT contain words from your wordlist? Is this correct?If so, you'll be using the FileSystemObject. First step would be to use the FileSystemObject to open your txt file, read the contents one line at a time, and store the words in something like a Dictionary object.Then you'll want to use the FileSystemObject to find all of the directories (your cam_a, cam_b, etc) in a particular directory and then loop through all of those directories to get a list of all the files in each directory. You'll then need to loop through the files to get each individual file name. Finally, you'll have to loop through each word in your Dictionary and use some type of matching (e.g. regular expressions) to see if the filename contains your word.Sorry I don't have any code for you, I haven't used VBScript in a long time.
    Thanks a lot, appreciated~! ^^In fact... I've got the logic, but I don't know how to do it technically... ><
    Thanks a lot, appreciated~! ^^In fact... I've got the logic, but I don't know how to do it technically... ><
    Actually, what is in the file if I use the filesystemobject? ( that's within a folder, not within a text file )
  2. Hi, please help on this problem:There are many files (*.htm) under 26 folders ( cam_a, cam_b, ..., cam_z )... and I got one word list (wordlist.txt, and of course can save it as xls)... what I needa do is to check every word in the wordlist.txt to see if they DON'T exist in the filename of *.htm under all 26 folders.What I don't know how to do is that:-how to get the word within the wordlist.txt automatically? (cuz there are over 36,000 words)-how to search for the filenames of the files(*.htm) under the 26 folders?My main problems are just can't get the datas... please help!by Roy

  3. JS problem with "alert", please lend a hand~The following is the code, very simple: status = getstatus(); alert(status); if ( status != "playing"){ ... } else{ ... }When I put the line "alert(status);" into the code, it works & ENTERS into the "if ( status != "playing")" statement, that's what I want...But when I take away the line "alert(status);" from the code, it doesn't work and doesn't enter into the if statement... that means status == "playing" ... getstatus() isn't called? isn't updated? or status isn't written into the correct form for comparing with "playing"? I needa know what alert() does there which creates a bug there... please help~! Urgent

  4. How to Send a var to a PARAM value?Say I have a variable of X...<HTML><HEAD><TITLE>StoryMan Personal Word List</TITLE></HEAD><script type=text/javascript>var X = 999</script><body><table><tr><td><object><param name=abc value="filename.swf?id= X " ><!-- here, I want to set id = var X... does anyone know how to do it? --></OBJECT></TD></TR></TABLE></body></HTML>

  5. If there are runtime erros they would show in the browser in big black letters like thisInternal Server Error
    Yeah, that's what it shows on the browser... I thought you're asking for the Apache log error which I don't quite remember how to get it........ ><
  6. when you say the file doesn't work runnin git over the web what do you mean? Do you get any error messages? Or does nothing happen?If you get errors please post them, if nothing happens is there a function to check if $req is set or not (PHP equivelant isset()) If this is not being set properly you will not any further.
    Thanks a lot~! I'm using brower to run the perl file... do you mind to tell me how to check the errors...? ><
  7. >>my $req = $ua->request(HTTP::Request->new( GET => $url ));This line should be the problem... cuz it may not work on HTTP but only the server side?Do you know the correct script for running it on HTTP if possible? If impossible, how could I do it?

    >>my $req = $ua->request(HTTP::Request->new( GET => $url ));This line should be the problem... cuz it may not work on HTTP but only the server side?Do you know the correct script for running it on HTTP if possible? If impossible, how could I do it?
    The followings are the files... the HTML page will call the SECOND FILE... which works perfectly... but it doesn't work for the FIRST FILE's sub(function) getdata... but it works perfectly on the server page...I think the problem is that the HTTP::Request problem... this script should be for running on server side only... does anyone know the script running it on HTTP?FIRST FILE: callasp_storyman.pl#!/usr/bin/perluse warnings;use strict;use CGI qw(:standard);use CGI qw/escape/;use LWP::UserAgent;my $cgi_object = CGI->new();my $url = 'http://mywords.ust.hk/STU/games/game_getdata_storyman.asp';my $file = 'eotw_word_lists_storyman';my $ua = LWP::UserAgent->new();sub getdata {my $req = $ua->request(HTTP::Request->new( GET => $url ));#$req->header('Accept' => '*_/*');my $content = $req->content;my @lines = split("\n",$content);chomp(@lines);my $line;#Sent to a text fileif (unlink($file) == 0) {} else {}sysopen (OUT, $file, 0755, 0755);foreach $line (@lines){print OUT "$line\n"; }close(OUT);}return 1;SECOND FILE: eotw_load_data_storyman.pl#!/usr/local/bin/perlrequire "callasp_storyman.pl";require "eotw_lib.pl";use strict;use CGI qw(:standard);use CGI qw/escape/;my $cgi_object = CGI->new();my $the_list_id;main();sub main() {check_server();validate();#getdata(); get_send_values();}sub get_send_values {my $c_storyman_words_file = "eotw_word_lists_storyman";my $vTheWords;my $vTheTopic;my $i;my $dummy;getdata(); open(WORDS_FILE, $c_storyman_words_file);my @storyman_words = <WORDS_FILE>;close(WORDS_FILE);for ($i=0; $i<@storyman_words; $i++) {if (substr($storyman_words[$i],0,2) == $the_list_id) {($dummy,$vTheTopic) = split(/\|/,$storyman_words[$i]);$vTheWords = $storyman_words[$i+1];last;}}chomp($vTheTopic);chomp($vTheWords);chop($vTheWords); print "Content-type: application/x-www-urlform-encoded\n\n";print "&vTheWords=".escape("${vTheWords}")."&vTheTopic=".escape("${vTheTopic}");}sub validate {print "content-type: text/html \n\n"; $the_list_id = $cgi_object->param("id");if (!$the_list_id) {$the_list_id=1;}die "One of the fields contained inappropriate characters\n" if($the_list_id =~ s/<!--(.|\n)*-->//g);}QUOTE(aspnetguy @ Aug 22 2006, 07:45 PM) hmm... and both scripts are identical you are just runnin gthem with a different method? When you say you run it with HTTP what do you type in the address bar of the browser? Do you type the absolute path (C:\perlscripts\myscript.pl) or do you use a web server (Apache or IIS) (localhost/myscript.pl)?Thanks so much for helping, first of all~ ^^I do use the web server to run it... I think everything is correct except for the script of FIRST FILE... ><I think that the script should be different for running it on server & HTTP, is it?If not, then there must be something else which I don't know... ><
  8. if you are not calling it in a browser (on the server) how are you running it? Command line?
    Using runtime... Command line is: Perl filename.plThen it takes & creates a file on the server... but when I run this filename.pl on HTTP / with a HTML file... it doesn't call the ASP page nor create the file which should pick up the output of the ASP page... ><
  9. How to run a perl file / call a perl function on a HTTP page, if possible? Is there any sample for it? It'd be very appreciated if coding is provided... thanks a lot~!I actually wrote it for to run a perl file on its own server, but when I run it on HTTP / a HTML page... it doesn't work... The perl file needs to run an ASP page and then get the text generated by the ASP page, then the perl file will take the text and create a text file on the server.It works on the server, but it doesn't work when I call it on HTTP / with a HTML page... Please give a hand~ urgent~! :)

  10. Does anyone know how to send some variables to another server which is on a windows platform.Is it able to create test file on another server with Perl?If so, how? Please give a hand.I need to send some datas to another server, say server2, which will receive the datas with ASP... from an Unix based server with Perl.

  11. Dim score_test, fs, f Set fs=Server.CreateObject("Scripting.FileSystemObject") Set f=fs.OpenTextFile(Server.MapPath("top_score_3"), 1) Response.Write(f.ReadLine) f.Close Set f=Nothing Set fs=Nothing >> score_test = I needa store the content of f.ReadLine into score_test, but it's not an Object... may anyone suggest some ways which I can do it?

  12. Does anyone know if I can get the SESSION("userid") with Perl?The Database is on a separate server, the perl runtime is on another separate server on an Unix platform, and there's another server running ASP on a windows platform.The page is generated by ASP... it gets data from the Database server... there's a flash game called from a HTML page generated by ASP, and the flash game calls functions & files from the Perl Unix server... Then, can I get the SESSION("userid") with Perl? If so, may you provide me the scripts as well, thanks a lot~! :)

  13. You can't search the recordset directly. You will need to loop through the recordset and put the values into another data structure, like a dictionary or an array. You should be able to search through that.
    Thanks~! I solved the problem!
  14. The case is that I needa check the value of all items in the RecordSet if they have any characters such has, say || or --, I tried the Find function but it doesn't work with Dreamweaver... Does anyone know any other method I can use for doing that?

  15. According to this page, it looks like DBI might not be supported on Windows:http://ppm.activestate.com/BuildStatus/5.6.htmlYou can try emailing ActiveState about it and see if they have anything to say. The address they give is ppm-request@ActiveState.com
    Thanks a lot, it's very helpful... it doesn't say that it supports XP when I downloaded Perl... so I was wondering if it supports xp... however, appreciated.
  16. Problems with Installing Perl Module (DBI) on windows with PPM --------------------------------------------------------------------------------I don't know why whenever I try to install the perl module DBI thru PPM on windows, the computer is crashed... and restarted... Platform is Windows XP professional, Perl version I used are 5.6 & 5.8.8... I tried both and both have the same problems... please give me a hand, I'd be very appreciated... I need the module DBI installed for finishing my project... The command I typed was:ppm>install dbiit then checked 73 files outta 73 files... then start copying the files... during this process, it crashed & restarted... everytime the same...

×
×
  • Create New...