[mythtv-users] Immir tv_grab_au 1.64
Michael Smith
myth at immir.com
Tue Jun 20 08:54:41 UTC 2006
Hey guys,
Life is getting complicated now. Obfuscation functions now change their
name randomly. Keep an eye on script... Not sure why I don't get the
uninitialsed value errors (regarding s///) -- see below.
Michael.
p.s. I get no errors from this mini-script --- if you do, check your
version of perl is recent enough?
use strict;
use warnings;
use Data::Dumper;
$a = { 'category' => [ [ 'Animation', 'en' ] ], 'channel' =>
'act-abc2', 'desc' => [ [ 'Pickle has trouble grasping the idea of
Sophie having a pretend friend.', 'en' ] ], 'guidedate' =>
'20060621', 'row' => 68, 'start' => '2006062111:38:00', 'stop' => '
2006062111:50:00', 'sub-title' => [ [ "Pretend \x00 \xff Friend ",
'en' ] ], 'title' => [ [ 'ToddWorld ', 'en' ] ] };
cleanup($a);
print Data::Dumper->Dump([$a],qw(a));
sub cleanup {
my $x = shift;
if (ref $x eq "REF") { cleanup($_) }
elsif (ref $x eq "HASH") { cleanup(\$_) for values %$x }
elsif (ref $x eq "ARRAY") { cleanup(\$_) for @$x }
else {
$$x =~ s/ / /g;
$$x =~ s/&/&/g;
$$x =~ s/&#(\d+);/chr($1)/eg;
$$x =~ s/(^\s+|\s+$)//g;
$$x =~ s/[^\x20-\x7f]/ /g;
}
}
If this fails, check your version... mine is:
[michael at htpc ~]$ perl -v
This is perl, v5.8.6 built for i386-linux-thread-multi
More information about the mythtv-users
mailing list