Trying to compile MP3::Info gives errors

Trying to compile MP3::Info gives errors

am 12.12.2005 11:17:16 von Philipp

Hello
I try to compile a perl script into a win32 executable using the PAR
packager. The script uses the module MP3::Info which seems to be the
problem. The smallest code which make the problem is:

#### Perl code in file hello.pl
use MP3::Info;
$mp3InfoHashRef = get_mp3info("C:\123.mp3");
$bitR = $mp3InfoHashRef->{'BITRATE'};
print "bitR: $bitR";
#### End of Perl code


On compile I get

>p2e hello.pl
Processing 'MP3::Info'
Processing 'strict'
Processing 'Carp'
Processing 'Carp::Heavy'
Processing 'warnings'
Processing 'Exporter'
Processing 'Exporter::Heavy'
Processing 'overload'
Processing 'Scalar::Util'
Processing 'List::Util'
Processing 'DynaLoader'
Error while creating Module::Info object for 'Mac::FileSpec::Unixish' at
C:/Perl/site/lib/App/Packer/Frontend/ModuleInfo.pm line 123.
Processing 'vars'
Processing 'warnings::register'
Processing 'AutoLoader'
Processing 'Config'
Processing 'Encode::Guess'
Processing 'base'
Processing 'bytes'
Processing 'bytes_heavy.pl'
B::Module::Info,modules_used use failed with 9 saying:
Undefined subroutine &bytes::import called at C:\Perl\lib\bytes_heavy.pl
line 4.

BEGIN failed--compilation aborted at C:\Perl\lib\bytes_heavy.pl line 4.
Writing 'my.exe'



Can someone tell me what's wrong?

I guess the first error is for some Macintosh things I am not interested
in (as I'm on win 2000). But I can't figure out the second error. Any
input is welcome.

Thanks and best regards Phil

Re: Trying to compile MP3::Info gives errors

am 12.12.2005 11:23:22 von Philipp

Sorry that code should have been:

#### Perl code in file hello.pl
use MP3::Info;
$mp3InfoHashRef = get_mp3info("C:\\123.mp3");
$bitR = $mp3InfoHashRef->{'BITRATE'};
print "bitR: $bitR";
#### End of Perl code

(forgot the second backslash \\ he he)
But still no difference on the compiling.

Re: Trying to compile MP3::Info gives errors

am 12.12.2005 12:28:25 von Sisyphus

"Philipp" wrote in message
news:439d4e24$1@epflnews.epfl.ch...
> Hello
> I try to compile a perl script into a win32 executable using the PAR
> packager. The script uses the module MP3::Info which seems to be the
> problem. The smallest code which make the problem is:
>
> #### Perl code in file hello.pl
> use MP3::Info;
> $mp3InfoHashRef = get_mp3info("C:\\123.mp3");
> $bitR = $mp3InfoHashRef->{'BITRATE'};
> print "bitR: $bitR";
> #### End of Perl code
>
>
> On compile I get
>
> >p2e hello.pl
[errors snipped]

What is 'p2e' ? I get:

'p2e' is not recognized as an internal or external command, operable program
or batch file.

I tried using one of the mp3 files that come with MP3::Info (as I don't have
C:\123.mp3):

use warnings;
use MP3::Info;
$mp3InfoHashRef = get_mp3info("D:\\comp58_M\\MP3-Info-1.13\\t\\test1.mp3");
$bitR = $mp3InfoHashRef->{'BITRATE'};
print "bitR: $bitR";

When run as a perl script that produces:

bitR: 128

I then built the excutable using PAR's pp utility with:

pp -o hello.exe hello.pl

When I run 'hello.exe' I get the same output:

bitR: 128

That is - I can't reproduce the problem you're facing.

(I'm using PAR-0.90 on Windows2000 with perl 5.8.7.)

Cheers,
Rob

Re: Trying to compile MP3::Info gives errors

am 12.12.2005 13:00:54 von Philipp

Sisyphus wrote:
> "Philipp" wrote in message
> news:439d4e24$1@epflnews.epfl.ch...
>
>>Hello
>>I try to compile a perl script into a win32 executable using the PAR
>>packager. The script uses the module MP3::Info which seems to be the
>>problem. The smallest code which make the problem is:
>>
>>#### Perl code in file hello.pl
>>use MP3::Info;
>>$mp3InfoHashRef = get_mp3info("C:\\123.mp3");
>>$bitR = $mp3InfoHashRef->{'BITRATE'};
>>print "bitR: $bitR";
>>#### End of Perl code
>>
>>
>>On compile I get
>>
>> >p2e hello.pl
>
> [errors snipped]
>
> What is 'p2e' ? I get:
>
> 'p2e' is not recognized as an internal or external command, operable program
> or batch file.
>
> I tried using one of the mp3 files that come with MP3::Info (as I don't have
> C:\123.mp3):
>
> use warnings;
> use MP3::Info;
> $mp3InfoHashRef = get_mp3info("D:\\comp58_M\\MP3-Info-1.13\\t\\test1.mp3");
> $bitR = $mp3InfoHashRef->{'BITRATE'};
> print "bitR: $bitR";
>
> When run as a perl script that produces:
>
> bitR: 128
>
> I then built the excutable using PAR's pp utility with:
>
> pp -o hello.exe hello.pl
>
> When I run 'hello.exe' I get the same output:
>
> bitR: 128
>
> That is - I can't reproduce the problem you're facing.
>
> (I'm using PAR-0.90 on Windows2000 with perl 5.8.7.)

Hello Rob,

Thanks for your answer which brought me to review the whole thing. I
missunderstood what App::Packer does.
I thought it would compile my script in a win32 exe, but it actually
just wraps the script in a bundle and you still need a perl interpreter
on the machine to execute it. So p2e.pl is part of that App::Packer and
has nothing to do with pp from PAR (sorry about that).

I'll try to install PAR and make it work (as a perlcc compilation failed
as well).

Best regards
Phil

Re: Trying to compile MP3::Info gives errors

am 13.12.2005 09:46:29 von Bart Lateur

Philipp wrote:

>$mp3InfoHashRef = get_mp3info("C:\123.mp3");

Double that backslash please. Or use a forward slash.

--
Bart.