[17560] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 4980 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Nov 28 14:15:44 2000

Date: Tue, 28 Nov 2000 11:15:28 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <975438927-v9-i4980@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Tue, 28 Nov 2000     Volume: 9 Number: 4980

Today's topics:
    Re: Spell Checker?? <RichParker@fssi-ca.com>
    Re: Spell Checker?? gls@byu.edu
    Re: Spell Checker?? <mischief@velma.motion.net>
    Re: splitting a string into an array and preserving the <bernie@fantasyfarm.com>
    Re: splitting a string into an array and preserving the (Tom Christiansen)
    Re: Taint mode question (Flint Slacker)
    Re: Taint mode question nobull@mail.com
        To learn perl <ekk@ekkinc.com>
    Re: To learn perl <dave@dave.org.uk>
    Re: To learn perl (Chris Fedde)
    Re: To learn perl (Abigail)
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Tue, 28 Nov 2000 15:41:38 GMT
From: Rich Parker <RichParker@fssi-ca.com>
Subject: Re: Spell Checker??
Message-Id: <3A23D315.4D8E019F@fssi-ca.com>

Thanks,
That's what I was thinking also. Would there be an easier way, like say, firing
up something on the client side with something like JS or VBs as a possibility??
Any other suggestions??

Thanks again...

W K wrote:

> >I have a request from one of my users for a SPELL CHECKER for info from
> >a TEXTAREA from a FORM. I am using Perl on a WinNT 4.0 server and I was
> >wondering if anyone has pulled this off before? If so, please include a
> >link so I can 'Take a look' to see how it works.
> >
> >Thanks, I maybe dreaming on this one...
>
> even if there was a perl module that did spell checks...
> I bet the user expects that you can make it work like the spell checker on
> WORD.
> Remember that if it is on the server side in Perl each suggestion and
> correction would need to go across the internet - would they wait 10 seconds
> for suggestions? and 10 seconds to see the correction?
> Another thing - you'd need to do a lot of work maintaining the session -
> would the user expect to see the same page again with the corrected text in
> the TEXTAREA.
>
> I would suggest that even if there is a Perl answer to this it becomes
> rather impractical when its over the internet.

--
Rich Parker
Web Sites:
   Business: http://www.fssi-ca.com
   Personal: http://southcoastdivers.com
E-mail:
   Business: mailto:RichParker@fssi-ca.com
   Personal: mailto:Rich@southcoastdivers.com




------------------------------

Date: 28 Nov 2000 09:38:49 -0700
From: gls@byu.edu
Subject: Re: Spell Checker??
Message-Id: <u7l5o59wm.fsf@SNOW.i-did-not-set--mail-host-address--so-shoot-me>

Rich Parker <RichParker@fssi-ca.com> writes:

> Hello,
> I have a request from one of my users for a SPELL CHECKER for info from
> a TEXTAREA from a FORM. I am using Perl on a WinNT 4.0 server and I was
> wondering if anyone has pulled this off before? If so, please include a
> link so I can 'Take a look' to see how it works.

http://language.perl.com/ppt/src/spell/index.html

Hope this helps, (It doesn't have any web stuff, but 2 different
implementations of a spell checker in Perl to look at)

--
---------------------------------------------------------------------
 Dr. Gregory L. Snow         |  Inertia makes the world go round,
     (Greg)                  |   Love makes the trip worth taking.
   gls@byu.edu               |
---------------------------------------------------------------------


------------------------------

Date: Tue, 28 Nov 2000 16:51:14 -0000
From: Chris Stith <mischief@velma.motion.net>
Subject: Re: Spell Checker??
Message-Id: <t27ok2t740tt4f@corp.supernews.com>

Rich Parker <RichParker@fssi-ca.com> wrote:
> W K wrote:

>> > I have a request from one of my users for a SPELL CHECKER
>> > for info from a TEXTAREA from a FORM. I am using Perl on
>> > a WinNT 4.0 server and I was wondering if anyone has
>> > pulled this off before? If so, please include a link
>> > so I can 'Take a look' to see how it works.

>> >Thanks, I maybe dreaming on this one...

[snipped stuff about making a spellchecker that works like Word]

[snipped stuff about returning a page with corrected
 spelling in the TEXT and TEXTAREA fields ]

