Errors on processing 2GB XML file by using XML:Simple

2005-05-13 Thread Nan Jiang
Hi all, I keep receiving virtual memory error and program runtime error while using XML:simple to process a 2GB XML file on Windows 2000. I have changed virtual memory to 4 GB but still no use, so I wonder if anyone could offer some help? Or is there any better module to process a 2GB XML file?

Re: Errors on processing 2GB XML file by using XML:Simple

2005-05-13 Thread Nan Jiang
Peter, Thanks for the reply. I know my algorithm is not good (I have about 3 - 4 foreach in loops) but I have to do it in that way as the XML file is somewhat a more plain stucture rather than a tree-like structure. I'll try XML:Twig anyway. Nan From: Peter Rabbitson <[EMAIL PROTECTED]> To: beg

Re: Errors on processing 2GB XML file by using XML:Simple

2005-05-16 Thread Nan Jiang
Hi all, I have tried to use XML:Twig to parse a 2GB XML file instead of using XML:Simple, but I still got an error "The memory couldn't be written". My Perl is the latest and my RAM is 1GB. Anyone got suggestions? Thanks a lot, Nan From: Peter Rabbitson <[EMAIL PROTECTED]> To: beginners@perl.org

Re: Errors on processing 2GB XML file by using XML:Simple

2005-05-16 Thread Nan Jiang
Hi Peter, Basically, the XML file has two key parallelled nodes: and . If there is a child existing in , node will be existing for showing more detailed information about the content of this such as and . However, not every node has one or more child, so I need to write a loop to find o

Re: Errors on processing 2GB XML file by using XML:Simple

2005-05-16 Thread Nan Jiang
Hi Peter, The codes which are quite straightforward are below: #!/usr/bin/perl use warnings; use strict; use XML::Twig; my $twig= new XML::Twig; $twig->parsefile( "./content.example.txt"); #open XML file my $root = $twig->root; #set root chdir "F:/httpserv"; #set initial directory foreach my $topic

Re: Errors on processing 2GB XML file by using XML:Simple

2005-05-16 Thread Nan Jiang
05 09:31:15 -0500 On Mon, May 16, 2005 at 01:33:15PM +, Nan Jiang wrote: > While I think and are not randomly intermixed as > nodes are generated in relevant categories such as -> > -> and then if the has > children which means it is a final category, then nodes > app

Re: Errors on processing 2GB XML file by using XML:Simple

2005-05-17 Thread Nan Jiang
ut this? Sorry I'm really new in Perl XML processing... Many many thanks again, Nan From: Peter Rabbitson <[EMAIL PROTECTED]> To: beginners@perl.org Subject: Re: Errors on processing 2GB XML file by using XML:Simple Date: Mon, 16 May 2005 09:31:15 -0500 On Mon, May 16, 2005 at 01:33:15PM +

Re: Errors on processing 2GB XML file by using XML:Simple

2005-05-18 Thread Nan Jiang
Hi Peter, Thanks for your patient and detailed answers. I have examined the XML file and all with children are followed by their own s. If there is a without inside, it is followed by a new . So I think your codes are safe enough to use :-). However, where I'm stuck in is, after putting some

Re: Errors on processing 2GB XML file by using XML:Simple

2005-05-18 Thread Nan Jiang
Sorry Peter, I know the answer of second question after reading a quick reference of twig... Nan From: "Nan Jiang" <[EMAIL PROTECTED]> To: [EMAIL PROTECTED], beginners@perl.org Subject: Re: Errors on processing 2GB XML file by using XML:Simple Date: Wed, 18 May 2005 13:44:2

Re: Errors on processing 2GB XML file by using XML:Simple

2005-05-19 Thread Nan Jiang
Hi Peter, I finally start understanding how XML::twig handlers work though it sounds a bit tricky to me at first because I didn't put much debug code to trace the execution of each important line. Now I understand that XML:Twig still reads the whole document from top to bottom, but the thing is

Re: Errors on processing 2GB XML file by using XML:Simple

2005-05-19 Thread Nan Jiang
Not really, think how much programming effort would it take to generate a file where and corresponding would be intermixed :) To be honestly, that's why I'm using perl because it is fast and reliable for processing text... Assuming that you keep only one file open at a time and your filehandle

Efficiently search in large files?

2005-06-20 Thread Nan Jiang
Hi all, I'm developing a simple search engine under cgi-bin of a webserver. The problem is my database is a single 2GB xml file, when I use XML:Twig to maintain searching in the file, it usually takes a v.long time to process and I can't terminate it by just closing web explorer (the perl proc

XML:Twig print and delete

2005-06-23 Thread Nan Jiang
Hi all, How to use XML:Twig print to print to a file and how to use delete to delete an element? For print to a file: I tired what FAQ says but it doesn't work, the file size is always 0. Belows are my codes: #!/usr/bin/perl use warnings; use strict; use XML::Twig; my $twig= XML::Twig->new

Why XML not well formed?

2005-06-30 Thread Nan Jiang
Hi all, I encountered a really weird error while using perl script to search in a big XML/RDF file (225MB) in CGI. I don't know what's wrong with it as the script works perfectly with a sample XML/RDF file (only 4K) which has the same format as the big one and their only difference is the fi

Help, single quotation mark conflicts error in SQL statement!

2005-07-08 Thread Nan Jiang
Hi All, I'm trying to add data to my mysql database, however, I received a SQL syntax error because sometimes my string variable contains single quotation mark ('). Does anyone know how to cope with it? My statement is below: $dbh->do("INSERT INTO table1 values(id, '$_', '$t')") foreach sor

Re: Help, single quotation mark conflicts error in SQL statement!

2005-07-08 Thread Nan Jiang
org To: Nan Jiang <[EMAIL PROTECTED]> CC: beginners@perl.org Subject: Re: Help, single quotation mark conflicts error in SQL statement! Date: Fri, 8 Jul 2005 09:45:56 -0400 (EDT) On Fri, 8 Jul 2005, Nan Jiang wrote: I'm trying to add data to my mysql database, however, I received a SQL

Re: Help, single quotation mark conflicts error in SQL statement!

2005-07-08 Thread Nan Jiang
Thanks indeed! Actually I feel so bad that I found many codes without enough explanations...:-) Nan From: Chris Devers <[EMAIL PROTECTED]> Reply-To: beginners@perl.org To: Nan Jiang <[EMAIL PROTECTED]> CC: beginners@perl.org Subject: Re: Help, single quotation mark conflicts

Perl/CGI detecting status of radio button

2006-03-10 Thread Nan Jiang
Hello everyone, I would like to ask if some of you know how to use perl to detect the status (checked or unchecked) of a radio button from a HTML form? many thanks, Nan -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Perl/CGI detecting status of radio button

2006-03-10 Thread Nan Jiang
so how could I implement it, please? I'm not sure if CGI supports some functions directly? Nan From: Chris Devers <[EMAIL PROTECTED]> Reply-To: beginners@perl.org To: Nan Jiang <[EMAIL PROTECTED]> CC: beginners@perl.org Subject: Re: Perl/CGI detecting status of radio button