This is the first article in a series about new Perl 5.10 features. I’ll try to write one article each week, but you’ll never know.
This first article is about the new builtin function
is similar to
say or other
features from Perl 5.10, you need to declare that you want to use these
After you have done that you can use the function like this.
say 'Hello world';
This will print the text ‘Hello, world’ to STDOUT and add a newline
after it, equal to:
print "Hello, world\n";
This doesn’t seem like a big feature, but it will also help with the following.
say for @lines;
This is instead of
print "$_\n" for @lines;
say function removes some complexity in this example. You don’t have
to add the newline anymore.