> That's what I was thinking also. Would there be an
> easier way, like say, firing  up something on the
> client side with something like JS or VBs as a
> possibility??

THat's one possibility, but offtopic here. ;)

> Any other suggestions??

You could take all the input and check spelling
on the whole thing, then return a page with the
misspelled words to the side or above/below the
field in which it is mispelled.

A word list could be had from any of your friends
that runs Linux, with one wrod per line - just need
to adjust line endings - all in plaintext. This file,
or one like it, is pre-sorted, so a binary search of
the file would be a nice efficient way to find words.

Some of the free webmail sites I believe have spell
checking, and Webster's Dictionary Online of course
checks spelling, although I doubt you can get the
actual programs from those sources.

I might throw something together that does spell
checking later in the week, actually, as mispelled
form input is a pain and this thread has been an
inspiraton. I'm sure someone else could do better
than I, but I'll  release my stuff GPL / Artistic
if I get around to doing it. This would be a good
request for c.l.p.modules I think, even though I'm
usually slower to reccommend a pre-built module
than most people. It's not the most exciting coding
task, but it would see a lot of use.

Chris

--
Christopher E. Stith -- mischief@velma.motion.net
"Carpe Noctum"       -- mischief@motion.net
                     -- mischief@pikenet.net
                     -- mischief@bornnaked.com
                     


------------------------------

Date: Tue, 28 Nov 2000 11:28:15 -0500
From: Bernie Cosell <bernie@fantasyfarm.com>
Subject: Re: splitting a string into an array and preserving the "\n"
Message-Id: <57n72tgljp2frhteh49j7hk2qvdft79u6a@news.supernews.net>

tchrist@perl.com (Tom Christiansen) wrote:

} In article <keh42tcv2qkk04l0qgo1tjbi517i02emu1@4ax.com>,
} Bart Lateur  <bart.lateur@skynet.be> wrote:
} >Unfortunately, perldelta for 5.005 is no longer online (not on CPAN, not
} >on www.perl.com). 
} 
} Wrong.
} 
} First, "online" hardly means "on CPAN or www.perl.com".   Rather,
} "online" simply means "on the computer".    The only way it isn't
} online is if you turn your computer off.

Foo...  This must be some definition from "Tom's private dictionary", since
I doubt that much of anyone else uses "online" with this meaning...   In
your world, what, then, does "offline" mean [as in IE having a checkbox for
"Delete all offline content", or Agent having separate settings for online
mode versus offline mode or ...]  If you're determined to be unhelpful, at
least don't be foolishly (and incorrectly) arrogant...

}     % man perl
}     ...
}        For ease of access, the Perl manual has been split up into
}        several sections:
} 
}            perl                Perl overview (this section)
}            perldelta           Perl changes since previous version
}  ===>      perl5005delta       Perl changes in version 5.005

Sorry, but 'man perl' on my system just says:

>>>       For ease of access, the Perl manual has been split up into
>>>        a number of sections:
>>> 
>>>            perl        Perl overview (this section)
>>>            perldelta   Perl changes since previous version
>>>            perlfaq     Perl frequently asked questions

You know, I'm sure, it is considered poor netiquette to jump into the
middle of a thread without reading the previous posts.  This subthread
started because I asked about what "(?<=" meant, since it didn't seem to
work on my system, Perl 5.004.  In that context, Bart's reference to
'online' was an attempt to help --- which I appreciated! --- I'm not sure
what to make of your comment but it certainly wasn't helpful... 

  /Bernie\
-- 
Bernie Cosell                     Fantasy Farm Fibers
bernie@fantasyfarm.com            Pearisburg, VA
    -->  Too many people, too few sheep  <--          


------------------------------

Date: 28 Nov 2000 09:53:02 -0700
From: tchrist@perl.com (Tom Christiansen)
Subject: Re: splitting a string into an array and preserving the "\n"
Message-Id: <3a23e2ee@cs.colorado.edu>

In article <57n72tgljp2frhteh49j7hk2qvdft79u6a@news.supernews.net>,
Bernie Cosell  <bernie@fantasyfarm.com> wrote:
>Foo...  This must be some definition from "Tom's private dictionary", since
>I doubt that much of anyone else uses "online" with this meaning...   

Scriptie kiddies can makie their own wordies and stealie the goodie
ones thatie we've always usied, but I categorically reject the
notion that "online" is limited to meaning "on the Comprehensive
Perl Archive Network".  That's stupid.

