in reply to printing element of anonymous array
Using the core Perl module Time::Piece (which overrides the built-in functions localtime and gmtime, providing functions that return objects):
use Time::Piece;
print gmtime->wday;
The way forward always starts with a minimal test.
In Section
Seekers of Perl Wisdom