in reply to Re: Create dynamically different array names based on counter incrementation
in thread Create dynamically different array names based on counter incrementation
# Put fields in Array[counter] $Arrays[$counter] = split /\t/, $line;
I think you meant:
$Arrays[$counter] = [ split /\t/, $line ];
or even (with autovivification) — though I consider that less readable:
@{ $Arrays[$counter] } = split /\t/, $line;
In scalar context (what you have), split returns the number of fields found (and older versions of Perl did split into the @_ array, issuing a "Use of implicit split to @_ is deprecated" warning).
|
|---|