Abhay_Anand has asked for the wisdom of the Perl Monks concerning the following question:
Hi I am trying to insert a variable in 2nd line of a file. But it never takes variable value rather keeps taking it as text.
root@vm-test-001:~/mongosearch# part=( "${arr[@]:i:batchsize}" ) root@vm-test-001:~/mongosearch# echo $part "C:00000092666270:53882159774" root@vm-test-001:~/mongosearch# perl -ni -e 'print; print "permissib +leCars = [ \${part[*]} ]\n" if $. == 2' query/containerId_count.js
This keeps inserting $part as text like permissibleCars = [ ${part*} ] and not as variable like permissibleCars = "C:00000092666270:53882159774" How can this get fixed ?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Inserting Variable Through Perl
by hippo (Archbishop) on Aug 17, 2017 at 07:55 UTC | |
|
Re: Inserting Variable Through Perl
by haukex (Archbishop) on Aug 17, 2017 at 07:59 UTC |