Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Re: Using HTML::Parser extract text from tables

by zzspectrez (Hermit)
on Jan 17, 2001 at 06:28 UTC ( [id://52439]=note: print w/replies, xml ) Need Help??


in reply to Re: Using HTML::Parser extract text from tables
in thread Using HTML::Parser extract text from tables

You might want to add an initialization of @save as well, to avoid trying to der eference an undefined value when you leave a toplevel table. Something like this perhaps:

Actually since @save is only being accesed on an end tag that means a begin tag was involved which pushed a value on save. In case of the first table the values 0,0 will pushed on the save and then poped when that table ends. So I dont think I need to wory about dereferncing an undefined value.

I dont think pushing $tablenr will fix the problem, because when the old value is poped it will think on the next table it should $tablenr++ which will ovewrite the previous data. Have to do something else.

  • Comment on Re: Re: Using HTML::Parser extract text from tables

Replies are listed 'Best First'.
Re: Re: Re: Using HTML::Parser extract text from tables
by Anonymous Monk on Jan 17, 2001 at 15:45 UTC
    You are right about that @save and undefined values thing. My brain must have fallen asleep there for a while.

    Pushing tablenr will fix the recursive table though. You still increase $count each time you encounter a table start. You also set $tablenr to $count. Its only on table end that you restore $tablenr, but you do _not_ restore $count. Hence, each table is given a unique, increasing number.

    Have you tried it btw? I haven't. so I'm only speaking theoretically here....

    regards,

    GoldClaw

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://52439]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (2)
As of 2024-04-26 03:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found