"Online documentation" is documentation that is available via
computer; that is, in electronic form ("softcopy").

"Offline documentation" is documentation that is *not* available
via the computer; that is, in physical form ("hardcopy").

It doesn't have to be on CPAN to be online.  Is it on your
computer?  That is the question.

On the various perldelta pages, the names have been shifted
to assuage the screaming DOS kiddies' primitive broken excuse 
for an operating system.  But never was an old delta deleted.
Its name may simply have varied.  Thus, if you are on 5.5, then 
the 5.5 delta page is just "perldelta", as that's the current one.
But on 5.6, it changed.

--tom


------------------------------

Date: Tue, 28 Nov 2000 15:50:28 GMT
From: flint@flintslacker.com (Flint Slacker)
Subject: Re: Taint mode question
Message-Id: <3a26d137.68770254@news.tcn.net>


Globbing is very slow, at least on the version of perl I'm using.
(5.005_03)  Like Mark-Jason pointed out, it uses /bin/csh which
increases load and slow like a streetcar...... however ,it useful at
times.

This is a program I wrote awhile back, it went something like this:
while ( 1.. 200 ) {
	# goto a directory and push some info. onto an array
} 
took around 24 secs to complete, it was a bit more complicated :)

while ( 1 .. 200 ) { 
	# now the opendir way
}
took around 4 secs.....  :)

# Each second was separated by Mississippi

Flint

On Mon, 27 Nov 2000 10:52:21 -0800, Gordon Vrdoljak
<vrdoljak@uclink.berkeley.edu> wrote:

