#!/usr/bin/perl use strict; use warnings; use CSS; my $css_data = do{ local $/; <DATA> }; my $css = CSS->new(); $css->read_string( $css_data ); foreach my $style ( @{ $css->{ styles } } ) { foreach my $selector ( @{ $style->{ selectors } } ) { print $selector->{ name } . "\n"; } } __DATA__ .selector_one { margin-left: 1em; } .selector_two, .selector_three { margin-left: 1em; }
In reply to Re: Extracting a list of selectors from a css file
by un-chomp
in thread Extracting a list of selectors from a css file
by wfsp
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |