Well, in that case - you can do something like this:
#!perl
my %data_ids;
while(my $line = <DATA>) {
chomp $line;
my ($key, $value) = split /::/, $line;
$data_ids{$key} = $value;
print $key, " => ", $value, "\n";
}
for my $key (keys %data_ids) {
print $key, " ==> ", $data_ids{$key}, "\n";
}
# or just
print $data_ids{'chipId'}, "\n";
print $data_ids{'subversid'}, "\n";
__DATA__
chipId::1925
subversid::0001
From your original code sample, I surmise that you need these IDs for generating an m4 macro. Using a hash might be useful for you since you can just look that up when generating the m4 file later on. Bear in mind all points raise in this thread, use close, closedir properly.
This got longer than expected. Next time around, you could save us all a lot of back and forth by including a small data sample as I showed above with __DATA__. Also, work through perlintro or an introductory perl book(learn.perl.org lists quite a few of them and some freely available online) and ask more questions here when you get stuck.
Good luck!