Re: Pattern Matching problem!
- From: "it_says_BALLS_on_your forehead" <simon.chao@xxxxxxx>
- Date: 14 Nov 2005 16:46:34 -0800
Gunnar Hjalmarsson wrote:
> it_says_BALLS_on_your forehead wrote:
> > Gunnar Hjalmarsson wrote:
> >>it_says_BALLS_on_your forehead wrote:
> >>>Francis Sylvester wrote:
> >>>>
> >>>>while ($token = $parser->get_tag("a")) {
> >>>> if ($token->[1]->{"href"} =~ /$mymatch/) {
> >>>
> >>>try:
> >>>if ( $token->[1]{href} =~ /$mymatch/o ) {
> >>
> >>I fail to see why that would make a difference. Could you please explain
> >>why you think it would?
> >
> > I looked up HTML::TokeParse in CPAN.
>
> That's a good start, I suppose. :)
>
> > The first Example displayed illustrated that the way to get the href
> > was:
> >
> > my $url = $token->[1]{href} || "-";
> >
> > ...i noticed that the OP did not use the same syntax. I didn't know if
> > this was causing his problem.
>
> The reason why I asked is that I thought that
>
> $token->[1]->{"href"}
>
> is always the same as
>
> $token->[1]{href}
>
> following Perl's syntax for references and data structures.
ahh, i think you're right. pg. 254 Programming Perl 3rd ed.
"The arrow is optional between brackets or braces, or between a closing
bracket or brace and a parenthesis for an indirect function call."
.
- References:
- Re: Pattern Matching problem!
- From: it_says_BALLS_on_your forehead
- Re: Pattern Matching problem!
- From: Gunnar Hjalmarsson
- Re: Pattern Matching problem!
- From: it_says_BALLS_on_your forehead
- Re: Pattern Matching problem!
- From: Gunnar Hjalmarsson
- Re: Pattern Matching problem!
- Prev by Date: Re: Pattern Matching problem!
- Next by Date: Re: wow ***! I ran into troubles with threads
- Previous by thread: Re: Pattern Matching problem!
- Next by thread: Re: Pattern Matching problem!
- Index(es):