Click here to get back home

Aspell, perl and piping

 HomeNewsGroups | Search | About
 comp.lang.perl.misc    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
Aspell, perl and piping Bill H 03-26-2008
Posted by Bill H on March 26, 2008, 7:46 pm
Please log in for more thread options
I am hoping someone can give me a few pointers on where to look for
more information on this. I am using Aspell on a linux box to suggest
corrections for mispelled words using a command such as:

aspell -a < checkthis.txt > errors.txt

at the command prompt and this is fine. What I want to do next is
receive the text from an html form and using perl pipe this out to
aspell and get the list of errors back. I could write the text to be
checked to a file and then use somthing like

system("aspell -a < checkthis.txt > errors.txt");

but I would like to avoid if possible having to write the file and
then open and read the errors.txt file. Is there a way to pipe this
information straight from perl and get the results back?

If I am missing something or if I could find this in the perldocs,
please let me know.

Bill H

Posted by Ben Morrow on March 26, 2008, 10:22 pm
Please log in for more thread options

>
> > system("aspell -a < checkthis.txt > errors.txt");
> >
> > but I would like to avoid if possible having to write the file and
> > then open and read the errors.txt file. Is there a way to pipe this
> > information straight from perl and get the results back?
>
> Have a look at IPC::Open2, or IPC::Open3 if you're also interested in
> stderr.

IPC::Run is easier to use, and harder to get wrong.

Ben


Similar ThreadsPosted
Piping from perl to C January 16, 2007, 11:02 am
perl PIPE - need an example of piping in June 9, 2005, 11:59 pm
URGENT --- Aspell Scores January 11, 2005, 12:51 am
Aspell word lists June 30, 2005, 9:44 am
Spell checking an html file with aspell or ispell September 2, 2007, 8:58 am
piping cmd output problem March 22, 2005, 4:45 am
PERL to mean what 'perldoc perl' says is wrong? (was: Re: perl should be improved and perl6) April 14, 2008, 11:37 pm
FAQ 3.0: What is perl.com? Perl Mongers? pm.org? perl.org? cpan.org? October 31, 2004, 12:03 pm
FAQ 3.0 What is perl.com? Perl Mongers? pm.org? perl.org? cpan.org? February 2, 2005, 12:03 pm
FAQ 2.18 What is perl.com? Perl Mongers? pm.org? perl.org? cpan.org? March 28, 2005, 12:03 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap