in reply to Problems with graphing time vs data with Tk

my $time_ = localtime; my $date = ParseDate($time_); $date =~ s/://g; my $unix_date = UnixDate($date, @d_format); $unix_date =~ s/ //g; $ash_{date} = $unix_date; $ash_{temp} = gct();

What does @d_format contain?   Why put the spaces in the format string and then just remove then?   You should probably use POSIX::strftime, for example:

use POSIX 'strftime'; $ash_{date} = strftime $d_format[0], localtime;

my %cash = build_comp_hash(); push @aoh, { %cash }; graphable_arrays();

Why are you copying the hash twice?   Just copy it once:

push @aoh, { build_comp_hash() };

@xdata = (); @ydata = (); my($i, $datum); for $i (0 .. $#aoh){ for $datum (keys %{ $aoh[$i] }){ if($datum =~ m/date/){ push @xdata, $aoh[$i]{$datum}; } elsif($datum =~ m/temp/){ push @ydata, $aoh[$i]{$datum}; } else{} }

It looks like your keys exactly match 'date' and 'temp' so there is no need to iterate through all the keys to find them:

@xdata = (); @ydata = (); for my $hash ( @aoh ) { push @xdata, $hash->{ date }; push @ydata, $hash->{ temp }; }

Replies are listed 'Best First'.
Re^2: Problems with graphing time vs data with Tk
by transiency (Sexton) on Apr 18, 2009 at 17:36 UTC
    Ok thanks for your tips, but I am still at a loss as to how to deal with this time problem...