UUGRN

Re: perlfrage

From
Raphael H. Becker <Raphael.Becker@...>
Date
"Raphael H. Becker" wrote:
> Michael Lestinsky wrote:
> > Am 17.04.'02 schrieb Johannes Walch:
> > > while (<>) {
> > > $text = <>;
> > > print $text;
> > > }
> > print while (<>);
> Geht einfacher:
> print <>;

... aber braucht uU etwas mehr Memory, als man hat *g*

root@rhb:~# time perl -e 'print <>; ' </dev/zero >/dev/null

waehrenddessen in 'top' (ca 5sec bevor der Swapspace ausgegangen ist):

8:55pm up 6 days, 19:59, 6 users, load average: 1.63, 0.96, 0.53
118 processes: 116 sleeping, 2 running, 0 zombie, 0 stopped
CPU states: 49.9% user, 42.6% system, 0.0% nice, 7.3% idle
Mem: 642968K av, 640748K used, 2220K free, 0K shrd, 1964K
buff
Swap: 1584832K av, 1497772K used, 87060K free 48000K
cached

PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME COMMAND
13674 root 19 0 1924M 515M 880 R 68.4 82.1 2:37 perl
8649 beckerra 14 0 3964 3880 3780 S 9.2 0.6 8:40 mpg123
4 root 17 0 0 0 0 DW 8.7 0.0 0:21 kswapd

'<>' im array-kontext ist sehr gefraessig!

Gruss
Raphael

--
Manchmal frage ich mich warum sogenannte Ausnahmefehler Tag für Tag die
Regel sind.                   gefunden auf www.assoziations-blaster.de

Thread

In reply to: Re: perlfrage Raphael H. Becker <Raphael.Becker@...>