http://www.perlmonks.org?node_id=387339

dReKurCe has asked for the wisdom of the Perl Monks concerning the following question:

Greetings monks: The following is an xmms hack that logs the track listened to and its time played. Interestingly enough it created time annomolies! Any monks that have the time to spend with the following code would help this intrepid coder on his way through a journey of time. First to impliment the script tracktime, edit the command parameter in the Song_Change1.2.4(libsong_change.so) {this plugin is enabled in the previos dialouge} to include: echo %s >>/opt/www/musicpub/tracks |perl /home/japh/bin/tracktime These are accessed via OPTIONS,PREFERENCES,EFFECTS/GENERAL PLUGINS ii)The code for tracktime:
my $tracks; my $ritetime; my $philetracks; opendir(MUSICPUB, "/opt/www/musicpub/"); while (defined($tracks=readdir(MUSICPUB)){ if ($tracks=~m/tracks/){ $philetracks="/opt/www/musicpub/$tracks"; } } closedir(MUSICPUB); $ritetime=(stat($philetracks))[9]; open(TRACKS, "+<< /opt/www/musicpub/tracks"); print TRACKS "$ritetime\n"; close TRACKS
This code produced the following output upon initial testing:
311-Evolution: 1093970368 311-Freak Out: 1093970368 311-FullRide: 1093970368 311-Champagne: 1093970739 311-Hive: 1093970368
Thanks for any insight into this temporal predicament. # I'm posting my progress with the tracktime script in question. It would seem as a miscrient file created by early testing (the file was named tracks0) was somehow being matched by the first regular expression!? So, removing tracks0 from the target directory magically fisked the problem.The tracktime reported is in ascending order so futher manipulations of the difference and conversion functions can be added.Thanks for the help, as far as the regex is concerned possible explanations would be welcome. Now , back to thinking about Gauss and the number 5050....