variable concat and exec cmd question

Reply

Join Date: Nov 2007
Posts: 227
Reputation: k2k is an unknown quantity at this point 
Solved Threads: 0
k2k k2k is offline Offline
Posting Whiz in Training

variable concat and exec cmd question

 
0
  #1
18 Days Ago
basically i need to have 2 variables.. concat them and put them into use.

here is what i have done so far:

  1. #!/usr/bin/perl
  2.  
  3. $stats = ':/var/tmp/RtcTestHarness/currentTransactionStats.txt';
  4. $console = ':/var/tmp/RtcTestHarness/TestHarnessConsole.log';
  5.  
  6. $client_1 = '9.34.120.36';
  7.  
  8. #$com = $client_1.$stats;
  9. #print $com; the concat here looks fine...
  10.  
  11. system ("scp $client_1.$currentTranStats .");


anything wrong? missing the usage of chomp?
Reply With Quote Quick reply to this message  
Join Date: Sep 2009
Posts: 40
Reputation: d5e5 is an unknown quantity at this point 
Solved Threads: 6
d5e5 d5e5 is offline Offline
Light Poster
 
0
  #2
17 Days Ago
I'm on Windows and don't have the scp utility so can't test your code but I notice you use the variable $currentTranStats without having assigned a value to it.

Also note that while a dot between two text variables acts as the concatenation operator, a dot within double quotes is just a dot. For example,
  1. DB<1> $x = 'hello';
  2. DB<2> $y = 'there';
  3. DB<3> print "$x.$y";
  4. hello.there
The values of the two text variables are interpolated into the resulting string, but the dot appears as a literal dot.
Reply With Quote Quick reply to this message  
Reply

Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC