perl/tk unable to display png (+upgrade problem)

Mojca Miklavec mojca.miklavec.lists at
Wed Jun 15 14:46:19 PDT 2011


I have a problem with Perl/Tk programs. Perl doesn't display any PNG
image in the same program that works fine under linux. Here is the
minimal example:

$^W = 1;
use Tk;
use Tk::PNG;
my $mw = Tk::MainWindow->new;
my $img = $mw->Photo(-format => 'png', -file => "texlive.png");
$mw->Label(-image => $img, -background => "#0078b8")->pack();

(you may replace the filename with an arbitrary PNG image)

I'm using perl 5.8. I tried to upgrade to 5.12, but I don't know how
to do that (I don't understand the error).

> sudo port upgrade outdated
--->  Computing dependencies for apache2
--->  Dependencies to be installed: perl5
--->  Activating perl5 @5.12.3_1+perl5_12
Error: Target org.macports.activate returned: Image error:
/opt/local/bin/a2p is being used by the active perl5.8 port.  Please
deactivate this port first, or use 'port -f activate perl5' to force
the activation.
Error: Failed to install perl5
Log for perl5 is at:
Error: The following dependencies were not installed: perl5
Error: Unable to upgrade port: 1
To report a bug, see <>

Thank you,

More information about the macports-users mailing list