in reply to how can I get localtime without mutating any variables
TIMTOWTDI but a slice is simple and effective.
#!/usr/bin/env perl use strict; use warnings; my ($min, $hr, $day, $mon, $yr) = (localtime())[1..5]; print "$min $hr $day $mon $yr\n";
🦛
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: how can I get localtime without mutating any variables
by thirtySeven (Acolyte) on Jan 06, 2021 at 20:34 UTC | |
by toolic (Bishop) on Jan 06, 2021 at 21:20 UTC |