Dec 23, 2005 #1 D davyzhu Advanced Member level 1 Joined May 23, 2004 Messages 494 Helped 5 Reputation 10 Reaction score 2 Trophy points 1,298 Location oriental Activity points 4,436 Hi all, I am a Perl newbie. $cnt1 = 2; $cnt2 = 3; And I want to directly Code: print "The answer is "$cnt1+$cnt2; The above code have compile error. How to mix the string and +/-/*/... ... without middle parameter? How to do it? Best regards, Davy
Hi all, I am a Perl newbie. $cnt1 = 2; $cnt2 = 3; And I want to directly Code: print "The answer is "$cnt1+$cnt2; The above code have compile error. How to mix the string and +/-/*/... ... without middle parameter? How to do it? Best regards, Davy
Dec 23, 2005 #2 lokeyh Advanced Member level 4 Joined Sep 29, 2004 Messages 106 Helped 4 Reputation 8 Reaction score 2 Trophy points 1,298 Activity points 812 Re: Simple Perl Problem? print $cnt1+$cnt2; Click to expand... This works for me.
Dec 23, 2005 #3 N Nandy Advanced Member level 4 Joined Dec 16, 2005 Messages 116 Helped 6 Reputation 12 Reaction score 4 Trophy points 1,298 Location San Jose CA Activity points 2,399 Simple Perl Problem? Probably you need "," print "The answer is ", $cnt1+$cnt2; Nandy www.nandigits.com Netlist Debug/ECO in GUI mode.
Simple Perl Problem? Probably you need "," print "The answer is ", $cnt1+$cnt2; Nandy www.nandigits.com Netlist Debug/ECO in GUI mode.