my @prefix; while (<>) { next if /^#/; # skip comments, apparently if (/^\s*(\S+)\s*\{\s*$/) { push @prefix, $1; } elsif (/^\s*\}\s*$/) { pop @prefix; # no error checking } elsif (/^\s*(.*)/) { print "@prefix " if @prefix; print $1, "\n"; } else { die "internal error on $_"; } }
-- Randal L. Schwartz, Perl hacker
In reply to Re: Follow up to:
by merlyn
in thread Follow up to:
by Limo
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |