IT Community - Software Programming, Web Development and Technical Support

How to concatenate strings with Perl?

This is a discussion on How to concatenate strings with Perl? within the Perl forums, part of the Software Development category; Hi all, Can any one explain me with coding ...for how to concatenate strings with Perl?...


Go Back   IT Community - Software Programming, Web Development and Technical Support > Software Development > Perl

Register FAQ Members List Calendar Mark Forums Read
  1 links from elsewhere to this Post. Click to view. #1 (permalink)  
Old 11-16-2007, 09:58 PM
amansundar amansundar is offline
D-Web Analyst
 
Join Date: May 2007
Posts: 323
amansundar is on a distinguished road
Exclamation How to concatenate strings with Perl?

Hi all,

Can any one explain me with coding ...for how to concatenate strings with Perl?
__________________
cheers
Aman
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 11-26-2007, 05:48 AM
velhari velhari is offline
D-Web Programmer
 
Join Date: Mar 2007
Location: Chennai
Posts: 67
velhari is on a distinguished road
Send a message via AIM to velhari
Thumbs up Re: How to concatenate strings with Perl?

Hi,
Using Join and dot operator, you can concatenate string easily.

Example:-
  1. $string = 'Hello'.'World';
    output as,
    HelloWorld

  2. $string = join 'Hello','World';
    output as,
    HelloWorld
__________________
Regards,
VELHARI
I am not totally useless. I can be used for a bad example
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 11-28-2007, 08:39 PM
S.Vinothkumar S.Vinothkumar is offline
D-Web Genius
 
Join Date: May 2007
Posts: 1,061
S.Vinothkumar is on a distinguished road
Smile Re: How to concatenate strings with Perl?

Yes...exactly vel!

let me post some example....

using Perl's dot operator:

$name = 'checkbook';
$filename = "/tmp/" . $name . ".tmp";

using Perl's join function

$name = "checkbook";
$filename = join "", "/tmp/", $name, ".tmp";
__________________
S.VinothkumaR
Behind me is infinite power,
Before me is Endless Possibility,
Around me is Boundless Opportunity,
Why should I fear!
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 11-28-2007, 08:39 PM
S.Vinothkumar S.Vinothkumar is offline
D-Web Genius
 
Join Date: May 2007
Posts: 1,061
S.Vinothkumar is on a distinguished road
Cool Re: How to concatenate strings with Perl?

By the way....

Actually...usual way of concatenating strings ....

Code:
$filename = "/tmp/${name}.tmp";
__________________
S.VinothkumaR
Behind me is infinite power,
Before me is Endless Possibility,
Around me is Boundless Opportunity,
Why should I fear!
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

LinkBacks (?)
LinkBack to this Thread: http://www.discussweb.com/perl/4520-how-concatenate-strings-perl.html
Posted By For Type Date
DiscussWeb IT Community - Technical Support and Technology Discussions This thread Refback 12-05-2007 08:59 AM

Similar Threads
Thread Thread Starter Forum Replies Last Post
what is perl? inder Perl 2 09-25-2008 04:10 AM
Concatenate row values in a table oxygen Database Support 1 02-08-2008 12:49 AM
Trimming strings in JavaScript Pvinothkumar HTML, CSS and Javascript Coding Techniques 2 09-18-2007 09:34 PM
How to set Perl Interpreter within perl script sivaramakrishnan Perl 1 07-19-2007 05:45 AM
Connection Strings Info Gopisoft VB.NET Programming 0 07-17-2007 04:42 AM


All times are GMT -7. The time now is 06:19 PM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.

SEO by vBSEO 3.0.0