in reply to how to print text + array values at same time
If that's Text::CSV's print() method you're referring to, perhaps that documentation may help.
According to the documentation, your first line of code
$csv->print ($fh1, [$ifile, @cols, @matches ]);
appears to be syntactically correct. Print out the values of those variables, immediately before that line of code, and inspect them: this may help in tracking down your problem.
I've no idea what you're attempting to achieve with "*".@cols. It will concatenate an asterisk with the number of elements in @cols (i.e. @cols in scalar context). Here's an example:
$ perl -wE 'my @cols = qw{a b c}; say "*".@cols' *3
Here's some suggestions as to what I think you may want (but I really am guessing here):
$ perl -wE 'my @c = (1,2,3); say "*", @c' *123
$ perl -wE 'my @c = (1,2,3); say "*@c"' *1 2 3
$ perl -wE 'my @c = (1,2,3); say map { "*$_" } @c' *1*2*3
$ perl -wE 'my @c = (1,2,3); say "@{[ map { qq{*$_} } @c ]}"' *1 *2 *3
If you need more help, please read "How do I post a question effectively?" before posting again.
— Ken
|
|---|