#!/usr/bin/perl use strict ; # ALWAYS ALWAYS ALWAYS use use warnings ; # strict and warnings! Always! use CGI qw/ :standard / ; # Rather than printing the HTML. my $number_of_digits = 6; open( COUNTING, #"< D:/StronyKlientow/cematsil.bptnet.pl/main/Alicja/perl/counter.txt" "< ./counter.txt" # For my testing ) or die "can not open file: $!" ; my $count = ; chomp $count ; # You pretty much always want chomp instead of chop. close (COUNTING); $count++ ; open( COUNTING, # ">D:/StronyKlientow/cematsil.bptnet.pl/main/Alicja/perl/counter.txt" ">./counter.txt" # For my testing ) or die "Cannot open: $!\n"; print COUNTING $count ; close COUNTING ; my @digits = split( //, $count ) ; my $spline = '%0' . $number_of_digits . 'd' ; $count = sprintf( "$spline", $count ) ; my $image = '' ; my @digitcount = split( //, $count ) ; foreach my $digitimage (@digitcount) { $image .= img( { 'src' => "../obrazki/$digitimage.gif", 'vspace' => 0 } ) ; } print header, start_html( { 'bgcolor' => 'lightblue' } ) ; print table( { 'align' => 'center', 'border' => 0 }, Tr( td( { 'align' => 'center', 'valign' => 'top' }, $image ) ) ) ; print end_html ; exit;