CSS::LESSp(3pm)
π CSS::LESSp π
okay bestie, gather round, because this is CSS::LESSp from the 3pm section of the User Contributed Perl Documentation β aka LESS for perl, aka the thing that parses your .less files and hands you back valid css. no cap. (and if you're like "what even is a less file", the vibes live at lesscss.org π¦)
β¨ NAME β¨
CSS::LESSp β LESS for perl. Parse .less files and returns valid css (lesscss.org for more info about less files) π
πΈ SYNOPSIS πΈ
like, the whole thing in one go:
use CSS::LESSp;
my $buffer;
open(IN, "file.less");
for ( <IN> ) { $buffer .= $_ };
close(IN);
my @css = CSS::LESSp->parse($buffer);
print join("", @css);
or honestly you could simply use the lessp.pl tool in the package, because why do more work than you have to π«Ά
$ lessp.pl css.less > css.css
π DESCRIPTION π
this module is designed to parse and compile .less files in to .css files. that's the whole personality. it's giving compiler energy.
for the documentation and syntax of less files, please visit lesscss.org β go read, i'll wait π
π DIFFERENCE WITH THE ORIGINAL LESS FOR RUBY π
so what are the benefits of LESS for perl, you ask? lemme put you onβ¦
it's extremely fast π₯ like, look at this:
# time ./lessp.pl big.less > big.css
real 0m2.198s
user 0m2.174s
sys 0m0.020s
# time lessc big.less big.css
real 0m18.805s
user 0m18.437s
sys 0m0.184s
that's not a comparison, that's a slaughter. ate and left no crumbs fr fr π
β METHODS β
parseβ the main parse method, returns array of the css file β¨copyFunctioncopyTodumpgetSelectorgetValuegetVariableinsertChildinsertFunctioninsertRuleinsertVariableisFunctionnewprocess
ngl the original page just vibes the last chunk of these out as a run-on line of=head3markers mashed together instead of actual headings βdump =head3 getSelector =head3 getValue =head3 getVariable =head3 insertChild =head3 insertFunction =head3 insertRule =head3 insertVariable =head3 isFunction =head3 new =head3 processβ so i've lovingly un-mangled them here and given each one its own little spotlight. the names are exactly the same, promise π
π BUGS π
a ) You can not import other less files ...
you can't do this, bestie, it will simply not work:
@import url('/other.less')
it might be added in future versions π
b ) You can not use hsl as a color
you can't do this either, sorry:
color: hsl(125,125,125);
all other bugs should be reported via <http://rt.cpan.org/Public/Dist/Display.html?Name=CSS-LESSp> or bug-CSS-LESSp@rt.cpan.org. don't be shy, report the bugs π«Ά
π AUTHOR π
Ivan Drinchev <drinchev@gmail.com>
π CONTRIBUTORS π
people who've helped with this project :
- Michael Schout <mschout@gkg.net>
π§ COPYRIGHT AND LICENSE π§
Copyright (c) 2010.
this library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. iconic license behaviour, honestly π
aww and that's a wrap π this whole page was served up as perl v5.40.1, dated 2025-08-02, under the CSS::LESSp(3pm) banner β so if you're reading this years later, bestie, the vibes are preserved but the version is historic. slay πβ¨
π¦ where this page comes from
- ubuntu resolute: libcss-lessp-perl 0.86-4 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libcss-lessp-perl 0.86-4 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms