Re: talking to Perl for a text-cleanup.
| From: | John Nichel | Date: | Tue, 15 Apr 2003 17:35:30 +0000 |
| Subject: | Re: talking to Perl for a text-cleanup. | ||
| References: | 1 2 3 4 5 6 7 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-143992@lists.php.net to get a copy of this message | ||
Okay, try this.....
$clean_text =
$unformatted_text | perl -MText::Autoformat -e'autoformat'
julien Beauviala wrote:
On (15/04/03 11:26), John Nichel wrote:I understand what you're trying to do. What I was asking is how do you pass the message to the perl if you were actually doing this via command line right now. Do you pass it a file, a string, something else?oh, well, I would do something like mysql -e commandfile | perl -MText::Autoformat -e'autoformat' as that particular text (the email) is within a MySQL db when I access it from a PHP page.julien Beauviala wrote:On (15/04/03 11:03), John Nichel wrote:How do you normally pass it?I don't, that's what I'm after. Basically I want to do the same thing as the following : $somefield = "bla blabla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla "; $cleantext = wordwrap($somefield, 63); echo $cleantext; but usingperl -MText::Autoformat -e'autoformatinstead of wordwrap. I hope it's clearer. j.