Perl Functions in Alphabetical Order (S–Y)

s///

s///

The substitution operator. See the section “Pattern-Matching Operators” in Chapter 5.

say

say FILEHANDLE LIST
say FILEHANDLE
say LIST
say

Just like print, but implicitly appends a newline. say LIST is simply an abbreviation for { local $\ = "\n"; print LIST }. To use FILEHANDLE without a LIST to print the contents of $_ to it, you must use a real filehandle like FH, not an indirect one like $fh.

This keyword is available only when the “say” feature is enabled; see the section Terms and List Operators (Leftward) in Chapter 3.

scalar

scalar EXPR

This pseudofunction may be used within a LIST to force EXPR to be evaluated in scalar context when evaluation in list context would produce a different result. For example:

my($nextvar) = scalar <STDIN>;

prevents <STDIN> from reading all the lines from standard input before doing the assignment, since ...

Get Programming Perl, 4th Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.