www.farid-hajji.net banner

Farid Hajji

Perl: Einführung, Anwendungen, Referenz (2/e) [Support-Site]

Farid Hajji: Perl - Einführung, Anwendungen, Referenz
2., aktualisierte und erweiterte Auflage
Addison-Wesley Longman, ISBN 3-8273-1535-2

Beispielprogramm

varbind-array-bound.pl
#!/usr/local/bin/perl -w
# varbind-array-bound.pl -- Array mit Ueberpruefung der Arraygrenzen.

use ArrayBound;

$maxbound = 10;
tie @array, 'ArrayBound', $maxbound or die "can't tie Array: $!\n";

while (<DATA>) {
    ($index, $value) = split(/\s+/);
    print "Old value: ($index)", $array[$index] || "undef", "\t";
    print "New value: $value\n"; $array[$index] = $value;
}

__DATA__
5  1234
3  7723
5  9999
9  1212
17 7343
2  1121
   

[Prev] [Up] [Relevant Chapter] [Next]

[Alte Quelle]


Last modified: $Date: 2006/05/18 12:56:11 $
FH. Search :: Sitemap :: Disclaimer :: Copyright :: Privacy
FreeBSD Logo