perlquestion
sxmwb
I have a subroutine that that I am passing named parameters into and receive the following error: <p>
<code>
Can't use string ("1") as a HASH ref while "strict refs"
</code>
<p>
Here is the code snippet:<p>
<code>
use strict;
use DBI;
my @record = qw(adam baker code dog);
@record = validate_record_length({record => \@record, recl => '18'});
sub validate_record_length {
my $args = @_;
my @record = $args->{record};
my $recl = $args->{recl};
my $record_size = @record;
for (my $i = $record_size; $i < $recl; $i++){
$record[$i] = '';
}
return @record;
}
</code>
<p>
The subroutine just takes a record as an array from another process and makes sure that it has enough fields though the filled out fields are null. There are other subroutines in the actual code setup before this one and as you can tell I am using the DBI module.<p>
Seeker of knowledge<br>
sxmwb