Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

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 (Monsignor) 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?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1199179]
help
Chatterbox?
and a moth chases the moon...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (3)
As of 2017-10-20 09:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My fridge is mostly full of:

















    Results (260 votes). Check out past polls.

    Notices?