in reply to GD::Graph::linespoints - References

The structure is quite static, you could also use the __DATA__ part of your script. A possible approach could be:
#!/usr/bin/perl # Load data inside %times hash my %times; while (<DATA>) { next unless /\S/; # just in case... my ($month, $weeknum, $day, $val) = split /;/; $times{$month}{"wk$weeknum"}{$day} = $val; } # ... all your program here ... __DATA__ May;1;Mon;24.50 May;1;Tues;23.40 May;1;Wed;22.40 May;1;Thu;25.01 May;1;Fri;24.10 ... and so on...
However, you should decide which is the best data structure suitable for what you intend to do with your data, then think about how storing it somewhere. You can also look for Storable or XML::Simple for ways to do the latter.

Flavio (perl -e 'print(scalar(reverse("\nti.xittelop\@oivalf")))')

Don't fool yourself.

Replies are listed 'Best First'.
Re^2: GD::Graph::linespoints - References
by ghenry (Vicar) on May 16, 2005 at 16:13 UTC

    Cool, I like the XML idea. I might try that.

    Remind me what the __DATA__ tag is called again, so I can go read up on it, I haven't used that before.

    .oO(Is it an inbuilt filehandle kind of thing?)

    Walking the road to enlightenment... I found a penguin and a camel on the way.....
    Fancy a yourname@perl.me.uk? Just ask!!!
      Correct, it's an inbuilt filehandle. You can see something about it in perldoc SelfLoader. The same should apply using __END__ instead of __DATA__: the filehandle is still DATA, but I don't know if it is portable with ancient versions of Perl or if it has other issues.

      TheDamian also produced Inline::Files as an extension of the concept.

      Flavio (perl -e 'print(scalar(reverse("\nti.xittelop\@oivalf")))')

      Don't fool yourself.