in reply to Re: print and say
in thread print and say

for does a loop over one element, that's nonsense.

$answer = myfunct($str1, $str2); say $answer;

Cheers Rolf
(addicted to the Perl Programming Language and ☆☆☆☆ :)
Je suis Charlie!

Replies are listed 'Best First'.
Re^3: print and say
by haukex (Archbishop) on Sep 13, 2017 at 08:02 UTC

    Disregarding efficiency, a for loop over one element can be "useful" as a "topicalizer", i.e. locally setting $_ and shortening code. It's suggested by the Perl documentation in Switch Statements for use with the experimental when.