Newsgroups: fj.lang.perl
Path: galaxy.trc.rwcp.or.jp!news.trc!etlnews.etl.go.jp!ripspost.aist.go.jp!news.imnet.ad.jp!news.join.ad.jp!sutnews.sut.ac.jp!Q.T.Honey!tamaru-news!kuee-news!odins-suita!narans!nide
From: nide@ics.nara-wu.ac.jp (NIDE Naoyuki)
Subject: Re: large data handling
Message-ID: <1997Dec9.025734.20816@cc.nara-wu.ac.jp>
Sender: news@cc.nara-wu.ac.jp
Nntp-Posting-Host: shannon.e.ics.nara-wu.ac.jp
Organization: Nara Women's University
X-Newsreader: mnews [version 1.19PL2] 1996-01/26(Fri)
References: <JOJI.97Dec8181003@wise25.mn.waseda.ac.jp>
Date: Tue, 9 Dec 1997 02:57:34 GMT
Lines: 26
Xref: galaxy.trc.rwcp.or.jp fj.lang.perl:2624
X-originally-archived-at: http://galaxy.rwcp.or.jp/text/cgi-bin/newsarticle2?ng=fj.lang.perl&nb=2624&hd=a
X-reformat-date: Mon, 18 Oct 2004 15:18:22 +0900
X-reformat-comment: Tabs were expanded into 4 column tabstops by the Galaxy's archiver. See http://katsu.watanabe.name/ancientfj/galaxy-format.html for more info.

In Message <JOJI.97Dec8181003@wise25.mn.waseda.ac.jp>,
joji@mn.waseda.ac.jp writes:
> read(STDIN,$a,5075);
> print $a."\n";
> 
> $B$H$$$&$N$r(B for $B$G$"$k$H$+(B while $B$G3g$C$F<B9T$7$^$7$?!%$9(B
> $B$k$H!$$^$!EvA3$N$3$H$J$N$+$b$7$l$J$$$N$G$9$,!$(Bout of
> memory $B$H$J$C$F$7$^$$$^$9(B

  ? $B$3$l$G$OFbIt$KC_$($k%G!<%?$,Bg$-$/$J$C$F$$$-$^$;$s$+$i!"$$$/$i$G$C$+(B
$B$$%G!<%?$r?)$o$;$F$b(Bout of memory$B$K$O$J$i$J$$$h$&$J5$$,$9$k$s$G$9$,!#(B

  cat bigfile | perl -e 'while(read(STDIN,$a,5075)){print $a,"\n"}' >/dev/null

$B$r<j85$N$"$^$j%a%b%jMFNL$NBg$-$/$J$$%^%7%s$G<B9T$7$F$_$^$7$?$,!"2?I4(BMB$B?)(B
$B$o$;$F$bBg>fIW$G$7$?$h!#(Bjperl4.036$B$G$b(Bjperl5.004_03$B$G$b!#(B

  $B!D$?$@$7!"(B

while(1){local($a);last unless read(STDIN,$a,5075);print $a,"\n"}

$B$N$h$&$K!"%k!<%W$NCf$G(Blocal$B$r;H$&$H!"(Bjperl4.036$B$G$O(Bout of memory$B$r5/$3$7(B
$B$^$9!#%k!<%WFb$G3NJ]$7$?(Blocal$BJQ?t$NNN0h$r!"<!2s$N%k!<%W<B9T$N;~0J8e$K$b(B
$B2rJ|$7$J$$$?$a$N$h$&$G$9!#(Bjperl5.004_03$B$@$H$3$l$G$bBg>fIW$J$N$G!"(Bperl4$B$N(B
$B%P%0$+$bCN$l$^$;$s!#(B
nide@ics.nara-wu.ac.jp
