Having an odd behavior of using 'join' to print an array. I want to use a semi-colon as the separator, but
it keeps outputting a comma. print (join "; ",@Keywords); Architecture,Engineering,Environment,3D Printing,Housing
@Keywords is created from a web-based form using the CGI module: @Keywords=param('keywords');
Current keywords are presented in a select list and the user can choose multiple keywords: <select name="keywords" id="keywords" multiple>
But it seems that CGI.param is placing them in @Keywords in an odd format. Thus my attempt to 'join' them does not work. I would appreciate some assistance or advice if possible.
Hello and thank you for the reply. Yes, tried both with no joy. I believe it is a result of how CGI saves data. I understand it should save multiple select box choices into an array: @Keywords=param('keywords');
But whatever I try to get the semi-colon in fails. Going to fiddle some more.
CGI.pm seems to be saving data to a single element of keywords separated by a comma. for $kw(@Keywords) { print qq{-->$kw<--}; }
results in -->Architecture,Engineering,Environment,3D Printing,Housing<--
This is from a select box with 'multiple="multiple". So I am stumped as to why. Perhaps an updated CGI.pm? Or can I massage that data into an array that I can work with?