Use Mojo::DOM
Sample:
#!/usr/bin/perl
use strict;
use warnings;
use Mojo::DOM;
my $HTML = <<"EOF";
<HTML>
<head>
<style type='text/css'>
#yui-dt0-bdrow0 td{background:#CFF;}
#yui-dt0-bdrow1 td{background:#CFF;}
#yui-dt0-bdrow2 td{background:#CFF;}
</style>
</head>
</HTML>
EOF
my $dom = Mojo::DOM->new( $HTML );
print $dom->find('style')->text;
Output
chankey@pathak:~/myscripts$ perl mojo.pl
#yui-dt0-bdrow0 td{background:#CFF;}
#yui-dt0-bdrow1 td{background:#CFF;}
#yui-dt0-bdrow2 td{background:#CFF;}
You can now filter out the desired data.
For a 8 minute video tutorial on Mojo::DOM
and Mojo::UserAgent
check out Mojocast Episode 5