Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Combining Variables

Status
Not open for further replies.

jonnymp316

IS-IT--Management
Jun 6, 2003
6
US
Hello
I just wanted to know how do you combine two variables:
for instance:
my $firstname="fred";
my $lastname="flintstone";
my $wholename=$firstname + $lastname;
print $wholename;

can someone give me and example of something that will do that.
 
$first = "Fred";
$last = "Flintstone";
$fullname = "$first $last";
print $fullname;
 
Usually concatenation is done using the "." operator

$fullname=$firstname." ". $surname


HTH
Paul


It's important in life to always strike a happy medium, so if you see someone with a crystal ball, and a smile on their face ...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top