in reply to Re^4: Parsing HTML into various files
in thread Parsing HTML into various files

I don't know what you were trying to do, but { @table } IS an anonymous hash with an odd number (1) of elements.

Maybe you intended

$hash{$key} = \@table;

Rule One: "Do not act incautiously when confronting a little bald wrinkly smiling man."

Replies are listed 'Best First'.
Re^6: Parsing HTML into various files
by bart (Canon) on Aug 25, 2010 at 18:38 UTC
    I don't know what you were trying to do, but { @table } IS an anonymous hash with an odd number (1) of elements.
    Only if @table contains an odd number of elements. That implies there's something fishy with her HTML.

    The HTML I used as an example consists of a table with 4 columns, where column 1 and 3 are attribute names (to be used as hash keys) and columns 2 and 4 are attribute values (to be used as hash values).

    Maybe you intended
    $hash{$key} = \@table;
    No, if she did that, every hash value would be a reference to the same hash.

    The intention is to turn the current list of name/value pairs into a hash. Something like:

    @table = ( foo => 10, bar => 20 ); $hashref = { @table };