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

Re: [MacPerl] Searching help



Hi Michael,

IMHO you should reformulate your approach: >>>>>What is it that you want to do

with your HTML document?<<<<<  (Without knowing that, at least _I_ cannot
help.)

My suggestion for an approach:
First one has to know the document (please deliver very short sample data!)
Then you have to tell what has to be done.
Then you have to read your document (open...   <>... ) and have it in one
scalar ($myDocument)  or within one list (@myLines), and than perform some
search-and-do-something-operations on it.
Probably  about 5 to 8 lines of perl code with some regexs should do.

Detlef Lindenthal <detlef@lindenthal.com>






Michael Eggleston wrote:

> I need some help.  Here is the situaltion.  I have joined an entire HTML
> document together to make it searchable using s/// and m// and now I have
> a problem.  Here is the code snippet:
>
> while ($done ne "true") {
>      $done = "true";
>      if ($TheHTML =~ m#(<input.*?>)#i) {
>           $done = "false";
>           $newline = $1;
>           if ($newline =~ m#(hidden|submit|reset)#i) {
>                $TheHTML =~ s/$newline//g;
>           } elsif ($newline =~ m#checkbox#i) {
>                $newline =~ m#(name=".*?")#i;
>                $thename = $1;
>                $thename =~ s/name="//i;
>                chop $thename;
>                if ($data{$thename}) {$TheHTML =~ s/$newline/$yes/g;}
>                     else {$TheHTML =~ s/$newline/$yes/g;}
>           } else {
>                $newline =~ m#(name=".*?")#i;
>                $thename = $1;
>                $thename =~ s/name="//i;
>                chop $thename;
>                $TheHTML =~ s/$newline/$data{$thename}/g;
>           }
>      }
> }
>
> Can you please help??



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