Reputation: 1050
i am trying to concatenate string in perl.
eg:
my $file = $table_name.".sql";
print $file;
I get output like:
Employee
.sql
(considering $table_name =Employee )
please suggest how to make sure the output comes in single lie without blanks.
Upvotes: 0
Views: 603
Reputation: 21
The chomp() function will remove newline character from the end of a string. check http://perlmeme.org/howtos/perlfunc/chomp_function.html
Upvotes: 1
Reputation: 4396
Your $table_name variable contains a word 'Employee' as well as a new line character. You can use chomp to remove the newline.
Add this before you concatenate your variables:
chomp $table_name;
Upvotes: 5