[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

RE: [MacPerl] Still Not Quoting body from a WWWboard post



I've done this sort of thing before. It's much easier in Resorcerer, but not
everybody has that (and I haven't used Resedit in years, so I don't remember
how unfriendly it is, which is probably a good thing).

#
#
# Start by getting the body of your message into a variable
#
# The code below is just an example that uses LWP::Simple
# to pull the HTML out of a URL. Almost certainly not what
# you're trying to do, but it's for illustration only.
#

use LWP::Simple
my $body_of_message = get("http://www.cnn.com");

foreach $i (0..length($body_of_message))
{
    my $code = substr($body_of_message,$i,1);
    print $i,"\t\t",$code,"\t\t",ord($code),"\nPress <ENTER>";
    my $yorn = <STDIN>;
}

Then when you run this it should spit out each character in the string along
with its numeric code (probably ASCII), you hit return and it gives you the
next one. Sooner or later you will run into the characters you're looking
for, and you'll know what to put in there.

It's not elegant, it's just a quick and dirty hack. But it ought to work.
(Yes, I know you'll go over the limit of the size of $body_of_message by
using substr this way, but hey, you'll get bored with this long before you
get to that point.)

-- Creede

> -----Original Message-----
> From: Linda Hardesty [mailto:linda@draco.com]
> Sent: Friday, July 30, 1999 12:51 PM
> To: macperl@macperl.org
> Subject: [MacPerl] Still Not Quoting body from a WWWboard post
> 
> 
> I've tried WRAP=PHYSICAL and WRAP="HARD" and all combinations of 
> putting quotes or not around the values, and I still don't get any 
> line feed characters. I looked for \cM, \n, and \r, and found none of 
> them. When I tried   $line =~ s/\015\012|\012|\015/\n/g; it seemed to 
> turn my message into a large integer.
> 
> I'm still looking for a quick fix - it will take really learning Perl 
> before I can figure this out on my own. Thanks in advance for any 
> help.
> 
> ===== Want to unsubscribe from this list?
> ===== Send mail with body "unsubscribe" to macperl-request@macperl.org
> 

===== Want to unsubscribe from this list?
===== Send mail with body "unsubscribe" to macperl-request@macperl.org