# in Equipment.pm ############### # Read an equipment from file to memory sub read_eq ($) { my $eq=shift @_; return if (exists($eq_list{$eq})); local $_; # use re "debug"; open (EQF,"$eq_file") or die "$!"; while () { (m/^#/o) && next; chomp; if (m/^$eq/) { my @array=split (/::/,$_); $eq_list{$eq}=[@array[1 .. $#array]]; $eq=0; last; } } close EQF; if ($eq) { warn "Unable to find equipment \'$eq\'\n"; } return; } # Reads all equipments from player into memory sub read_player () { local $_; foreach (Player::list_all ()) { read_eq ($_); } return; }