in reply to playtime calculation
How does it work? Look in 'perlfunc' for the -s file test. Look at 'perlop' if you need help with the math operators. Look at 'perldoc -f printf' and 'perldoc -f sprintf' to see how printf works in formatting your time output. japhy#!/usr/bin/perl $filename = $ARGV[0]; # filename passed on commandline $size = (-s $filename) * 8 / 128000 / 60; ($min,$sec) = (int($size/60), $size % 60); printf "$filename is %d:%02d long\n", $min, $sec;
|
|---|