CSS Minifier Perl Example

Check the example on how to use
Perl
to minify a CSS hardcoded string and output to stdout:
use LWP::UserAgent;

my $ua = LWP::UserAgent->new( 'send_te' => '0' );
my $r  = HTTP::Request->new(
    'POST' => 'https://www.toptal.com/developers/cssminifier/api/raw',
    [
        'Accept'         => '*/*',
        'User-Agent'     => 'curl/7.55.1',
        'Content-Type'   => 'application/x-www-form-urlencoded'
    ],
    "input=p { color : red; }"
);
my $minified = $ua->request( $r, )->decoded_content();

print $minified;
Save the code to a file named
minify.pl
and run the following command:
perl minify.pl

Output:

p{color:red}