in reply to Re^3: Slices from array reference
in thread Slices from array reference

Since groups of 'magic' constants are sometimes used (e.g., for taking/assigning equivalent slices from/to different arrays), here's my trick for keeping everything together. Grouping may be discussed in Neil Bower's interesting blog post, but I've not read through it all yet to find out.

c:\@Work\Perl\monks>perl -wMstrict -le "use constant DATE_MAGIC => (0, 1, 2, 7, 5); ;; my $dt = [ localtime ]; my ($sec, $min, $hr, $yday, $yr) = @{ $dt }[ DATE_MAGIC ]; print qq{yr $yr yday $yday hr $hr min $min sec $sec}; " yr 114 yday 83 hr 12 min 22 sec 13