[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] Skrive til en bestemt position i en fil i perl



On 2004-06-12, Troels Liebe Bentsen <sslug@sslug> wrote:

>  Det er fordi du åbner filen i "append mode", du skal bare bruge en open(FILE, "$XMLFILE");

Filehandle FILE opened only for input at ./printusers.pl line 165. :-(

>  Og generalt er det en dårlig ide at læse/skrive direkt i en fil, så længe 
>  filen kan være i hukommelse er det bedre bare at slurpe den op og så skrive 
>  den igen når man er færdig.
> 
>  open FILE, "$filename" or die("Could not open $filename");
>  my $buff = do { local $/, <FILE> };
>  chomp($buff);
>  close FILE;

Ok. Den bliver nok 4-5 MB i første omgang. Så det er en sjat.
Men det er vel hurtigere at have det i memory når først man
før det indlæsst. Det er bare irriterende at skulle tygge alle
de data igennem før at tilføke 20 linier i bunden :( Bortset fra
at det er i bunden minus een linie.

Jeg forstod ikke rigtig det du skrev til sidst om LateX precompile.

--
Hanne Munkholm <sslug@sslug>

" Fear is the path to the Dark Side; fear leads to anger. Anger
leads to hate. Hate leads to suffering. "    -- Yoda


 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2005-08-10, 22:43 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] *