[vienna.pm] die Welt ist so ungerecht :-(

Michael Demelbauer michael at wsr.ac.at
Thu Apr 20 09:42:32 CDT 2000


* * * vienna-pm-list * * *



Hallo,

ich habe eine Eingabetabelle wiefolgt:

1 Hans 27 133 A
2 Michael 33 213 A
3 Reiner  21 222 C
4 Robert 23 133 D

Wenn ich folgendes Mickymausprogramm summe.pl

#!/usr/bin/perl -wan
use strict;
BEGIN() { my $summe = 0; }
$summe += $F[2];
END() { print "$summe\n"; }

(-an gibt lt. Buch dem perl ein awk-ähnliches Verhalten) auf die
Tabelle ausführe, kommt:

Global symbol "$summe" requires explicit package name at
/home/michael/perl/summe.pl line 7.
Execution of /home/michael/perl/summe.pl aborted due to compilation
errors.

Kommentiere ich 'use strict;' aus, dann gehts, und die korrekte Summe
104 wird ausgegeben. Fühle mich leicht verarscht :-( .

lG, frohe Ostern
Michl
-- 
			  Michael P. Demelbauer
	   WSR (Wirtschafts- und Sozialwissenschaftliches Rechenzentrum)
			  LUGA (Linux User Group Austria)
    "Reality is that which, when you stop believing in it, doesn't go away".
			       -- Philip K. Dick
###
You are subscribed to vienna-pm-list as Michael Demelbauer <michael at wsr.ac.at>
http://www.fff.at/fff/vienna.pm/



More information about the Vienna-pm mailing list