[Cologne-pm] open () was mache ich falsch?

Cem Sakaryali cem.sakaryali at easi.de
Sat Apr 9 10:22:54 PDT 2005


Hi Mike,

möglicherweise haben ich Dich falsch verstanden. Mit
Abbruch meine ich "code leuft nicht mehr weiter"

Dies ist bei: 

----------------------
   #!/usr/bin/perl
 
     use strict;
     use warnings;
 

foreach (0..3) {

     open F, "nothere.txt";
     my @a = <F>;
     close F;
 
     print @a;
 }

print "huhu\n";
---------------------------. 
G
c link


G
c link
----------------------

nicht der Fall. Denn "huhu" wird ausgegeben.

------------------------------------------------------
[cem at dervish ~]$ perl code.pl
readline() on closed filehandle F at code.pl line 10.
readline() on closed filehandle F at code.pl line 10.
readline() on closed filehandle F at code.pl line 10.
readline() on closed filehandle F at code.pl line 10.
huhu
---------------------------------------------------

Zuhause habe ich perl 5.8.5.

Bezueglich 5.6.0:
Bei Ford leuft die Zeit wohl anders, oder bei HP :)
Keine Ahnung wer da die Entscheidung trifft bezueglich
System update.
 

Gruss
Cem



On Sat, 2005-04-09 at 18:24 +0200, Michael Lamertz wrote:
> Oh-oh...
> 
> On Sat, Apr 09, 2005 at 10:30:49AM +0200, Cem Sakaryali wrote:
> > "warn" ist nur reingekommen weil ich sehen
> > wollte ob es nur eine Datei ist oder alle.
> > Vorgesehen ist "die" an der Stelle, wenn alles
> > läuft.
> 
> 
>     ---------- check.pl ----------
>     #!/usr/bin/perl
> 
>     use strict;
>     use warnings;
> 
>     open F, "nothere.txt";
>     my @a = <F>;
>     close F;
> 
>     print @a;
>     ---------- check.pl ----------
> 
> und 
> 
>     ---------- snip ----------
>     tweety:~$ perl check.pl
>     readline() on closed filehandle F at check.pl line 7.
>     tweety:~$
>     ---------- snip ----------
> 
> > auch mit "use strict" und "warn" gab es
> > bei mir kein Abbruch, lief bis zu Ende durch.
> > (perl 5.6.0)
> 
> Hurm:
> 
>     ---------- perldoc perlhist ----------
>     ...
>     5.6.0         2000-Mar-22
>     ...
>     5.6.2         2003-Nov-15     Fix new build issues
>     ---------- perldoc perlhist ----------
> 
> Also, 5.6.NULL geht ja wohl garnicht.
> 
> 5.8.0 kam mitte 2002 'raus, was auch schon 3 Jahre her ist.  5.8.4 ist
> aktuell.
> 
> Du bist also 5 Jahre und 1 Monat zurueck.
> 



More information about the Cologne-pm mailing list