The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.


  use Plack::App::File;
  use Plack::Builder;

  builder {
      mount "/stylesheets" => builder {
          enable "File::Less";
          Plack::App::File->new(root => "./stylesheets");

  # Or with Middleware::Static
  enable "File::Less";
  enable "Static", path => qr/\.css$/, root => "./static";


Plack::Middleware::File::Less is middleware that compiles Less templates into CSS stylesheet..

When a request comes in for .css file, this middleware changes the internal path to .less in the same directory. If the LESS template is found, a new CSS stylesheet is built on memory and served to the browsers. Otherwise, it falls back to the original .css file in the directory.


If you have the lessc executable available in your PATH, this module automatically uses the command to convert LESS into CSS. If the command is not available and you have CSS::LESSp perl module available, it will be used. Otherwise you'll get an exception during the initialization of this middleware component.


Plack::App::File CSS::LESSp


  • Naoya Ito <lt><gt>

  • Franck Cuny <lt><gt>

  • Tatsuhiko Miyagawa <lt><gt>


This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.