Hello all,
In relation to my post "Count commas from input file for output file" I think I may be able to solve the puzzle by a substitution. I have a variable that contains a number $results_tmp. I want to substitute it for the words in this scalar named $cli. $cli looks like this:
so if $results_tmp = 0.1 I want to substitute "0.1" for "sho bgp" so $cli will look like:
I have tried many variations of the following:
This is my output from above:
Any help is appriciated.
Nick
If at first you don't succeed, don't try skydiving.
In relation to my post "Count commas from input file for output file" I think I may be able to solve the puzzle by a substitution. I have a variable that contains a number $results_tmp. I want to substitute it for the words in this scalar named $cli. $cli looks like this:
Code:
, ,sho bgp, , , , , , , ,
so if $results_tmp = 0.1 I want to substitute "0.1" for "sho bgp" so $cli will look like:
Code:
, ,0.1, , , , , , , ,
I have tried many variations of the following:
Code:
$cli = ", ,sho bgp, , , , , , , ,";
$results_tmp = "0.1";
$cli =~ s/($results_tmp)/^.*\w+.*$/;
This is my output from above:
Code:
Unrecognized escape \w passed through at ./bpBellSouthCoyote_Beta_10_4.pl line 158.
Final $ should be \$ or $name at ./bpBellSouthCoyote_Beta_10_4.pl line 158, within string
syntax error at ./bpBellSouthCoyote_Beta_10_4.pl line 158, near "=~ s/($results_tmp)/^.*\w+.*$/"
Execution of ./bpBellSouthCoyote_Beta_10_4.pl aborted due to compilation errors.
Any help is appriciated.
Nick
If at first you don't succeed, don't try skydiving.