perl & symbash telous grammhs

Alejandros Diamandidis adia at auth.gr
Thu May 22 17:51:11 EEST 1997


Geia soy Menelae,

>an sou einai eukolo steilto kai se emena etsi wste na to dokimasw kai stin
>Amiga ....

An den kanw lathos h Amiga xrhsimopoiei to idio telos grammhs me to
Unix, svsta; (dhladh LF) Opote mallon tha prepei na doyleyei.
Telika elysa to problhma opws eixa pei sthn arxh, to sxetiko kommati
toy kwdika akoloythei:


open COF, "filename.txt";

do { $char=getc COF } until ($char eq "\r" or $char eq "\n");
$/=$char;
$char=getc COF;
if (($char eq "\r" or $char eq "\n") and $char ne $/) { $/ .= $char }
seek(COF, 0, 0);

while (<COF>)
{
# do whatever...
}

Skefthka na mh steilw olo to script gia pio eykola. Ayto
poy kanw einai na diabazw xarakthres mexri na synanthsw ena CR 'h
ena LF. Ayto to thetw sth metablhth $/ (poy periexei to string poy
diaxwrizei tis grammes). Meta, an o epomenos xarakthras einai
CR 'h LF, kai einai diaforetikos apo ton prohgoymeno, ton prosthetei
ki ayton sto $/. To programma dhladh katalabainei tis periptwseis
<CR> sketo (Mac), <LF> sketo (Unix), <CR> <LF> (MSDOS), kai <LF> <CR>.
Afoy ta kanei ayta, epistrefei sthn arxh toy arxeioy kai arxizei na to
diabazei grammh-grammh.

To mono pragma poy me anhsyxei sto parapanw kommati kwdika einai to ejhs:
to "\n" einai eggyhmena LF (0x0A) se ola ta systhmata poy trexoyn perl,
'h mhpws an to trejeis se dos metatrepetai se CR LF kai sto Mac ginetai CR;

>filika
>Menis Malaxianakis
>ps: sto Amiga World Show sto Londino trexan beta ekdoseis se PowerUp
>(PPC603e+68060 !!!)

Beta ekdoseis tinos pragmatos; Bghkan kainoyries Amiges me PPC;

Filika, Alejandros

-- 
Alejandros Diamandidis * adia at auth.gr

--
====================================================================
Gia na mathete pos na xrisimopoiite ton majordomo, stilte e-mail
sto "majordomo at argeas.argos.hol.gr" me 1 grammi sto keimeno: help
Ta archives tis listas einai sto http://www.argos.hol.gr/lists
Gia opoiodipote problima stilte  e-mail ston owner-linux-greek-users
====================================================================



More information about the Linux-greek-users mailing list