in reply to Subroutine redefined Error

Unless you have a very broken Perl installation, the code that you show can not generate the errors that you list. Tell us about how you installed Perl, its version, and how you install modules.

On a more general note, and unrelated (probably) to your immediate problem, always use strictures (use strict; use warnings;).


True laziness is hard work

Replies are listed 'Best First'.
Re^2: Subroutine redefined Error
by mld (Acolyte) on Mar 27, 2009 at 11:00 UTC

    I installed ActivePerl-5.8.4.810-MSWin32-x86 into my system. Then I trie to install Tk, the error is thrown it is already installed.But whereas when I tru to run the above said error message uis displayed.

    After ur reply I tried uninstalling perl and reinstalled and once again repeated the above scenario. The same error message appeared.

      I installed ActivePerl-5.8.4.810-MSWin32-x86 into my system.
      Why? Thats from 17-Jun-2004
      There is something wrong in your installation. I dunno what, but I've used Tk with ActiveState 5.6, 5.8 and 5.10.

      I recommend to start over and USE THE ActiveState installer, their ppm (Perl Package Manager) program to get Tk. If a module is available on the ActiveState site, using their installation program is the easiest way to go. I tested this code on my machine and it works fine.

      #!/usr/bin/perl -w use strict; use Tk; my $mwin = MainWindow->new(); $mwin->title("Hello"); MainLoop(); ###oh, this is important to start ###the GUI!!!!!

      Try uninstalling 5.8.4 and install 5.8.8 instead. Note that last time I checked Tk wasn't available as a ppm from ActiveState or from the other repositories I generally use for 5.10.


      True laziness is hard work
        Or v5.8.9
        I think the latest ActiveState is fine with basic Tk.
        Here is what I'm using:
        C:\Projects>perl -v This is perl, v5.10.0 built for MSWin32-x86-multi-thread (with 5 registered patches, see perl -V for more detail) Copyright 1987-2007, Larry Wall Binary build 1004 [287188] provided by ActiveState http://www.ActiveState.com Built Sep 3 2008 13:16:37