![]() ![]() ![]() ![]() ![]() ![]() |
<!--#exec cmd="cd counter;./counter.pl counter.txt counter/gifs 20 9"-->The command:
#!/usr/bin/perl ################################################################## ### Notice should be included in this program. ### ### Created by Harris / Doug ### ### © 1997 ### ################################################################## $file = $ARGV[0]; $dir = $ARGV[1]; $height = $ARGV[2]; $width = $ARGV[3]; #Get current value of counter from file open(Counter,"<$file") || die "Can't Open Counter"; flock(Counter,2); $currCount = <Counter>; close(Counter); #Increment counter and rewrite to file open(Counter,">$file") || die "Can't Open Counter"; print Counter ++$currCount; close(Counter); flock(Counter,8); #Pad counter with 0's and return html code with 6 gif digits $currCount = 0 x (6-length($currCount)) . $currCount; print ("<img src=$dir/", substr($currCount,0,1), ".gif height=$height width=$width>"); print ("<img src=$dir/", substr($currCount,1,1), ".gif height=$height width=$width>"); print ("<img src=$dir/", substr($currCount,2,1), ".gif height=$height width=$width>"); print ("<img src=$dir/", substr($currCount,3,1), ".gif height=$height width=$width>"); print ("<img src=$dir/", substr($currCount,4,1), ".gif height=$height width=$width>"); print ("<img src=$dir/", substr($currCount,5,1), ".gif height=$height width=$width>");
Updated: December 1, 2003