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
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
 

lokeyh

Advanced Member level 4
Joined
Sep 29, 2004
Messages
106
Helped
4
Reputation
8
Reaction score
1
Trophy points
1,298
Activity points
812

    davyzhu

    Points: 2
    Helpful Answer Positive Rating

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.
 

    davyzhu

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

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top