Thanks Gil, that helped me to understand the context of the code presented
in the book.
Le 18 sept. 2016 18:02, "Gil Magno" a écrit :
> Hi Khalil
>
> 'say' creates list context. So if 'say' receives the list ('one', 'cd',
> 'qw') it will print 'abcdqw'.
>
> 'reverse' creates list context. So if
Hi Khalil
'say' creates list context. So if 'say' receives the list ('one', 'cd',
'qw') it will print 'abcdqw'.
'reverse' creates list context. So if 'reverse' receives the list ('ab',
'cd', 'qw') it will return a list with the same elements, but with its
order inverted ('qw', 'bc', 'ab').
The c
Hi everyone,
I'm reading the modern perl book and I have some questions to address about
scalar and list context.
Here is the code that I want to understand.
while (<>) { chomp; say scalar reverse; }
Where I'm struggling is : say scalar reverse;
The book says that 'say' impose list context to