in reply to Modern Perl Book "Paquito" Example Question
perldoc -f say
... "say" is available only if the "say" feature is enabled or if it is prefixed with "CORE::". The "say" feature is enabled automatically with a "use v5.10" (or higher) declaration in the current scope.
So you could add
oruse v5.10; # or higher ...
oruse feature qw(say); ...
$_ = 'My name is Paquito'; CORE::say if /My name is/; s/Paquito/Paquita/; tr/A-Z/a-z/; CORE::say;
Had you add use strict; the following warning would have been issued hinting that say is unknown:
Bareword "say" not allowed while "strict subs" in use at ./say.pl line + xyz.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Modern Perl Book "Paquito" Example Question
by kcott (Archbishop) on Oct 08, 2018 at 06:49 UTC |