This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use 5.10.0; | |
use strict; | |
use Supers::Schema; | |
use Text::CSV; | |
use utf8; | |
use Encode; | |
use Excel::Writer::XLSX; | |
use Data::Types; | |
binmode(STDOUT, ":utf8"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sub extract_subcategories { | |
my ($c, $slug_param, $categories, $facets) = @_; | |
return [] unless @$categories; | |
my ($cref) = ref($c) =~ m/::(\w+)$/; | |
my $level = split '/', $slug_param; | |
my $slg = Supers::Slugify->new; | |
my $subcats = []; | |
my $slug_re = qr/^$slug_param/; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
my $slug = "bebe/mas/cosas/t/tag"; | |
my ($real_slug, $rest) = $slug =~ m|^(.+?)(/[mt]/.*)?$| | |
# con tu ejemplo: | |
my ($real_slug) = $slug =~ /((?!\/[tm]).+)/ |