Thread Zähler - Variablen mit "001"
(8 answers)
Opened by utang at 2004-04-22 23:11 Code (perl): (dl
)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 #!/usr/bin/perl -l use strict; use warnings; { package Zaehler; use Tie::Scalar; use vars '@ISA'; push @ISA, 'Tie::StdScalar'; sub FETCH { my $self = shift; return sprintf('%03d', $$self); } } my $zaehler; tie $zaehler, 'Zaehler', 8; print $zaehler; $zaehler ++; print $zaehler; <!--EDIT|betterworld|1082725980--> Lieblingsmodule: IPC::System::Simple, Path::Class
|