Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery

Re^2: print and say

by LanX (Bishop)
on Sep 12, 2017 at 09:16 UTC ( #1199179=note: print w/replies, xml ) Need Help??

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 (Abbot) 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.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1199179]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (6)
As of 2018-07-18 11:07 GMT
Find Nodes?
    Voting Booth?
    It has been suggested to rename Perl 6 in order to boost its marketing potential. Which name would you prefer?

    Results (389 votes). Check out past polls.