Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

How to use print "The answer is "$cnt1+$cnt2; in Perl?

Status
Not open for further replies.

davyzhu

Advanced Member level 1
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
 


    davyzhu

    Points: 2
    Helpful Answer Positive Rating
Simple Perl Problem?

Probably you need ","
print "The answer is ", $cnt1+$cnt2;

Nandy
www.nandigits.com
Netlist Debug/ECO in GUI mode.
 

    davyzhu

    Points: 2
    Helpful Answer Positive Rating
Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top