AztecMonkey has asked for the wisdom of the Perl Monks concerning the following question:

I've installed CSS::SAC on our linux box and am trying to read in a list of selectors from a specific css doc. I've read the pod and frankly don't get it. Here's what I have:
#!/usr/bin/perl -w use CSS::SAC qw(); use CGI qw(:all); use CGI::Carp qw(fatalsToBrowser); my $sac = CSS::SAC->new(); my $cgi = new CGI; # generate a stream of events $sac->parse({ filename => 'foo.css' }); my @items = $sac->parseSelectors(); print $cgi->header(); print $sac; foreach my $item (@items) { print "$item<br>\n"; }
This caused a runaway process on our server and jacked up the error log. So obviously, this isn't correct.

I get the $sac->parse statement, but what I don't get is what is meant in the pod by "sends events to the defined handlers. " What handlers are being referred to? Also, the parseSelectors($stringref) method accepts a string, but what would that be?

Any help would be greatly appreciated.

Replies are listed 'Best First'.
Re: CSS::SAC module
by trs80 (Priest) on Jan 17, 2002 at 09:14 UTC
    Well at first I thought it was just the misuse of the array
    reference that the parseSelectors method would return, but
    after reading the documentation and investigating further
    it seems the useage of the module is not very clear, that is
    how to easily get a useful return of information.

    I recommend writing the author of the module if you haven't
    already, the module is only at .03 after all so they are
    most likely still working out the bugs and documentation and
    examples will hopefully come after the code is more mature.

    Please post your success story here when you have it working.