in reply to List vs array printing in perl

Use:

perl -e 'print +(getpwnam(traveler))[2,3];'

To understand why your attempt doesn't work add -w:

C:\test> perl -we "print (getpwnam(traveler))[2,3];" print (...) interpreted as function at -e line 1. Unquoted string "traveler" may clash with future reserved word at -e l +ine 1. syntax error at -e line 1, near ")[" Execution of -e aborted due to compilation errors.

With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority". I knew I was on the right track :)
In the absence of evidence, opinion is indistinguishable from prejudice.