in reply to Re^2: Cleaning up HTML
in thread Cleaning up HTML
It's incomplete. Sorry.
sub _html_tag { my ( $tag, $attr, $attrseq) = @_; my $html; $html = "<$tag"; if ($attrseq and ref($attrseq) eq 'ARRAY') { foreach my $key (@$attrseq) { if (defined $attr->{$key}) { $html .= " $key="._arg_escape($attr->{$key}); } else { $html .= ' '.$key; } } } elsif ($attr and ref($attr)) { foreach my $key (keys %$attr) { if (defined $attr->{$key}) { $html .= " $key="._arg_escape($attr->{$key}); } else { $html .= ' '.$key; } } } $html .= ">"; return $html; } sub _arg_escape { my $arg = shift; return qq{"$arg"} if ($arg !~ /"/); return qq{'$arg'} if ($arg !~ /'/); $arg =~ s/"/&dblquote;/g; return qq{"$arg"}; }
Not sure it's complete like this. I never got around to releasing this as a module. If it's not complete, either download the Jenda.Rex zip from http://jenda.krynicky.cz/#Jenda.Rex, extract the .pm and dissect that (remove all references to Win32::OLE (needed only when the module is wrapped as a COM DLL for use in VB(script)) and Win32::Registry (only used to find out the code page used by the system), remove the whole package JendaRex::CSVParser, ...) or send me a message with your email and I'll send you the module.
Jenda
Enoch was right!
Enjoy the last years of Rome.
|
|---|