Syntactic Confectionery Delight | |
PerlMonks |
printing element of anonymous arrayby perltux (Monk) |
on Mar 03, 2018 at 15:31 UTC ( [id://1210279]=perlquestion: print w/replies, xml ) | Need Help?? |
perltux has asked for the wisdom of the Perl Monks concerning the following question:
How can I rewrite the following two commands in one command, i.e. without having to assign the output of gmtime to an array first? perl -e 'my @date=gmtime(time); print $date[6]; ' I had hoped the following would work but I get syntax error: perl -e 'print (gmtime(time))[6]; '
Back to
Seekers of Perl Wisdom
|
|