in reply to Assigning a variable to a Hash key reference
I'm trying to move the "my's" outside the block. $menudir is the problem....open the file... my %menuhash1 = (); my @fields1 = split(/\t/, <FILE>); chomp @fields1; my @records1; my $prodlisting; my %ref1; while(<FILE>) { chomp; my @row1 = split(/\t/); my %data1; @data1{@fields1} = @row1; chomp @row1; push @records1, \%data1; } close (FILE); foreach my $ref1 ( sort {(-1,0,1)[rand 3]} @records1 ){ my $thumbgif = "thumb.gif"; my $menudir = "$ref1->{'dir'}"; $menudir = "$menudir/"; my $thumb = "$webdir\/$menudir$thumbgif"; print "<img align=\"center\" border=\"0\" src=\"$thumb\">"; etc...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Assigning a variable to a Hash key reference
by jarich (Curate) on May 28, 2002 at 07:02 UTC |