http://www.perlmonks.org?node_id=994840


in reply to Re: How can we interpolate an expression??
in thread How can we interpolate an expression??

Well, the only one different that I know between print and say is that: -

-->"say" adds a Newline to the output, whereas we have to give it explicitly in "print".

Is there any other different??

  • Comment on Re^2: How can we interpolate an expression??

Replies are listed 'Best First'.
Re^3: How can we interpolate an expression??
by Marshall (Canon) on Sep 21, 2012 at 08:07 UTC
    my $number = 5; my $multiplier = 3; # Use print instead of "say" print "Product is ", $number * $multiplier, "\n"; #this does not work... #"say" has limitations... say "Product is ", $number * $multiplier; __END__ Product is 15
    "Say" will add a \n to a simple string. More complex things require "print" or "printf".