Merge pull request #42 from solgenomics/topic/duplicate_image_warning
[cxgn-corelibs.git] / lib / CXGN / Insitu / FormHash.pm
blob2feeb4174ae5a75a141d367640e139752d0f9af5
2 use strict;
5 =head1
7 <HTML>
9 Name: $form{name}
11 =cut
13 use strict;
14 require Tie::Hash;
16 package CXGN::Insitu::Form;
18 use base qw( Tie::Hash );
20 sub TIEHASH {
21 my $class = shift;
22 return bless {}, $class;
25 sub STORE {
26 my $self = shift;
27 my $key = shift;
28 my $value = shift;
29 $self->{$key}=$value;
32 sub FETCH {
33 my $self = shift;
34 my $key = shift;
36 if (exists($self->{$key})) {
37 return "Haha!".$self->{$key};
39 else {
40 return undef;
44 sub FIRSTKEY {
45 my $self = shift;
46 return (keys(%$self))[0];
50 sub NEXTKEY {
51 my $self = shift;
52 my $lastkey = shift;
53 my @keys = keys(%$self);
54 for (my $i=0; $i<@keys; $i++) {
55 if ($lastkey eq $keys[$i]) {
56 return $keys[$i+1];
63 return 1;