Skip to content

FindBin doesn't find the assets correctly on Install #7

Open
kthakore opened this Issue Aug 7, 2011 · 3 comments

3 participants

@kthakore
Owner
kthakore commented Aug 7, 2011

error loading image /home/kthakore/.perl5/perls/perl-5.12.2/bin/../data/zombie.bmp: Couldn't open /home/kthakore/.perl5/perls/perl-5.12.2/bin/../data/zombie.bmp at /home/kthakore/.perl5/perls/perl-5.12.2/lib/site_perl/5.12.2/x86_64-linux-thread-multi/SDLx/Surface.pm line 166
SDLx::Surface::load('SDLx::Surface', '/home/kthakore/.perl5/perls/perl-5.12.2/bin/../data/zombie.bmp') called at lib/ZT/Actor/Zombie.pm line 13
require ZT/Actor/Zombie.pm called at /home/kthakore/.perl5/perls/current/bin/zombie-demo.pl line 21
main::BEGIN() called at lib/ZT/Actor/Zombie.pm line 0
eval {...} called at lib/ZT/Actor/Zombie.pm line 0
Compilation failed in require at /home/kthakore/.perl5/perls/current/bin/zombie-demo.pl line 21.
BEGIN failed--compilation aborted at /home/kthakore/.perl5/perls/current/bin/zombie-demo.pl line 21.

@FROGGS
Collaborator
FROGGS commented Aug 7, 2011

should we use File::ShareDir?

@jtpalmer
Collaborator
jtpalmer commented Aug 8, 2011

I like the way Zumbis solves this problem. It looks for a file that is only present when not installed and uses FindBin if it finds it, File::ShareDir otherwise.

See https://github.com/ruoso/Zumbis/blob/master/lib/Games/Zumbis.pm#L11

@kthakore
Owner
kthakore commented Aug 8, 2011

I refactored the places we use FindBin just to one place https://github.com/kthakore/Zombie-Trap/blob/master/lib/ZT/Util.pm#L7 we can just change it there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.