Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Re: Flat File Database & GD::Graph (REVISITED)

by suggus (Sexton)
on Mar 18, 2002 at 08:42 UTC ( #152435=note: print w/ replies, xml ) Need Help??


in reply to Re: Flat File Database & GD::Graph (REVISITED)
in thread Flat File Database & GD::Graph (REVISITED)

That didn't work.
The reason why I used

my @data = ( [ qw ( $date ) ], [ qw ( $aaa_partners ) ], [ qw ( $aaa_arf ) ], );

was because the GD::Graph module allows you to format your data without having to use quotes and commas. like so:
$graph->set( dclrs => [ qw(green pink blue cyan) ] );

right? ...remind me not to drink 6 cups of coffee in one sitting. ;)


Comment on Re: Re: Flat File Database & GD::Graph (REVISITED)
Select or Download Code
Re: Re: Re: Flat File Database & GD::Graph (REVISITED)
by busunsl (Vicar) on Mar 18, 2002 at 08:52 UTC
    I see your problem.

    Try to use arrays for $date and so on:

    (untested)

    while (<HANDLE>) { chomp; @temp1 = split(/\|/, $_); $domain = unpack ("A5", $temp1[17]); push @date, $temp1[1]; push @aaa_partners, $temp1[4]; push @aaa_arf, $temp1[5]; } close(HANDLE); my @data = ( \@date, \@aaa_partners, \@aaa_arf );
      while (<HANDLE>) { chomp; @temp1 = split(/\|/, $_); $domain = unpack ("A5", $temp1[17]); push @date, $temp1[1]; push @aaa_partners, $temp1[4]; push @aaa_arf, $temp1[5]; } close(HANDLE); my @data = ( \@date, \@aaa_partners, \@aaa_arf );

      still doesn't work. Is it because GD::Graph is really picky as to how the multidimensional arrays are formatted? Please enlighten me if anyone has had any experience working with text file databases and the GD::Graph module.
Re: Re: Re: Flat File Database & GD::Graph (REVISITED)
by PrakashK (Pilgrim) on Mar 18, 2002 at 14:59 UTC
    GD::Graph module allows you to format your data without having to use quotes and commas. like so:
    $graph->set( dclrs => [ qw(green pink blue cyan) ] );
    It is not the feature of GD::Graph module that is letting you write code like this. It is the magic of the qw operator. Please see the Quote and Quote-like Operators section in perlop.

    /prakash

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://152435]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (8)
As of 2014-10-24 08:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (131 votes), past polls