#!/usr/bin/perl # # kleines (Spaß)programm: Wie lang ist diese Datei als Lochstreifen? # Benutzung: # ./programm.pl [datei1] [datei2] [datei3] [usw...] # my $total_l = 0; my $l; foreach (@ARGV) { $l = (stat)[7]; print "$_: $l bytes = ".bytes2cm($l)." cm\n"; $total_l += $l; } print "total: $total_l bytes = ".bytes2cm($total_l)." cm\n" unless($l eq $total_l); # nur ein Argument. sub bytes2cm { my $bytes = shift; # inch = $bytes/10; # centimeter = inch / 2.54 my $cm = ($bytes / 10) * 2.54; }