after 2 hours, i can't figure out where the errors are coming from.
open (FILE, $lfilename) or &dienice;
my $hash;
my $line;
my %hash;
my @products;
while ( <FILE> ) {
if ( /^Begin Product (.*)/i ) {
my %hash;
$hash{ 'name' } = $1;
$hash{ 'description' } = <FILE>;
$hash{ 'numberline1' } = <FILE>;
$hash{ 'numberline2' } = <FILE>;
my $track = <FILE>;
$hash{ 'tracking' } = ( $track =~ /(Yes|No)/i );
$hash{ 'images' } = <FILE>;
$hash{ 'producttext' } = <FILE>;
my $line = <FILE>;
last if ( $line ~= /End Product/ ); ##i'm getting a syntax error o
+n this line: line 27, near "$line ~". if i take out the line, i get:
+ Can't use an undefined value as a HASH reference at c:\PROGRA~1\APA
+CHE~1\APACHE\CGI-BIN\GETPRO~2.CGI line 31, <FILE> line 2134.
push @products, \%hash;
}}
print "<B>", my $ref->{name}, "</B>";