>Hello,
>I am writing a cgi script in perl that takes in information from a form on a web
>page (name, date, time, etc) and then reads in a schedule from another file as a
>hash.  It checks for open times, and signs up people for using our microscope.  
>
>I have been told to run it in taint mode (-T option), but perl complains with
>the following error:
>
>Insecure dependency in glob while running with -T switch at
>/home/httpd/cgi-bin/sched1.cgi line 71. 
>
>I tried reading the section on Taint mode and communicating with strangers in
>the perl books from O'reilly, but I think I need more basic information.  Can
>someone give me some advice?
>
>Here are some sections of the code where I pull in information from outside the
>program (an html form, a text file for encrypted passwords, read in weekly
>schedule file names, and a text file with the actual week's schedule).  Do I
>need to check each variable somehow, or is there a way of telling Perl that the
>files are safe?
>Thank you for any advice.
>Gordon.
>
>(line numbers are for reference).
>      9 $firstname = param("firstname");
>     10 $lastname = param("lastname");
>     11 $emailadd = param("emailadd");
>     12 $password = param("password");
>     13 $month = param("month");
>     14 $date = param("date");
>     15 $year = param("year");
>     16 $starttime = param("starttime");
>     17 $duration = param("duration");    
>
>     21 open (PWD, 'pwd');
>     22         @lines = <PWD>;
>     23         close (PWD);
>     24         foreach $line (@lines) {
>     25         chop $line;
>     26         }        
>     40 open IN, "format.txt" or die " Cannot open format.txt :$!\n";
>     41 my $match = 0;
>     42 while (<IN>)
>     43         {
>     44         my ($first, $last,$phone,$email,$address,$labphone,$super)
>     45                 = split (/,/,$_);
>     46         if ($last =~ /$lastname/i)
>     47                 {$match = 1;}
>     48         }                       
>     71 @schedfiles = <SCHED*>;
>     72
>     73 #now remove the SCHED header and split it up into day month year array
>     74 foreach $i (@schedfiles) {
>     75         $i =~ s/SCHED-//;
>     76         @tempdate = split(/-/, $i);
>     77 # convert the Month day - years into epoch seconds (I use 5 sec 5min 5
>hours
>     78 # as arbitrary numbers so timelocal won't gripe
>     79         $i = timelocal(5, 5, 5, $tempdate[1], $tempdate[0]-1,
>     80                  $tempdate[2]-1900);
>     81         }                            
>
>    132 open(SCHEDULE, "$file") || die "Could not create open scedule.";
>    133
>    134 while (my $line = <SCHEDULE>) { # line refers to each line from the
>schedule
>    135     (my $time, my $user) = split(":", $line); # line is parsed by time
>and user
>    136     $sched{$time} = $user;
>    137     }           



------------------------------

Date: 28 Nov 2000 18:15:15 +0000
From: nobull@mail.com
Subject: Re: Taint mode question
Message-Id: <u9g0kcote4.fsf@wcl-l.bham.ac.uk>

Gordon Vrdoljak <vrdoljak@uclink.berkeley.edu> writes:

> Insecure dependency in open while running with -T switch at

> 389 open(SCHEDOUT, ">$file") || die "Could not create open schedule.";

So $file is tainted, where is the value in $file comming from?

-- 
     \\   ( )
  .  _\\__[oo
 .__/  \\ /\@
 .  l___\\
  # ll  l\\
 ###LL  LL\\


------------------------------

Date: Tue, 28 Nov 2000 12:03:09 -0500
From: ekk <ekk@ekkinc.com>
Subject: To learn perl
Message-Id: <3A23E54D.B22D8486@ekkinc.com>

Hello,
I just read Paul Barry's review of 'Programming Perl, 3rd Ed.' in Linux
Journal, and he says '"The Camel" is the second Perl book (you) should
buy'.  So, what would be a good first Perl book to buy for someone with
a background in C?
Thanks



------------------------------

Date: Tue, 28 Nov 2000 17:30:07 -0000
From: "Dave Cross" <dave@dave.org.uk>
Subject: Re: To learn perl
Message-Id: <900q6e$le3$1@taliesin.netcom.net.uk>

ekk <ekk@ekkinc.com> wrote in message news:3A23E54D.B22D8486@ekkinc.com...
> Hello,
> I just read Paul Barry's review of 'Programming Perl, 3rd Ed.' in Linux
> Journal, and he says '"The Camel" is the second Perl book (you) should
> buy'.  So, what would be a good first Perl book to buy for someone with
> a background in C?

Try "Learning Perl" or "Perl: The Programmers Companion".

hth,

Dave...





------------------------------

Date: Tue, 28 Nov 2000 17:33:14 GMT
From: cfedde@fedde.littleton.co.us (Chris Fedde)
Subject: Re: To learn perl
Message-Id: <u%RU5.142$QX6.186754048@news.frii.net>

In article <3A23E54D.B22D8486@ekkinc.com>, ekk  <ekk@ekkinc.com> wrote:
>Hello,
>I just read Paul Barry's review of 'Programming Perl, 3rd Ed.' in Linux
>Journal, and he says '"The Camel" is the second Perl book (you) should
>buy'.  So, what would be a good first Perl book to buy for someone with
>a background in C?
>Thanks
>

If you have a C/Unix background then it should be the first perl book you buy.
Look in the perlfaq2 manual page for more info.

chris
-- 
    This space intentionally left blank


------------------------------

Date: 28 Nov 2000 18:13:22 GMT
From: abigail@foad.org (Abigail)
Subject: Re: To learn perl
Message-Id: <slrn927te2.mnq.abigail@tsathoggua.rlyeh.net>

On Tue, 28 Nov 2000 12:03:09 -0500, ekk (ekk@ekkinc.com) wrote in comp.lang.perl.misc <URL: news:<3A23E54D.B22D8486@ekkinc.com>>:
++ Hello,
++ I just read Paul Barry's review of 'Programming Perl, 3rd Ed.' in Linux
++ Journal, and he says '"The Camel" is the second Perl book (you) should
++ buy'.  So, what would be a good first Perl book to buy for someone with
++ a background in C?


I'd go for 'Perl: The Programmers Compagnion', followed by 
'The Perl Cookbook' and 'Advanced Programming in the UNIX Environment' [1],
but with a C background, you should be familiar with the latter.

[1]  Indeed, it doesn't have any Perl code in it, just C code and
     more C code. But, by and large, Perl is just a layer on top
     of C and Unix, even on non-Unix systems. And the layer is
     sometimes very thin. Advanced Programming in the UNIX
     Environment learns you why a lot of the things in Perl are
     what they are; something which isn't emphasized enough in
     most Perl books.


Abigail


------------------------------

Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 16 Sep 99)
Message-Id: <null>


Administrivia:

The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc.  For subscription or unsubscription requests, send
the single line:

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.

For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V9 Issue 4980
**************************************


home help back first fref pref prev next nref lref last post