UNION statement to sort search results

2005-02-14 Thread Jan Eden
Hi, I wrote a search script which can search only the page titles and author names for articles on my site or the titles/authors and the pages' content. To get the results for the two types in two sets, I used a UNION construct: if ($search_string) { my $where_author_title =

perl.beginners.cgi Weekly list FAQ posting

2005-02-14 Thread casey
NAME beginners-faq - FAQ for the beginners-cgi mailing list 1 - Administriva 1.1 - I'm not subscribed - how do I subscribe? Send mail to [EMAIL PROTECTED] You can also specify your subscription email address by sending email to (assuming [EMAIL PROTECTED] is your email

Perl Catalog

2005-02-14 Thread hengky
hi all, i'm working on database with a lot of category... here i example for category that i like to create Computer Computer/Motherboard Computer/Motherboard/AMD Computer/Motherboard/Intel Computer/Drive Storage Computer/Driver Storage/SATA Computer/Driver Storage/ATA Computer/Driver

Re: Perl Catalog

2005-02-14 Thread Ricardo SIGNES
* hengky [EMAIL PROTECTED] [2005-02-13T19:05:25] --- | id_cat | nama_category | id_parent | - - --- | 001 | Computer| TLCAT | | 002 | Motherboard | 001 | Why TLCAT and not NULL? Then you

Re: Perl Catalog

2005-02-14 Thread Jenda Krynicky
From: hengky [EMAIL PROTECTED] i'm working on database with a lot of category... here i example for category that i like to create Computer Computer/Motherboard Computer/Motherboard/AMD Computer/Motherboard/Intel Computer/Drive Storage Computer/Driver Storage/SATA Computer/Driver

Getting the content of a .doc file under Unix

2005-02-14 Thread Octavian Rasnita
Hi all, Does anyone how to get the text from a .doc file under Unix? I would like to make a program which is portable and also work under Linux, not only under Windows, and I think Win32::OLE won't work under Linux. Thank you very much. Teddy -- To unsubscribe, e-mail: [EMAIL PROTECTED] For

Re: Getting the content of a .doc file under Unix

2005-02-14 Thread Ricardo SIGNES
* Octavian Rasnita [EMAIL PROTECTED] [2005-02-14T08:46:22] Does anyone how to get the text from a .doc file under Unix? I would like to make a program which is portable and also work under Linux, not only under Windows, and I think Win32::OLE won't work under Linux. google for catdoc and

Re: Getting the content of a .doc file under Unix

2005-02-14 Thread Edward WIJAYA
On Mon, 14 Feb 2005 15:46:22 +0200, Octavian Rasnita [EMAIL PROTECTED] wrote: Does anyone how to get the text from a .doc file under Unix? I would like to make a program which is portable and also work under Linux, not only under Windows, and I think Win32::OLE won't work under Linux. Open

Question on sorting file

2005-02-14 Thread Vishal Vasan
Hello All, I am trying to sort a file with records. I have tried to slurp all the records present in the file to memory but the memory has run out. Now I am doing it in shell script itself and it takes around 2 hours for the file. I have around 10 files more to go. Could somebody help me as to

Re: Question on sorting file

2005-02-14 Thread Vishal Vasan
Sorry about that. The file has 36,000,000 records. Regards, --V On Mon, 14 Feb 2005 20:24:15 +0530, Vishal Vasan [EMAIL PROTECTED] wrote: Hello All, I am trying to sort a file with records. I have tried to slurp all the records present in the file to memory but the memory has run out.

Re: hash speed

2005-02-14 Thread Wiggins d'Anconia
Ken Gillett wrote: I have a script that creates a hash, up to several thousand key=value pairs. Each value is a string that is created by adding to it repeatedly, maybe hundreds of times, each addition probably about 10 bytes. I can do this in (at least) 2 ways. One is to repeatedly concatenate

Re: Question on sorting file

2005-02-14 Thread Jay
On Mon, 14 Feb 2005 20:25:18 +0530, Vishal Vasan [EMAIL PROTECTED] wrote: Sorry about that. The file has 36,000,000 records. Regards, --V On Mon, 14 Feb 2005 20:24:15 +0530, Vishal Vasan [EMAIL PROTECTED] wrote: Hello All, I am trying to sort a file with records. I have tried to

RE: Question on sorting file

2005-02-14 Thread Thomas Bätzler
Vishal Vasan [EMAIL PROTECTED] asked: I am trying to sort a file with records. I have tried to slurp all the records present in the file to memory but the memory has run out. Read your input file in several large chunks, and sort each as you go, saving the output to a temporary file. Once

Re: Question on sorting file

