Article View: algonet.amiga
Article #49Re: perl while()
From: Per Hedeland
Date: Sat, 16 Mar 1996 00:00
Date: Sat, 16 Mar 1996 00:00
37 lines
1735 bytes
1735 bytes
I artikel <4ie6th$mu7@prometheus.algonet.se> skriver sommar@algonet.se (Erland Sommarskog):
>Ha scritto hansmbg@algonet.se (Hans Malmberg):
>>while(<>) {
>
>"while (<>)" �r en kortform f�r:
>
> while ($_ = <STDIN>)
Inte riktigt, <> �r mer "magiskt" �n s�, anv�nder ev argument enligt
standard Unix filter-konvention - fr�n mansidan:
Input from <> comes either
from standard input, or from each file listed on the command
line. Here's how it works: the first time <> is evaluated,
the ARGV array is checked, and if it is null, $ARGV[0] is
set to '-', which when opened gives you standard input. The
ARGV array is then processed as a list of filenames.
>Vad du vill s�ga �r:
>
> while ($buffer = <TIDER>)
Varf�r inte utnyttja den beh�ndiga $_:
while (<TIDER>) {
print;
@pieces = split;
...
>Du kan ocks� skippa tidsfilen. F�ljande g�r alldeles utm�rkt:
>
> open(TIDER, "checktime -l|")
Absolut.
--Per Hedeland
per@erix.ericsson.se
Technical Details
Message-ID:
<4if4dd$n3d@euas20.eua.ericsson.se>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<1881.6649T465T198@algonet.se> <4ie6th$mu7@prometheus.algonet.se>Show Full Headers
Complete Article Headers
X-Google-Language: SWEDISH,ASCII X-Google-Thread: fad40,9305c9b365a79f4b X-Google-Attributes: gidfad40,public X-Google-Thread: 10e356,9305c9b365a79f4b X-Google-Attributes: gid10e356,public X-Google-Thread: f7a1c,9305c9b365a79f4b X-Google-Attributes: gidf7a1c,public From: per@erix.ericsson.se (Per Hedeland) Subject: Re: perl while() Date: 1996/03/16 Message-ID: <4if4dd$n3d@euas20.eua.ericsson.se> X-Deja-AN: 142780054 references: <1881.6649T465T198@algonet.se> <4ie6th$mu7@prometheus.algonet.se> organization: Ericsson Telecom, Stockholm, Sweden nntp-posting-user: per newsgroups: algonet.amiga,algonet.unix,swnet.unix