Brian Fraser wrote:
Well, what have you tried? And what exactly do you want to store for each
line?
If you want to get a data structure that looks something like line number =>
{Equation =>  1, Spec =>  2, Timing =>  1}, then an ugly way would be

use strict;
use warnings;
use 5.010;
use Data::Dumper;

my @everything;
while (<DATA>) {
     while (/(?<word>\p{L}+)\s+\p{L}+\s+(?<setnumber>[0-9]+)/g) {
         ${$everything[$. - 1]}->{$+{word}} = $+{setnumber};

Why are you dereferencing $everything[$. - 1] twice?

Either:

${$everything[$. - 1]}{$+{word}} = $+{setnumber};

Or:

$everything[$. - 1]->{$+{word}} = $+{setnumber};

Or simply:

$everything[$. - 1]{$+{word}} = $+{setnumber};

Should do.



John
--
Any intelligent fool can make things bigger and
more complex... It takes a touch of genius -
and a lot of courage to move in the opposite
direction.                   -- Albert Einstein

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to