grabbing content from tree builder

2007-08-31 Thread Hunter Barrington
so i have the following code: foreach my $node (@tables){ my @rows = $node->look_down(_tag => 'tr'); foreach my $row (@rows){ #grabbing data from each row at this point my @part_cell = $row->splice_content(3, 1); #part number my $cell = $part_cell[0]; next

type comparison in perl

2007-08-31 Thread Hunter Barrington
is there a type() function in perl? i need to be able to test the contents of an array and if (type($value)=='string' or type($value)=='int') {print "i win";} thats basically what i need to be able to do. if it helps i know ahead of time that the two type in the array will always be a hashref o

finding methods and attributes in a name space

2007-08-31 Thread Hunter Barrington
how would i find out what attributes and methods are in a name space? for example i have an object in my code and im not sure what type it is, what attributes are associated with it, what methods etc etc how can i find out. in python there was dir() and type() which was a big help. anything sim

Re: dereferencing hashes

2007-08-29 Thread Hunter Barrington
Dixon wrote: Hunter Barrington wrote: ok so im using HTML::TreeBuilder to pull some data off of a website and parse it. If I'm understanding this right each tag of the tree is put inside the tree as a hash reference with hash references inside of it for each tag thats below it.

dereferencing hashes

2007-08-29 Thread Hunter Barrington
ok so im using HTML::TreeBuilder to pull some data off of a website and parse it. If I'm understanding this right each tag of the tree is put inside the tree as a hash reference with hash references inside of it for each tag thats below it. Like: = $root_hash_ref->$body_hash_ref->$p_hash_ref