[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

Re: [PROGRAMMERING] Ineffektiv perlcode



Peter Maersk-Moller <sslug@sslug> writes:

> 7   $html_body = $html_body.$$ref[0]."<br>";
> 8 }
> 9 print STDOUT $html_header.$html_body.$html_tail;
> ----------------------
>
> Som i kan se i linje 7 kopierer jeg en streng over i sig selv og jo længere
> strengen bliver jo længere vil hver iteration tage.
>
> Hvordan kan det gøres bedre, når det er en betingelse, at resultatet
> ikke skrives ud før til sidst ?

Jeg ved ikke om det hjaelper paa hastigheden, men du kan proeve denne
linje:
   $html_body .= $$ref[0]."<br>";

Hvis ikke det giver nok hastighed kan du proeve om det hjaelper at
lave et array som du tilfoejer dine tekststykker til med
   push @array, $tekst 
og saa til sidst kan du saette alle tekststykkerne sammen med 
   join '', @array

-- 
Kim Hansen


 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2005-10-01, 02:01 CEST [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *