package IIa66da94aed9b371a0ee16b72f938ea09::tag_mkurl; use strict; use base qw/II720d6e18aa34327713eb014408fc9144/; sub start { my ($this, $tag, $attr, $attrseq, $origtext)= @_; my $url = $attr->{url} or $this->harakiri('url?'); my $tmpl = $attr->{tmpl} or $this->harakiri('tmpl?'); my $mapper = $attr->{mapper} or $this->harakiri('mapper?'); $this->evaluate for $url, $tmpl, $mapper; $this->addCode('{'); $this->addCode(qq/require $mapper;/); $this->addCode(qq(die "url must start with http://" unless "$url" =~ m|^http://|;)); $this->addCode(qq/my \$file = $mapper\->url2file("$url");/); $this->addCode(qq/(ref \$this)->mkfile(\$file, "$tmpl", \$this->{C});/); $this->addCode('}'); return; } 1; 