Search
Results
Perl Time Snippet
[https://notes.pinboard.in/u:mark.page/2605ce239a1ab7cec272] - - public:mepage
my @now = localtime; $now[5] += 1900; $now[4] += 1; for my $l (0 .. (scalar(@now) - 1)) { $now[$l] = sprintf("%02d",$now[$l]); }
Perl Key Sort w/Map
[https://notes.pinboard.in/u:mark.page/012a6f9640ecbe1d26b4] - - public:mepage
my @sorted = map substr($_, 4) => sort map pack('C4' => /(\d+)\.(\d+)\.(\d+)\.(\d+)/) . $_ => keys $output;
Perl Date Array
[https://notes.pinboard.in/u:mark.page/4225413c26dfc6b40de3] - - public:mepage
my @d = localtime; $d[5] += 1900; $d[4] += 1; for my $l (0 .. (scalar(@d) - 1)) { $d[$l] = sprintf("%02d",$d[$l]); }
Loading data from file
[https://notes.pinboard.in/u:mark.page/6d0a244666446b3934b1] - - public:mepage
for my $s (0 .. (scalar(@source_list) - 1)) { print " - Loading: $source_list[$s]\n"; push(@sources,do "$srpz_home/sources/$source_list[$s]\.pl"); }