Open grr opened 1 year ago
This is the converse of #43 . Instead of creating refs, I want to make it easier to deref as in this idiom:
my $ref = [qw(header1 val1 header2 val2)]; #my $ref = {qw(header1 val1 header2 val2)}; my @list = is_hashref $ref ? %$ref : is_arrayref $ref ? @$ref : $ref; # want: my @list = deref $ref;
This could be useful in implementing a method like URI's query_form(), which can take a list, hashref or arrayref of key/vals.
Found a similar old request in the RT queue of Scalar-List-Utils: https://rt.cpan.org/Public/Bug/Display.html?id=105290
This is the converse of #43 . Instead of creating refs, I want to make it easier to deref as in this idiom:
This could be useful in implementing a method like URI's query_form(), which can take a list, hashref or arrayref of key/vals.