at this time I create an data-array (for easier looped processing) in
the header of my script like this way:
name[0]="...";
address[0]="...";
name[1]="...";
address[1]="...";
Is there a better way to create such an array?
thanks
I'm not sure what you're trying to do, but perhaps this is what you're
looking for:
@name = ('...') x @name;
@address = ('...') x @address;
Cheers,
Bernard
--
echo 42|perl -pe '$#="Just another Perl hacker,"'
That is not Perl. Presumably you're doing
$name[ 0] = "...";
etc.
> Is there a better way to create such an array?
Who knows. It depends on how your raw data are given. If you are
setting them from strings in the source, this is an alternative:
@name = ( 'name0', 'name1', ..., 'nameN');
@address = ( 'addr0', 'addr1', ..., 'addrN');
Anno