Hi PerlMonks,

I am a beginner in perl programming. I have tried to create the first GUI using the hello.pl program. But I am getting an error in cmd like "Can't locate loadable object for module Tk::Event in @INC (@INC contains: C:/Per l/site/lib C:/Perl/lib .) at C:/Perl/lib/Tk.pm line 13". I have given the script of hello.pl and the Event.pm below. I am looking for help from perlmonks to sort out this problem in creating the GUI using hello.pl.

The code of hello.pl is given below:

#!/usr/local/bin/perl use Tk; # Main Window my $mw = new MainWindow; my $label = $mw -> Label(-text=>"Hello World") -> pack(); my $button = $mw -> Button(-text => "Quit", -command => sub {exit}) -> pack(); MainLoop;

I have used the following Event.pm within Tk directory of perl lib installed in C drive of my laptop:

package Tk::Event; use vars qw($VERSION $XS_VERSION @EXPORT_OK); END { CleanupGlue() } $VERSION = sprintf '4.%03d', q$Revision: #15 $ =~ /\D(\d+)\s*$/; $XS_VERSION = '804.027'; use base qw(Exporter); use XSLoader; @EXPORT_OK = qw($XS_VERSION DONT_WAIT WINDOW_EVENTS FILE_EVENTS TIMER_EVENTS IDLE_EVENTS ALL_EVENTS); XSLoader::load 'Tk::Event',$XS_VERSION; require Tk::Event::IO; 1; __END__

I am getting the following error message again and again in cmd window.

Microsoft Windows [Version 6.1.7600] Copyright (c) 2009 Microsoft Corporation. All rights reserved. C:\Users\x>cd desktop C:\Users\x\Desktop>hello.pl Can't locate loadable object for module Tk::Event in @INC (@INC contai +ns: C:/Per l/site/lib C:/Perl/lib .) at C:/Perl/lib/Tk.pm line 13 Compilation failed in require at C:/Perl/lib/Tk.pm line 13. BEGIN failed--compilation aborted at C:/Perl/lib/Tk.pm line 13. Compilation failed in require at C:\Users\x\Desktop\hello.pl line 2. BEGIN failed--compilation aborted at C:\Users\x\Desktop\hello.pl line +2. C:\Users\x\Desktop>

In reply to Where am I going wrong in the code for creating the first GUI using hello.pl? by supriyoch_2008

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.