EVAL ERROR: Can't call method "prepare" on unblessed reference at /usr/local/Iowa.git/lib/DatabaseMySQL.pm line 288.

Code:
line 1: package tmpevalpackage;
line 2: sub doEval { 
line 3: 	my(@sel,@articles,$article,%data,%toc_map,$last_section,$last_sub_section,$key,%issue_data,%priority);
line 4: 
line 5: 	$priority{'Cover Story'} 	= 'a';
line 6: 	$priority{'Features'} 		= 'b';
line 7: 	$priority{'Foreword'} 		= 'c';
line 8: 				
line 9: 	if($Templates::in{'issue'}) {
line 10: 	
line 11: 		&Database::GetRow($Templates::in{'issue'},'ISSUE',\%issue_data);
line 12: 	
line 13: 		@articles = &Database::SelectClause('ARTICLE',"issue = row $Templates::in{'issue'}");
line 14: 		@articles = &PW::Schema::FilterArticles(@articles);
line 15: 		
line 16: 		foreach(@articles) {
line 17: 			$article = $_;
line 18: 			&Database::GetRow($article,'ARTICLE',\%data);
line 19: 			
line 20: 			if($data{'section'} =~ /reviews/i) { next; }
line 21: 			if($data{'section'} =~ /bestsellers/i) { next; }
line 22: 			
line 23: 			$data{'page'} = sprintf('%4d',$data{'page'});
line 24: 			my($prefix) = 'z';
line 25: 			if($priority{$data{'section'}}) {
line 26: 				$prefix = $priority{$data{'section'}};
line 27: 			}
line 28: 			
line 29: 			$data{'headline'} =~ s/%C2%91/%E2%80%98/g;
line 30: 			$data{'headline'} =~ s/%C2%92/%E2%80%99/g;
line 31: 			$data{'headline'} =~ s/%C2%93/%E2%80%9C/g;
line 32: 			$data{'headline'} =~ s/%C2%94/%E2%80%9D/g;
line 33: 			$data{'headline'} =~ s/%C2%96/%E2%80%94/g;
line 34: 			$data{'headline'} =~ s/%C2%97/%E2%80%94/g;
line 35: 			$data{'headline'} =~ s/%([0-9A-Fa-f]{2})/chr(hex($1))/eg; # unescape the data;
line 36: 			
line 37: 			$toc_map{"$prefix|$data{'section'}|$data{'page'}|$data{'sub_section'}|$data{'headline'}|$data{'nickname'}"} = $article;
line 38: 		}
line 39: 		
line 40: 		foreach(sort keys %toc_map) {
line 41: 			$key = $_;
line 42: 			
line 43: 			# print STDERR "$key";
line 44: 			
line 45: 			my($prefix,$section,$page,$sub_section,$headline,$nickname) = split(/\|/,$key);
line 46: 			
line 47: 			if($section ne $last_section) {
line 48: 				if(defined $last_sub_section) {
line 49: 					$last_sub_section = undef;
line 50: 					print "</ul>";
line 51: 				}
line 52: 				if($last_section) {
line 53: 					print "</ul>";
line 54: 				}
line 55: 				print "<p><strong>$section</strong>";
line 56: 				print "<ul>";
line 57: 				$last_section = $section;
line 58: 			}
line 59: 	
line 60: 			if($sub_section ne $last_sub_section) {
line 61: 				if($last_sub_section) {
line 62: 					print "</ul>";
line 63: 				}
line 64: 				if($sub_section) {
line 65: 					print "<p><li><strong>$sub_section</strong>";
line 66: 					print "<ul>";
line 67: 				}
line 68: 				else {
line 69: 					print '<p>';
line 70: 				}
line 71: 				$last_sub_section = $sub_section;
line 72: 			}
line 73: 			
line 74: 			print "<li><a href=\"\/pw/print/$issue_data{'date'}/$nickname\.html\">$headline</a> ($page)";
line 75: 			
line 76: 		}
line 77: 		if($last_sub_section) { print "</ul>"; }
line 78: 		if($last_section) { print "</ul>"; }
line 79: 
line 80: 		my(@reviews,%review_data,@instances,%instance,$last_category,%category_data);
line 81: 		
line 82: 		@reviews = &Database::SelectClause('REVIEW',"key_byissue starts_with \"$Templates::in{'issue'}.\"");
line 83: 
line 84: 		if(@reviews) {
line 85: 			print "<br><br><strong>Reviews:</strong><ul>";
line 86: 			foreach(@reviews) {
line 87: 				&Database::GetRow($_,'REVIEW',\%review_data);
line 88: 				if($review_data{'category'} != $last_category) {
line 89: 					if($last_category) {
line 90: 						print "</ul>";
line 91: 					}
line 92: 					if($review_data{'category'}) {
line 93: 						&Database::GetRow($review_data{'category'},'REVIEW_CATEGORY',\%category_data);
line 94: 						print "<br><strong>$category_data{'description'}</strong><ul>";
line 95: 					}
line 96: 					$last_category = $review_data{'category'};
line 97: 				}
line 98: 				if($review_data{'book'}) {
line 99: 					@instances = &Database::SelectChildren($review_data{'book'});
line 100: 					foreach(@instances) {
line 101: 						&Database::GetRow($_,'WORK_INSTANCE',\%instance);
line 102: 						print "<li><a href=\"http://www.publishersweekly.com/$instance{'isbn'}\">$review_data{'title'} $instance{'isbn'}</a>";
line 103: 					}
line 104: 				}
line 105: 			}
line 106: 			print "</ul></ul>";
line 107: 		}
line 108: 	}
line 109:  };
line 110: &doEval();
line 111: 1;
X
Stay ahead with
Tip Sheet!
Free newsletter: the hottest new books, features and more
X
X
X
Email Address

Password

Log In Lost Password

PW has integrated its print and digital subscriptions, offering exciting new benefits to subscribers, who are now entitled to both the print edition and the digital editions of PW (online or via our app). For instructions on how to set up your accout for digital access, click here. For more information, click here.

The part of the site you are trying to access is now available to subscribers only. Subscribers: to set up your digital subscription with the new system (if you have not done so already), click here. To subscribe, click here.

Email pw@pubservice.com with questions.

Not Registered? Click here.