Gossamer Forum
Home : General : Perl Programming :

eval'ing

Quote Reply
eval'ing
This is a bit weird. Im trying to eval the following:

Code:
print q<LINK REL="StyleSheet" HREF="~;
print $self->basic_tag(q~css_url~);
print q~/ssql.css" TITLE="css" TYPE="text/css">~;

...that code is stored in $eval and I'm using:

Code:
my $self = shift;
my $code = eval "sub { $eval };"

return $code->($self);

....to compile the code, yet it goes into an eternal loop and I can't figure out why. If I use:

Code:
print $self->basic_tag(q~css_url~);

....it works fine.

basic_tag() looks like:


Code:
sub basic_tag {
#----------------------------------------------------------
# Parse basic tags.

my $self = shift;
my $tag = shift;

# A normal tag.
return exists $self->{TAGS}->{$tag} ?
$self->{TAGS}->{$tag} :
exists $self->{GLB} ->{$tag} ?
$self->{GLB} ->{$tag} : sprintf($ERRORS->{UNKNOWN}, $tag);

}
Quote Reply
Re: [Paul] eval'ing In reply to
I've been trying to figure this out for ages and it was all because my ip had refreshed from .158 to .160 when I got the new cable box yesterday and the page was hanging because of the css file and images trying to load off the old ip.

Blush

Last edited by:

Paul: Sep 28, 2002, 5:28 PM