RE: Sendmail mail from script

2006-06-01 Thread Мандип Сингх Бхабха
There are multiple ways to send mail from perl script. I think this code will help. open(ML,"|mail -s \"Subject of mesaages should be here\" [EMAIL PROTECTED]") or die " Can't open mail handle: $!"; print ML $_ ; close(ML);

Re: Scraping

2006-06-01 Thread David Romano
Hi Ken, On 6/1/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: The second option worked to print Abercrombie, Neil to the screen. Still working on basic concepts. The split construction was suggested by someone as a way to get to pulling in all listings and ultimately all votes. All votes? Yo

Sendmail mail from script

2006-06-01 Thread joseph
List, Good day! I'm trying to rewrite a bash script into perl as to aid my learning experience.Supposedly this script would do these things; 1. Open the logfiles. 2. Check the last portion of files. 3. Check the log for an ERROR string. 4. If error is present mail.(I'm stuck here i dunno how

Re: Scraping

2006-06-01 Thread kc68
On Thu, 01 Jun 2006 20:14:36 -0400, David Romano <[EMAIL PROTECTED]> wrote: Hi kc68, On 6/1/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: I'm not getting past printing to the screen and to a file the page in the script below but without the list of names in the middle. Without the if

Re: Scraping

2006-06-01 Thread David Romano
Hi kc68, On 6/1/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: I'm not getting past printing to the screen and to a file the page in the script below but without the list of names in the middle. Without the if line I get an endless scroll. I want to be able to pull in all names and then isol

Scraping

2006-06-01 Thread kc68
I'm not getting past printing to the screen and to a file the page in the script below but without the list of names in the middle. Without the if line I get an endless scroll. I want to be able to pull in all names and then isolate and print one (e.g. abercrombie). Guidance and actual scr

Re: faster search engine for fulltext search

2006-06-01 Thread Dr.Ruud
"Octavian Rasnita" schreef: > CREATE TABLE `articles` ( > `id_newspapers` smallint(3) unsigned NOT NULL default '0', > `id_sections` smallint(3) unsigned NOT NULL default '0', > `id` int(6) unsigned NOT NULL auto_increment, > [...] > PRIMARY KEY (`id_newspapers`,`id_sections`,`id`), This

Re: faster search engine for fulltext search

2006-06-01 Thread JupiterHost.Net
If these queries work so slow, I am wondering how slow it will work when the database will have a million records. See fulltext docs at mysql.com, my point still was paginate and use LIMIT (or DB's equivalent) so your perl only has to process an array of a few records instaead of all. IE fo

Re: faster search engine for fulltext search

2006-06-01 Thread Octavian Rasnita
Hi, Here is the SQL query I have used in a table with less than 200.000 records, and I have searched for a single word named "deputat" which was found in 2208 records, but only 20 of them were returned. Here is the table: CREATE TABLE `articles` ( `id_newspapers` smallint(3) unsigned NOT NULL

Re: faster search engine for fulltext search

2006-06-01 Thread JupiterHost.Net
Perhaps doing your queries to return only some instead of all records will help, a great module for doing this is: http://search.cpan.org/perldoc?Data::Paginate I am using a limit clause and the sql query returns at most 20 records, but when very many records are found, the search is very slo

Re: Perl script to search and replace a string in a file

2006-06-01 Thread Paul Johnson
On Thu, Jun 01, 2006 at 08:11:49AM -0500, Michael Goldshteyn wrote: > "Ricky Zhou" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > perl -pi -e 's/original text/new text/g' * > > Error: Can't do inplace edit without backup. You need either perl -pi.bak -e ... or an OS upgrad

Re: Perl script to search and replace a string in a file

2006-06-01 Thread Michael Goldshteyn
"Ricky Zhou" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > perl -pi -e 's/original text/new text/g' * Error: Can't do inplace edit without backup. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: help in regular expression

2006-06-01 Thread David Romano
Hi Ruud, On 6/1/06, Dr.Ruud <[EMAIL PROTECTED]> wrote: "David Romano" schreef: > [ $pattern = '\w\s\w' ] > You also need to [...] escape the slashes for the pattern you're > using I don't think that is needed: (1) perl -le '$re = q{\w\s\w} ; print qr/$re/' (2) perl -le '$re = q{\\w\\s\\w}

Re: help in regular expression

2006-06-01 Thread Dr.Ruud
"David Romano" schreef: > [ $pattern = '\w\s\w' ] > You also need to [...] escape the slashes for the pattern you're > using I don't think that is needed: (1) perl -le '$re = q{\w\s\w} ; print qr/$re/' (2) perl -le '$re = q{\\w\\s\\w} ; print qr/$re/' (on Windows you'll need to change the o

Re: help in regular expression

2006-06-01 Thread Muma W.
Irfan J Sayed wrote: Hi , I am using following code #!/usr/local/bin/perl # Main program use warnings; use strict; my $file = "c:\backup.pl"; open(FH,$file) || die " can't open a file"; [...] For the die statement, use this instead: die " can't open this file: $file reason: $!";

interpolation problems (was: Re: help in regular expression)

2006-06-01 Thread Dr.Ruud
Irfan J Sayed schreef: > #!/usr/local/bin/perl > > use warnings; > use strict; Good! > my $file = "c:\backup.pl"; Use my $file = 'c:\backup.pl'; or rather my $file = 'c:/backup.pl'; > open(FH,$file) || die " can't open a file"; Make that: open my $fh, '<', $file or die "Err

Re: help in regular expression

2006-06-01 Thread David Romano
Hi Irfan, On 6/1/06, Irfan J Sayed <[EMAIL PROTECTED]> wrote: Hi , I am using following code #!/usr/local/bin/perl # Main program use warnings; use strict; my $file = "c:\backup.pl"; open(FH,$file) || die " can't open a file"; my $pattern = '\w\s\w'; my $input = <>; print "yes got th

Re: help in regular expression

2006-06-01 Thread John W. Krahn
Irfan J Sayed wrote: > Hi , Hello, > I am using following code > > #!/usr/local/bin/perl > > # Main program > > use warnings; > use strict; > > my $file = "c:\backup.pl"; The escape sequence "\b" represents the backspace character. You probably want: my $file = 'c:/backup.pl'; > op

help in regular expression

2006-06-01 Thread Irfan J Sayed
Hi , I am using following code #!/usr/local/bin/perl # Main program use warnings; use strict; my $file = "c:\backup.pl"; open(FH,$file) || die " can't open a file"; my $pattern = '\w\s\w'; my $input = <>; print "yes got the match " if $input =~ /$pattern/; but i am getting followin