in reply to Re: Can you explain the difference with print?
in thread Can you explain the difference with print?

I still don't understand...

If localtime is a function call that I can't evaluate in print, how come I can do this?

C:\Users\user>perl -we "use Time::Piece;print localtime->day_of_week" 5

Replies are listed 'Best First'.
Re^3: Can you explain the difference with print?
by talexb (Chancellor) on Aug 04, 2023 at 21:00 UTC

    Because you're not doing any variable interpolation there -- there are no double quotes, you're just printing the output of a function call.

    Alex / talexb / Toronto

    Thanks PJ. We owe you so much. Groklaw -- RIP -- 2003 to 2013.

      That's Bod's point. The same applies to the OP. No quotes, so no interpolation.