CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Need a Custom or Prewritten Perl Program?: I need a program that...: Runs mp4box with command lines: Edit Log



sderenzi
New User

Sep 25, 2007, 12:54 AM


Views: 2021
Runs mp4box with command lines

It's simple, I want to run mp4box on OS X, I've found a precompiled version for the PPC and I asked a fellow if he could make me a perl script that would run the following on any .aac files inside a folder.

mp4box -add filename.aac filename.m4a

It's very easy to do manually but there's like 300 files in the folder, could someone help fix this script cuz I can't figure out why it doesn't work, here's what it looks like:


Code
#!/usr/bin/perl 

use File::Find;

$basedir = "<path-to-your-folder>";

find( sub {
next unless /(.*)\.aac$/;
$fn = $1;
$cmd = qq(mp4box -add "$fn.aac" "$fn.m4a");
print "$cmd\n"
system $cmd;
}, $basedir );


Now the error I get is:


Quote
syntax error at line 12, near "system" Execution of run.pl aborted due to compilation errors


So what am I missing? Basically it's searching for any files that are in the directory which are .aac, then it goes on to place them in the full command mp4box -add filename.aac filename.m4a

Can someone fix this?


(This post was edited by sderenzi on Sep 25, 2007, 12:57 AM)


Edit Log:
Post edited by sderenzi (New User) on Sep 25, 2007, 12:55 AM
Post edited by sderenzi (New User) on Sep 25, 2007, 12:56 AM
Post edited by sderenzi (New User) on Sep 25, 2007, 12:57 AM
Post edited by sderenzi (New User) on Sep 25, 2007, 12:57 AM


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives