Re: how would you write a spell checker?

2005-03-19 Thread Robin
On Sunday 20 March 2005 18:52, mark McWilliams wrote: > if($word =~ /^$single_word$/i) > { print $single_word; do other stuff ...} > # prints if $word (dictionary) and $single_word > (document) match not what I want There are probably better ways, but how about: my $flag = 0; if ($word =~ /^$si

Re: Running a perl program offline

2005-03-19 Thread Octavian Rasnita
Oh, I have forgotten to say something more. I use Apache under Windows 2000 and perl 5.8.4, but I run the script under mod_perl 2. However, I still don't understand how this little program prints a different header when it is ran by mod_perl... I have ran it from the command prompt using telnet

how would you write a spell checker?

2005-03-19 Thread mark McWilliams
Hello I need to write a spell checker. I have tride to check the words in the file to be checked against the words in the dictionary but I havve not been able to make progress. If I use an unless($word =~ /^$single_word$/i) { print $single_word; do other stuff ...} # above prints every wo

RE: Running a perl program offline

2005-03-19 Thread Charles K. Clarkson
Octavian Rasnita wrote: : Hi, : : I have tried the following script: : : use CGI; : my $q = new CGI; : : print "Content-type: text/html\n\nTestare\n"; : $q->redirect("http://localhost/";); That doesn't look right. When I run it, I don't get a redirect. I get a text p

Running a perl program offline

2005-03-19 Thread Octavian Rasnita
Hi, I have tried the following script: use CGI; my $q = new CGI; print "Content-type: text/html\n\nTestare\n"; $q->redirect("http://localhost/";); Well, if I run this program from a web server, it redirects the page to http://localhost/ but if I run it offline, it just prints: Content-type: te

Re: Accessing the class

2005-03-19 Thread Offer Kaye
On Sat, 19 Mar 2005 13:37:17 +0200, Octavian Rasnita wrote: > > And I don't like to use Package::Name directly because I might need to > change its name and then I would need to change that name in many places. > So place the package name in a variable, and use that variable in all places. Then y

Yet Another Perl Conference, North America, 2005 Registration now open

2005-03-19 Thread glim
--> Yet Another Perl Conference, North America, 2005 Registration now open. Conference dates: Monday - Wednesday 27 - 29 June 2005 Location: 89 Chestnut Street http://89chestnut.com/ University of Toronto Toronto, Ontario, Canada

XML Generator DBI

2005-03-19 Thread Mike Lesser
Hi all. I'm messing with XML & MySQL, and I may have run into a newbie snag. I'm using XML::Generator ::DBI with XML::Handler::YAWriter, in the same manner that I've seen in tutorials, the MySQL Cookbook, and other assorted places. $writer = XML::Handler::YAWriter->new (AsString => 1); $query = 'SE

RE: Perl Analyzing Maillog

2005-03-19 Thread Charles K. Clarkson
Nick Chettle wrote: : Charles wrote: : Thanks for the help, but neither of the examples you gave seem to : work. First thing. Stop replying to a post by placing all you comments at the top of the post. It is annoying and requires I do extra work (mainly scrolling

[Fwd: Re: Perl Analyzing Maillog]

2005-03-19 Thread Nick Chettle
Thanks for the help, but neither of the examples you gave seem to work. The first errors with: % ./1 Global symbol "$msgids" requires explicit package name at ./1 line 15. Execution of ./1 aborted due to compilation errors. The second errors with: % ./2 Please enter an e-mail address: [EMAIL PROTEC

Strange problem

2005-03-19 Thread Octavian Rasnita
Hi, I have tried the following script and I saw that if I use: my $sss = &session(); the script seems to work with no problems, and it doesn't print anything (as it should), but if I replace "my" with "our" like: our $sss = &session(); the script gives the warning/error: (in cleanup) Can't co

Accessing the class

2005-03-19 Thread Octavian Rasnita
Hi all, I know how to access a class from inside a subroutine, using "my $self = shift;" then using that $self var, but how can I access the same class from outside of any subroutine of a certain package? I saw that I can put the following line in the package Package::Name, outside of any subrout