Your problem is simple: you are declaring the arrays that you want to export as lexicals instead of globals in your code. Exporter then accesses the globals and ends up exporting empty arrays.
Try our (@overall, @electronics, @safety); breakouts(@products); at line 23.
You will also need to rework breakouts to directly load the arrays, instead of creating locals and attempting to return those. You cannot return multiple lists from a function in Perl — perl will merge them all into a single flat list and put it all in the first array.
In reply to Re: Returning arrays from a package
by jcb
in thread Returning arrays from a package
by sherab
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |