I'm learning the Perl so recently trying to replacing the last item in a array statements.
Here is the code :
for (0 .. $numhits - 1) {
%rec = &array_to_hash($_, @hits);
$output .= " '$rec{'title'}',\n";
}
I just want to remove the comma " , " sign after '$rec{'title'}', so it will print out the $rec{'title'} without any comma " , " for the last array.
Could anyone help me out ?
Any replies would be appreciated.
Thanks.
Regards,
Tommy
Here is the code :
for (0 .. $numhits - 1) {
%rec = &array_to_hash($_, @hits);
$output .= " '$rec{'title'}',\n";
}
I just want to remove the comma " , " sign after '$rec{'title'}', so it will print out the $rec{'title'} without any comma " , " for the last array.
Could anyone help me out ?
Any replies would be appreciated.
Thanks.
Regards,
Tommy