2005-02-14 Thread Vishal Vasan
Hi, This is the perl script that I had written... --- #!/usr/bin/perl -w @a = ; @b = sort @a; for($i=0;$i@a;$i=$i+1){ print $b[$i]; } - But this runs out of memory. I that

Re: Create html pages w/ images and text

2005-02-14 Thread Randal L. Schwartz
Zentara == Zentara [EMAIL PROTECTED] writes: Zentara (@tfiles) = map{ $_ =~ /(.*).txt$/ } @tfiles; Much more simply written as: s/\.txt$// for @tfiles; Zentara (@jfiles) = map{ $_ =~ /pics\/(.*).jpg$/ } @jfiles; similar here. -- Randal L. Schwartz - Stonehenge Consulting Services, Inc.

perl.beginners Weekly list FAQ posting

2005-02-14 Thread casey
NAME beginners-faq - FAQ for the beginners mailing list 1 - Administriva 1.1 - I'm not subscribed - how do I subscribe? Send mail to [EMAIL PROTECTED] You can also specify your subscription email address by sending email to (assuming [EMAIL PROTECTED] is your email address):

Re: Perl Catalog

2005-02-14 Thread Randal L. Schwartz
Hengky == Hengky [EMAIL PROTECTED] writes: Hengky hi all, Hengky i'm working on database with a lot of category... Hengky here i example for category that i like to create Hengky Computer Hengky Computer/Motherboard Hengky Computer/Motherboard/AMD Hengky Computer/Motherboard/Intel Hengky

blacklist monitoring with Net::DNS::Resolver

2005-02-14 Thread Mariano Cunietti
Hi, I'm writing a simple script to perform some periodical checks on dns blacklist, so I can be quickly informed when one of my mail servers gets blacklisted. What I want is a function to query in-addr.arpa DNS and return an IP address. I used Net::DNS::Resolver, but the output is too long, and I

Re: Question on sorting file

2005-02-14 Thread Jay
On Mon, 14 Feb 2005 22:06:51 +0530, Vishal Vasan [EMAIL PROTECTED] wrote: Hi, This is the perl script that I had written... --- #!/usr/bin/perl -w @a = ; @b = sort @a; for($i=0;$i@a;$i=$i+1){ print $b[$i]; }

RE: Create html pages w/ images and text

2005-02-14 Thread Brian Volk
Zentara, Wow! Thank you so much for sharing your knowledge, I learned a lot! Brian -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of zentara Sent: Monday, February 14, 2005 9:41 AM To: beginners@perl.org Subject: Re: Create html pages w/ images and

Re: blacklist monitoring with Net::DNS::Resolver

2005-02-14 Thread Scott Pham
have you tried reversing the array and joining it with a .? On Mon, 14 Feb 2005 18:38:36 +0100, Mariano Cunietti [EMAIL PROTECTED] wrote: Hi, I'm writing a simple script to perform some periodical checks on dns blacklist, so I can be quickly informed when one of my mail servers gets

RE: CGI/DBI - Can anyone work out why this fails

