Well, after all this, I finally managed to bump into some information in my PERL CD Bookshelf 4.0. Those who have it might try looking in "The PERL Cookbook" Section 20.5.1,
So, FormatText would do the job, I bet. Unfortunately, I've tried searching for it and I can't find the module. After...
Thanks, all. The documentation at CPAN looks the same as the stuff I got with ActiveState's distribution. I think I have some basic gaps in understanding the use of reference/dereference variables. The idea of a "handler" seems to be another module based device that I can find no...
Great! Thank you. That works like a charm. In case anyone missed that, here are the changes to the above code,
use strict;
use HTML::Parser;
my $file = 'index.html';
my $parser = HTML::Parser->new( text_h => [ \&text_handler,"self,dtext"],
start_document_h =>...
OK, I tried that. I just added those two lines to the above code and got,
$VAR1 = bless( {
'_hparser_xs_state' => \25350180,
'_private' => {
'text' => [
'
'...
I originally started applying this module to solve a problem I posed here,
http://www.tek-tips.com/viewthread.cfm?qid=1220558, "HTML to Text with PERL. Is it possible?"
I got some good code and some good advice, but I am having a new problem right away.
Here is the basic code again,
use...
Thank you. Yes, of course. But since I am completely clueless about the rest of "... @{$parser->{_private}->{text}};", I thought there might be some other way of accessing the results as a string native to the module. I should have mentioned the obvious "join" of the array.
As I posted above, I have been able to successful demonstrate this code also offered above using a file:
use strict;
use HTML::Parser;
my $file = 'index.html';
my $parser = HTML::Parser->new( text_h => [ \&text_handler,"self,dtext"],
start_document_h => [\&init...
Well, to be precise, this code is being put to practical purposes. The example is an exercise. But I haven't the slightest idea what you are talking about when you refer to "caching" in the above code. It is enough for my purposes that the code works at all. Thanks again.
Thanks for that solution. It works for me too.
Here is the source of my confusion regarding the delimiters. I misread this. The second delimited group is always interpreted differently than the first and if the /e modifier is used than the second part is interpreted as script irregardless of...
Isn't it true that the use of "{}" brackets mean that the second part of the s{}{} is actually interpreted as PERL code? how does that effect your solution?
I'll try this tomorrow and get back.
I am trying to apply arrays in creating sequences of global Search and Replace Regular Expressions. I have the PERL Bookshelf CD 4.0 and have looked at the discussion in Chapter 7 on using the "qr// operator. But I have yet to apply a successful strategy using the substitution method I...
That's great! But save me a few more minutes and tell me if I could search any other page with the same code. I'm not exactly clear what the "document referrer" is and what is supposed to happen with the highlightGoodleSearchTerms function. I tried it with the default value and nothing happened.
I've come up against this problem several times now. I tried dealing with it with PHP, but it appears my commercial host has disabled classes so that I can't use the DOM class ("disabled_classes -- no value" in my phpinfo()). I need to load an HTML file to search the text and highlight found...
Could have and did before I posted, actually. Thanks, I don't need that kind of advice.
What else is an associative array but a name field and a value so that the string,
?Name1=var1&Name2=vara+varb+varc&Name3=var3 ...
becomes,
SearchArray["Name1"]["var1"]
SearchArray["Name2"]["vara varb...
Well, I see that "window.location.search" will get me my query string like this,
?Name1=var1&Name2=vara+varb+varc&Name3=var3 ...
But am I obliged to parse everything out myself? It seems like there is a natural associative array there. Is there no object that has this already done for me?
OK, right out of my little O'Reilly pocket reference,
Location is an object and refers me also to Link where there looks like there is a bunch of stuff to work with.
Thanks! I'll be back to summarize how I managed.
I need to retrieve the GET (and/or POST) values that are submitted from a form on one page in a Javascript running on the loaded targeted page. Can Javascript access those values? I've a lot experience doing this with PHP, but of course Javascript is client scripting. Do I have to parse out...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.