Expand|Select|Wrap|Line Numbers
- #!usr/bin/perl
- use strict;
- no strict "vars";
- use warnings;
- use DBI;
- $dbh = DBI->connect('dbi:mysql:audio', 'root', 'ajitteli')
- or die "connection error: $DBI::errstr\n";
- print "Enter the number of songs to be played: ";
- my $num = <stdin>;
- for (my $i=1; $i<=$num; $i++) {
- $sql = "select file_path from audio_table where id like $i";
- $sth = $dbh->prepare($sql);
- $sth->execute
- or die "SQL Error: $DBI::errstr\n";
- #use IPC::open3;
- # my %videoInfo = videoInfo($sth);
- # $durtn = $videoInfo{'durationsecs'};
- while (@row =$sth->fetchrow_array) {
- print "\n\nPlaying song $i\n\n";
- print `vlc "@row"`;
- print "song$i stopped\n";
- sleep 10;
- print `vlc://quit`;
- }