The Perl and Raku Conference 2025: Greenville, South Carolina - June 27-29 Learn more

#!/usr/bin/perl -w
use strict;
BEGIN { use_ok( 'CSS::Inliner' ); }
my $inliner = new CSS::Inliner();
my $input = <<IN;
<html>
<head>
<style type="text/css">
h4 {
background-image: url(http://www.example.com/test.jpg);
}</style>
</head>
<body>
<h4>Test header with background</h4>
</body>
</html>
IN
$inliner->read({html => $input});
my $actual = $inliner->inlinify();
ok ($actual =~ m{url\(http://www.example.com/test.jpg\)}, 'url in style');
done_testing;