aseidas has asked for the wisdom of the Perl Monks concerning the following question:
The sub get_domkey is grabbing the key and printing, when I try to use it to grab the record in sub get_domcf it returns nothing, I have tried several different regexs but have had no luck in getting any to pass the record to @dom_opts, any help would be greatly appreciated :) -Aseidassub get_domkey{ + while(<>){ + if (/\*([^*]+)\*/) { + $key=$1; + print "$key\n"; + &get_domcf; + } + } + } + sub get_domcf{ + open DOM_CF, '/u/ds2/r61/domcf.dat' or die "Can't open DOM control fil +e because $!\n"; + while (<DOM_CF>){ + if (/\$key/){ + @dom_opts=$1; + } + } + }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Matching a variable in a fixed width file
by jsprat (Curate) on May 08, 2002 at 23:06 UTC | |
|
Re: Matching a variable in a fixed width file
by ozone (Friar) on May 08, 2002 at 23:14 UTC | |
by aseidas (Beadle) on May 08, 2002 at 23:27 UTC |