lucenenet-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Prescott Nasser <geobmx...@hotmail.com>
Subject [Lucene.Net] need some perl help
Date Sat, 19 Mar 2011 22:38:45 GMT

Alright, any perl experts - I've been doing some binging and can't quite figure this out..
 
 
We have this function:
 
 
sub basic {
    my %args = @_;
    my $filepath = "content$args{path}";
    read_text_file($filepath, \%args);
    $args{path} =~ s/\.mdtext$/\.html/;
    $args{breadcrumbs} = _breadcrumbs($args{path});
    $args{tagline} = _tagline($args{path});
    my $template_path = "templates/$args{template}";
    my $rendered = Dotiac::DTL->new($template_path)->render(\%args);
    return ($rendered, 'html', \%args);
}
 
and then following is part of _tagline:
 
 
sub _tagline {
    my $file = basename($_); 
 
Occasionally, $_ is empty, which means basename($_) throws an error - specifically when editing
.mdtext files via the asf cms process. This obviously poses an issue when compiling. I'm not
sure how to account for this. Why would %args{path} be empty? I could just do a check in _tagline
to say if $_ is empty then $file = "", which would work, but I'm concerned about why this
is empty in the first place
 
Thanks for any help
~P

  		 	   		  
Mime
View raw message