2005-02-14 Thread mike
On Fri, 2005-02-11 at 08:02 -0500, Bob Showalter wrote: mike wrote: I have the following code $cat1; if ($cat1){ my $cat1=%$category%; The my here is scoped to this if { } block, so you aren't changing the outer $cat1 } else { $cat1=$category; }

RE: Compare file modification time

2005-02-14 Thread Babale Fongo
It was just an attempt to see how someone else may tackle this issue. I thought of sorting, but I wasn't sure it will do exactly what I expect. Here is what I've have so far: my $dir = /mydir; opendir(DH, $dir) || die Failed to open $dir: $!\n; my $counter = 0; while (defined(my $file =

Re: Compare file modification time

2005-02-14 Thread Wiggins d'Anconia
Please bottom post Babale Fongo wrote: It was just an attempt to see how someone else may tackle this issue. I thought of sorting, but I wasn't sure it will do exactly what I expect. Here is what I've have so far: my $dir = /mydir; opendir(DH, $dir) || die Failed to open $dir: $!\n; my

Re: Question on sorting file

2005-02-14 Thread Chris Charley
Hello Vishal, File::Sort does external sorting for large files. http://search.cpan.org/~cnandor/File-Sort-1.01/Sort.pm Chris -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response

Start reading from a specific line

2005-02-14 Thread Eduardo Vázquez Rodríguez
Hello Perl Programmers I have a question regarding openning a file How can I start reading a file from n line? For example I open a File like this way open(INPUT, $file) while (INPUT) { do something with $_; } But It starts to read from line #1, what I want is that start reading exactly

Re: Compare file modification time

2005-02-14 Thread John W. Krahn
Babale Fongo wrote: It was just an attempt to see how someone else may tackle this issue. I thought of sorting, but I wasn't sure it will do exactly what I expect. Here is what I've have so far: my $dir = /mydir; opendir(DH, $dir) || die Failed to open $dir: $!\n; my $counter = 0; while

RE: Start reading from a specific line

2005-02-14 Thread Jason Balicki
Eduardo Vázquez Rodríguez mailto:[EMAIL PROTECTED] wrote: How can I start reading a file from n line? For example I open a File like this way open(INPUT, $file) while (INPUT) { do something with $_; } I'm a newbie myself, but is there a reason you've already discounted something like:

Re: Start reading from a specific line

2005-02-14 Thread John W. Krahn
Eduardo Vázquez Rodríguez wrote: Hello Perl Programmers Hello, I have a question regarding openning a file How can I start reading a file from n line? For example I open a File like this way open(INPUT, $file) while (INPUT) { do something with $_; } But It starts to read from line #1, what I

Re: Start reading from a specific line

2005-02-14 Thread John W. Krahn
Jason Balicki wrote: Eduardo Vázquez Rodríguez mailto:[EMAIL PROTECTED] wrote: How can I start reading a file from n line? For example I open a File like this way open(INPUT, $file) while (INPUT) { do something with $_; } I'm a newbie myself, but is there a reason you've already discounted

compare file modification time

2005-02-14 Thread perl
#!/usr/bin/perl -w use strict; #use diagnostics; my $dir = testdir; opendir (DH, $dir) || die Could not open $dir: $!\n; my @files; my $keep = 7; while (defined(my $file = readdir(DH))){ next if $file =~ /^\.+$/; push (@files, $file); } # Skip the rest if number of files isn't above

Re: Start reading from a specific line

2005-02-14 Thread DBSMITH
if you want to use a built in function then use $. or its alternatives $NR, or $INPUT_LINE_NUMBER By definition this says the current input line number of the last file handle that was read. my $linect=$. while ( FILEHANDLE) { if ( $linect 9 ) { do whatever ... } }

RE: Start reading from a specific line

2005-02-14 Thread Eduardo Vázquez Rodríguez
Thanks I prove it and worked! -Original Message- From: [EMAIL PROTECTED] To: Perl Beginners Sent: 2/14/2005 5:13 PM Subject: Re: Start reading from a specific line if you want to use a built in function then use $. or its alternatives $NR, or $INPUT_LINE_NUMBER By definition

perl grep vs unix grep

2005-02-14 Thread Vladimir Lemberg
Hi All, I have a script which works with text file over 1,5 - 2 GB. It takes me over 10 minutes to grep it and populate a list while unix shell is able to egrep it for 45 sec. open (LOGFILE,$_[1]) or die Cannot open LogFile file\n; local $/ = ''; @list = grep {/\|$pattern/} LOGFILE ;

Re: Start reading from a specific line

2005-02-14 Thread John W. Krahn
[EMAIL PROTECTED] wrote: if you want to use a built in function then use variable $. or its alternatives $NR, or $INPUT_LINE_NUMBER Which implys that you are using the 'English' module which is a bad idea if speed is

Re: perl grep vs unix grep

2005-02-14 Thread John W. Krahn
Vladimir Lemberg wrote: Hi All, Hello, I have a script which works with text file over 1,5 - 2 GB. It takes me over 10 minutes to grep it and populate a list while unix shell is able to egrep it for 45 sec. open (LOGFILE,$_[1]) or die Cannot open LogFile file\n; local $/ = ''; @list = grep

Re: compare file modification time

2005-02-14 Thread John W. Krahn
[EMAIL PROTECTED] wrote: #!/usr/bin/perl -w use strict; #use diagnostics; my $dir = testdir; opendir (DH, $dir) || die Could not open $dir: $!\n; my @files; my $keep = 7; while (defined(my $file = readdir(DH))){ next if $file =~ /^\.+$/; push (@files, $file); } # Skip the rest if number of

Substitute Regex with 'e'

2005-02-14 Thread Ramprasad A Padmanabhan
Hi I want to so a substititue a string Say my %hash = ( 1130, a , 2100, b); $x = 'SOMEJUNK 1130'; # I want $x to be'1130a' # This regex does not work $x=~s/^(.*?) (\d+)/ $2 . { defined $hash{$2} ? $hash{$2} : 'NOTFOUND' } /e; Can someone fix the regex for

Re: Substitute Regex with 'e'

2005-02-14 Thread Xiaofang Zhou
Hi, Ramprasad use ( ) not { } in regexp. $x=~s/^(.*?) (\d+)/ $2 . ( defined $hash{$2} ? $hash{$2} : 'NOTFOUND' ) /e; 2005-02-15 12:30:00 Hi I want to so a substititue a string Say my %hash = ( 1130, a , 2100, b); $x = 'SOMEJUNK 1130'; # I want $x to be'1130a' #