Need help running babel-infocom.pl

First of all I do not know perl but I downloaded the babel-infocom perl script to allow me to pack my Infocom Story files into blorb files. I have compiled all the external tools I need for the script but when I run the script it does nothing.
This is the page I got the tool and instructions from:
babel.ifarchive.org/infocom.html

I am running Ubuntu 10.10 amd64 with Perl v5.10.1 (*) built for x86_64-linux-gnu-thread-multi.

#!/usr/bin/perl

# Babel-infocom is a special-purpose script for bundling infocom games
#
# usage: babel-infocom.pl [-from dir] file[s]
#
#
# If specified, it will look in the -from dir for the infocom
# metadata collection.  the from-directory should end in your platform's
# directory separator (so "babel-infocom.pl -from data/ foo.z5")
#
# This program will search the infocom metadata collection for
# the corresponding metadata for your game, and create a
# blorb bundle containing cover art and metadata.
#
# Requires babel, babel-get, and ifiction-xtract from babel.
#
# For the infocom games with multimedia, babel-infocom will also combine
# the story file with its multimedia resources.  This functionality requires
# bmerge, which is available at http://www.trenchcoatsoft.com/downloads/iblorbs.zip
#


$held_mode=0;
$fromdir= "";
$BABEL = "babel";
$BMERGE = "bmerge";
$IFIX = "ifiction-xtract";
$BABELGET = "babel-get";

foreach $file (@ARGV)
{
 if ($file eq "-from")
 {
  $held_mode=1;
  next;
 }
 if ($held_mode)
 {
  $fromdir=$file;
  $held_mode=0;
  next;
 }
next if $file =~ m/.iFiction$/i;
next if $file =~ m/.png$/i;
next if $file =~ m/.jpg$/i;
next if $file =~ m/.[zg]?blorb$/i;

$fmt = `$BABEL -format $file`;
next if $fmt =~ m/Error:/;
next if $fmt =~ m/non-authoritative/;
next if $fmt =~ m/Format: executable/;
next if !($fmt =~ m/.+/);

print "$file: ";

$ifid = `$BABEL -ifid $file`;
$ifid =~ s/^IFID: //;
$ifid =~ s/IFID: .+//;
$ifid =~ s/\n//;
chomp($ifid);

# find ifiction
if (-e "$fromdir$ifid.iFiction")
{
 $ifiction="$fromdir$ifid.iFiction";
}
elsif (-e "$fromdir"."babel.iFiction")
{
 $str="$BABELGET -ifiction $ifid -ifiction $fromdir"."babel.iFiction > temp.iFiction";

 system($str);
 $ifiction="temp.iFiction";
}
else
{
 print "No iFiction record found.\n";
 next;
}
$cifid=`$IFIX $ifiction identification ifid`;
#print "$IFIX $ifiction identification ifid\n";
#print "$cifid\n";
chomp($cifid);
# find cover
if (-e "$fromdir$ifid.png")
{
 $cvr="$fromdir$ifid.png";
}
elsif (-e "$fromdir$ifid.jpg")
{
 $cvr="$fromdir$ifid.jpg";
}
elsif (-e "$fromdir$cifid.png")
{
 $cvr="$fromdir$cifid.png";
}
elsif (-e "$fromdir$cifid.jpg")
{
 $cvr="$fromdir$cifid.jpg";
}
else { $cvr=""; }

$blorb_mode=0;
print "$fromdir$cifid.blorb\n";
if (-e "$fromdir$cifid.blorb")
{
 $blorb_mode="$fromdir$cifid.blorb";
}
print "Bundling with $ifiction $cvr\n";
if ($blorb_mode)
{
 system("$BABEL -blorb $file $ifiction");
 $file =~ s/\..+$/\.zblorb/;
 system("$BMERGE $ifid.zblorb $blorb_mode $file");
 unlink("$ifid.zblorb");
}
else
{
 system("$BABEL -blorbs $file $ifiction $cvr");
}
if ($ifiction eq "temp.iFiction") { unlink($ifiction); }


}

No output at all? At first glance, it looks like you’ll get no output if you don’t specify a file name as an argument… how did you kick off the script (full command please)?

The full command I used for my test runs was:
./babel-infocom.pl -from ./data ./Zork\ 1.z3

I get no output and no files are created once I’m returned to the command prompt.
I also get nothing when I tried “./babel-infocom.pl” & “./babel-infocom.pl --help”

And just to make sure, are those external tools in your PATH? You’ll need at least these three:

$ which babel babel-get ifiction-xtract /usr/local/bin/babel /usr/local/bin/babel-get /usr/local/bin/ifiction-xtract
You may also need to rename the iFiction records file (note the capital “F”).

$ mv data/babel.ifiction data/babel.iFiction

I think the script itself is fine (if terse); the trick is pre-arranging everything to meet its expectations.

I didn’t think that I needed to install the tools so I modified the perl script to:

$fromdir= "./data/";
$BABEL = "./babel";
$BMERGE = "./bmerge";
$IFIX = "./ifiction-xtract";
$BABELGET = "./babel-get";

And renamed babel.ifiction to babel.iFiction.
And now it works as long as there are no spaces in the story files name.
I don’t have to specify the data directory as it is now in the script, so it ran fine with this:
./babel-infocom.pl Zork1.z3

Thank you for your help.

Edit:
http://www.mediafire.com/?cfl2c7p7ud1vbf8
I uploaded all the tools just encase anyone else needed all this set-up already, but it was all compiled amd64 so probably won’t work on i386. Also blorbalize is included to check that blorbs produced are ok.