LOCAL TIME (AEST)
Loading...
ANDREA'S UPTIME
Loading...
Runtime: Loading... seconds
NICKY'S UPTIME
Loading...
Runtime: Loading... seconds
Powered by Debian ||
Perl
||
Mojolicious
||
Apache
||
MariaDB
Made possible by: these thingies
-
<%
# Custom Sorter: Files First, then Directories (Alphabetical)
my $files_first_sorter = sub {
my @a_parts = split '/', $a;
my @b_parts = split '/', $b;
# Determine the depth to compare
my $limit = @a_parts < @b_parts ? $#a_parts : $#b_parts;
for my $i (0 .. $limit) {
# If the path segments differ at this depth
if ($a_parts[$i] ne $b_parts[$i]) {
my $a_is_file = ($i == $#a_parts);
my $b_is_file = ($i == $#b_parts);
# Priority Rule: Files come before Directories
return -1 if $a_is_file && !$b_is_file;
return 1 if !$a_is_file && $b_is_file;
# Otherwise, standard case-insensitive sort
return fc($a_parts[$i]) cmp fc($b_parts[$i]);
}
}
return 0;
};
my @files = sort $files_first_sorter grep { $_ ne 'MyApp.pm' } @{listFiles()};
my @dirs;
for my $file (@files) {
my @parts = split '/', $file;
my $filename = pop @parts;
my $depth = 0;
while (@dirs && $depth < @dirs && defined $parts[$depth] && $dirs[$depth] eq $parts[$depth]) {
$depth++;
}
while (@dirs > $depth) {
pop @dirs;
%>
-
<% } %>
- <%= $filename %> <% } %> <% while (@dirs) { pop @dirs; %>