in reply to Passing hash names in a file
$fn = 'glossary.pl'; $/ = ');'.$/; # cunning trick to read in the whole hash open (FILE, "<$fn"); while (<FILE>) { next unless (/%(\w+)(?:\s|=)/s); # match %word = or %word= push @hashnames, $1; } close(FILE);
Dingus
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Passing hash names in a file
by heezy (Monk) on Dec 10, 2002 at 15:59 UTC |