I have a main application I call tdf.pl. I use the following modules:
cp50.pm fs_ipmi.pm support_libs.pm
This application is used to perform diagnsotics on a carrier grade chassis. The problem I am seeing is this. In the main script (tdf.pl) I make a call to display_cfg(). his takes the output from a diangostic test and writes it back to the main canvas window. I make this call succesfully in the cp50.pm perl module. I attempt to make this same call in the fs_ipmi.pm module, I receive the following error message:
Can't locate pacakge tdf for @fs_ipmi::ISA at fs_ipmi line 213 (<-- wh +ere the display_cfg() sub is called...) Can't locate pacakge tdf for @support_libs::ISA at fs_ipmi.pm line 213 + (<-- redundancy here???) Tk::Error: Undefined subroutine &fs_ipmi::display_msg called at fs_ipm +i.pm line 213. Tk callback for .frame.button Tk::__ANON__ at /usr/local/lib/perl5/site_perl/5.8.6/i686-linux/Tk.p +m line 247 Tk::Button::butUp at /usr/local/lib/perl5/site_perl/5/8/6/i686-linux +/Tk/Button.pm line 111 <ButtonRelease-1> <command bound to event)
Here are my decalrations: tdf.pl -
use Tk 800.000; use Tk::DialogBox; use FileHandle; use strict; #use warnings; use support_libs; use fs_config; use fs_ipmi; require Exporter; our @EXPORT = qw(display_msg display_cfg warning_dlog MyDialog); our @ISA = qw(Exporter cp50 support_libs); @EXPORT = qw(); #--------------------------------------------------------------------- +-----------------------# # sub display_cfg() + # # This subroutine will write a simple message or text string to the me +ssage canvas than # # comprises a portion of the UI application. + # #--------------------------------------------------------------------- +-----------------------# sub display_cfg { my ($rec) = @_; my ($line) = "$rec"; $disp->insert("end", $line); }
cp50.pm:
#use strict; #use fs_config; use fs_config; use fs_ipmi; use Getopt::Long;
fs_ipmi.pm:
package fs_ipmi; require Exporter; @ISA = qw(Exporter tdf support_libs); @EXPORT = qw(GetDebugInfo ReserveDPV DeleteDPV SetPowerState SetResetState SetControlState GetControlState GetSensorReading RestoreFactoryDefaults StoreParameters SetAudibleState GetEventReceiver GetSensorThresholds SetSensorThresholds GetSensorEventEnable SetSensorEventEnable GetSlotGA GetDeviceID SServerUp Slot2HexAdrs GetPERStatus GetDebugInfo SetRelayState GetRelayState Fast_fs_ipmi GetSELInfo ReserveSEL ClearSEL GetSELTime SetSELTime GetIPMIEnableState); support_libs.pm: package support_libs; use Exporter; our @EXPORT = qw(write_dlog defineBlades debug_ip convert_slot System_ +tests chassis_status); our @ISA = qw(Exporter tdf); use Switch; use fs_ipmi; use Tk 800.00; use Tk::DialogBox;
Thank you in advance. Sorry if this is long-winded.

Joe


In reply to Scope issue in perl/tk application by joec

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.