It is quite simple, as the text says. Take a look at perldoc -f print , for example:
print FILEHANDLE LIST print FILEHANDLE print LIST
As they say right there, print accepts LIST arguments, which means anything published after print in a list context. This is the same for any function where the argument is denoted as LIST.
With the scalar function scalar you can override this list context so that your argument is not evaluated in the list context. For example, an instruction to read a file descriptor line, for example:
my $line = <$fh>;
It is calculated in a scalar context because $line is a scalar. This means that only one line is read and placed in a variable. However, if you were to do:
print <$fh>;
The read line is in the context of the list, which means that all remaining lines in the file will be read. You can override this by setting the readline operator in a scalar context:
print scalar <$fh>;
And then you just read one line. To be more precise, you can provide a scalar context in the middle of the list:
print @list, scalar <$fh>, @list2;
Which, apparently, is what this quote says.
source share