Question

I have got as follows:

 use constant ABC => ('one', 'two', 'three');

and I want to pass this constant to variations_with_repetition(\@data, $k) subroutine as @data.

How should I do that?

Was it helpful?

Solution

Use the [] operator to convert a list to an ARRAY reference:

variations_with_repetition( [ABC] , $k );
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top