I am customizing an open source Perl script for some db backup. I don’t have much knowledge in Perl. Can someone tell me how will i pass a parameter to qw[]?
for example the original code is like this
@selected_databases = qw[testdb1 testdb2 testdb3];
i want to convert it to something like below
$_dblist = "testdb1 testdb2 testdb3";
@selected_databases = qw[$_dblist];
but it is not working. Can someone tell me how will I pass a variable to qw[]?
qwdoes not support interpolation. As per the perl-doc. As such, you cannot do that, it will not work. To achieve what you are looking to do, use thesplitfunction.