in reply to Passing a hash plus some strings to a subroutine

I'd maybe do something like this, or just name it $data and use $data->{'foo'} rather than having to have an actual hash locally (unless you're worried about altering the original through the ref).

sub generate { my( $record, $status, $_data ) = @_; my %data = %{ $_data }; ... }

The cake is a lie.
The cake is a lie.
The cake is a lie.

Replies are listed 'Best First'.
Re^2: Passing a hash plus some strings to a subroutine
by mldvx4 (Hermit) on Dec 20, 2025 at 12:29 UTC

    Thanks. By the time the data gets that far into my script, there is no intention to change it. However, I think for readability, I'll go with the approach which creates the local hash.