NAME
Slug - XS URL slug generator with custom ops
SYNOPSIS
use Slug qw(slug slug_ascii slug_custom);
my $s = slug("Hello World!"); # "hello-world"
my $u = slug("Привет мир", "_"); # "privet-mir"
my $a = slug_ascii("naive cafe"); # "naive cafe"
my $c = slug_custom("My Title", { # "my-title"
separator => '-',
max_length => 50,
lowercase => 1,
});
DESCRIPTION
Slug is a fast XS URL slug generator. It converts arbitrary UTF-8 strings into URL-safe, SEO-friendly slugs. Uses custom ops on Perl 5.14+ for zero-overhead dispatch.
FUNCTIONS
slug($string)
slug($string, $separator)
Generate a URL slug from the input string. Transliterates Unicode to ASCII, lowercases, and replaces non-alphanumeric characters with the separator (default: -).
slug_ascii($string)
Transliterate Unicode characters to their ASCII equivalents without slugifying. Preserves spaces, punctuation, and case.
slug_custom($string, \%options)
Generate a slug with full control over the process.
include_dir()
Returns the path to the installed C header files.
AUTHOR
lnation <email@lnation.org>
LICENSE
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.