Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

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":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (5)
As of 2024-04-24 12:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found