#! /usr/bin/perl use Gtk; use strict; use warnings; use File::Find; ### mp3 and wma to ogg by darklinux presents my $dir=`pwd`; chomp $dir; my @files; find(\&get_files,$dir); conver_file($_) for(@files); #== # Gtk-part #== set_locale Gtk; init Gtk; my $false = 0; my $true = 1; my $window = new Gtk::Window( "toplevel" ); my $button = new Gtk::Button( "Fertig" ); $window->signal_connect( "delete_event", \&CloseAppWindow ); $button->signal_connect( "clicked", \&CloseAppWindow ); $button->show(); $window->border_width( 15 ); $window->add( $button ); $window->show(); main Gtk; exit( 0 ); sub CloseAppWindow {  Gtk->exit( 0 );  system('exit');  return $false;  exit } #------------------------ # Subroutines #------------------------ sub convert_file{  my ($file) = @_;  my %valid = (mp3 => 4, wma => 5);  my $extension = (split(/\./,$file))[-1];  return unless($valid{$extension});  print "Checking file: $orig_file\n";  my $new_wav_file   = $orig_file;     $new_wav_file   =~ s/$extension$/wav/;  my $new_ogg_file   = $orig_file;     $new_ogg_file   =~ s/$extension$/ogg/;  my $convert_to_wav =qq~mplayer "$orig_file" -ao pcm -aofile "$new_wav_file"~;  my $convert_to_ogg = qq~oggenc -q $valid{$extension} "$new_wav_file" "$new_ogg_file"~;  print "EXEC 1: $convert_to_wav\n";  my $cmd = `$convert_to_wav`;  print "EXEC 2: $convert_to_ogg\n";     $cmd = `$convert_to_ogg`;  print "REMOVE WAV:\n";  unlink $new_wav_file;  print "REMOVE MP3:\n";  unlink $orig_file;  print "\n\n"; } sub get_files{  push(@files,$File::Find::name) if(-f $_); }# get_files