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

I have the following script
#!/usr/local/bin/perl -w use strict; #Create global vars for paths, etc. my $temp_dir_path = "/tmp/usage"; my $temp_iso_file = "/tmp/usage_report.iso"; my $archive_name = "archive.tar"; my $mkisofs_cmd = "/usr/bin/mkisofs"; my @mkisofs_flags = ("-o $temp_iso_file","-J","-R","-v", "-V 'Usage Re +ports'", $temp_dir_path . "/" . $archive_name); if ((system $mkisofs_cmd, @mkisofs_flags) == 0) { die "Unable to make ISO image!!\n\n"; }
When I run this code, I get the following:
[root@gemOS-v007]# perl -w test.pl mkisofs 1.14 (i686-pc-linux-gnu) /usr/bin/mkisofs: No such file or directory. Unable to open disc image + file
If I run mkisofs at the command line, it works without a hitch.
/usr/bin/mkisofs -o /tmp/usage_report.iso -J -R -v -V 'Usage Reports' +/tmp/usage/archive.tar
I apparently had one too many beers last night to be able to figure this out. Thanks for any help. gnubbs

Replies are listed 'Best First'.
Re: Quick mkisofs question
by Corion (Patriarch) on Nov 04, 2004 at 15:06 UTC

    The problem is with

    "-o $temp_iso_file" # and "-V 'Usage Reports'"

    These are two parameters and you should pass them as two:

    "-o", $temp_iso_file "-V", "Usage Reports"

    This also removes the need for the quoting of some of your parameters.

      This is why I love you guys. That fixed it. Thanks. I owe you a beer at Mountain Sun in Boulder, CO if you are ever in the area.

        I envy you. I used to live in Boulder, and I miss it with all my heart. I get to return there for Hollidays, but that is simply not often enough.

        May the Force be with you
Re: Quick mkisofs question
by PodMaster (Abbot) on Nov 04, 2004 at 15:10 UTC
    `perldoc -f system'

    You're not going through the shell, so no need to quote anything

    my @mkisofts_flags = qw[ -o /tmp/usage_report.iso -J -R -v -V ], 'Usage Reports', $archive_name;

    MJD says "you can't just make shit up and expect the computer to know what you mean, retardo!"
    I run a Win32 PPM repository for perl 5.6.x and 5.8.x -- I take requests (README).
    ** The third rule of perl club is a statement of fact: pod is sexy.