From: Brian R. (G. H. School) <Row...@gr...> - 2007-06-05 10:27:17
|
Hi nice people I've written my first GUI using The GUI Loft and all works fine except I get the following warnings: 'use Win32::GUI;' is currently exporting constants into the callers scope. This functionality is deprecated. Use 'use Win32::GUI();' or list your required exports explicitly instead. at C:/Perl/site/lib/Win32/GUI/Loft/Design.pm line 31 'use Win32::GUI;' is currently exporting constants into the callers scope. This functionality is deprecated. Use 'use Win32::GUI();' or list your required exports explicitly instead. at C:/Perl/site/lib/Win32/GUI/ToolbarWindow.pm line 23 'use Win32::GUI;' is currently exporting constants into the callers scope. This functionality is deprecated. Use 'use Win32::GUI();' or list your required exports explicitly instead. at C:/Perl/site/lib/Win32/GUI/BorderlessWindow.pm line 24 'use Win32::GUI;' is currently exporting constants into the callers scope. This functionality is deprecated. Use 'use Win32::GUI();' or list your required exports explicitly instead. at C:/Perl/site/lib/Win32/GUI/Loft/Cluster.pm line 21 'use Win32::GUI;' is currently exporting constants into the callers scope. This functionality is deprecated. Use 'use Win32::GUI();' or list your required exports explicitly instead. at C:/Perl/site/lib/Win32/GUI/AdHoc.pm line 31 'use Win32::GUI;' is currently exporting constants into the callers scope. This functionality is deprecated. Use 'use Win32::GUI();' or list your required exports explicitly instead. at C:/Perl/site/lib/Win32/GUI/Loft/Control/ListView.pm line 22 'use Win32::GUI;' is currently exporting constants into the callers scope. This functionality is deprecated. Use 'use Win32::GUI();' or list your required exports explicitly instead. at C:/Perl/site/lib/Win32/GUI/Loft/Control/TabStrip.pm line 23 'use Win32::GUI;' is currently exporting constants into the callers scope. This functionality is deprecated. Use 'use Win32::GUI();' or list your required exports explicitly instead. at C:/Perl/site/lib/Win32/GUI/TabStripGroup.pm line 25 'use Win32::GUI;' is currently exporting constants into the callers scope. This functionality is deprecated. Use 'use Win32::GUI();' or list your required exports explicitly instead. at C:/Perl/site/lib/Win32/GUI/HyperLink.pm line 6 Q1: Can someone advise as to the best way to overcome this issue please or must I just turn off warnings using: no warnings 'deprecated'; BTW, SourceForge say to either A) use Win32::GUI(); when not using constants B) explicitly name them if you are using constants=20 Q2: Since constants are being used how do I tell what need to be named? Thanks Brian Rowlands We must accept finite disappointment, but we must never lose infinite hope. Martin Luther King Jr. </quotes/k/martinlutherking/> =20 |
From: Robert M. <rob...@us...> - 2007-06-05 20:32:19
|
On 05/06/07, Brian Rowlands (Greymouth High School) <Row...@gr...> wrote: > I've written my first GUI using The GUI Loft and all works fine except I get > the following warnings: > > 'use Win32::GUI;' is currently exporting constants into the callers scope. > This functionality is deprecated. Use 'use Win32::GUI();' or list your > required exports explicitly instead. at > C:/Perl/site/lib/Win32/GUI/Loft/Design.pm line 31 > C:/Perl/site/lib/Win32/GUI/ToolbarWindow.pm line 23 > C:/Perl/site/lib/Win32/GUI/BorderlessWindow.pm line 24 > C:/Perl/site/lib/Win32/GUI/Loft/Cluster.pm line 21 > C:/Perl/site/lib/Win32/GUI/AdHoc.pm line 31 > C:/Perl/site/lib/Win32/GUI/Loft/Control/ListView.pm line 22 > C:/Perl/site/lib/Win32/GUI/Loft/Control/TabStrip.pm line 23 > C:/Perl/site/lib/Win32/GUI/TabStripGroup.pm line 25 > C:/Perl/site/lib/Win32/GUI/HyperLink.pm line 6 > > Q1: Can someone advise as to the best way to overcome this issue please or > must I just turn off warnings using: > no warnings 'deprecated'; That's the easiest way, but it only masks the problem. We're in a deprecation cycle, and in one of the next releases Win32::GUI will stop exporting the constants by default, and then if any of these modules rely on the constants being exported, they will fail. The best solution is to bug the module authors (and I'm the Win32::GUI::HyperLink author) to fix their modules; or better yet provide them with patches. > BTW, SourceForge say to either > A) use Win32::GUI(); when not using constants > B) explicitly name them if you are using constants > > Q2: Since constants are being used how do I tell what need to be named? If all the modules have use strict; near the start, then just change the use Win32::GUI; line to use Win32::GUI qw(); and re-run you script - it will fail to compile for each constant, and add it use Win32::GUI qw(YOUR_CONSTANT_HERE); If a module doesn't 'use strict' then it's harder, and you'll have to look through the code for the constants. An (easier) alternative is to change each use Win32::GUI; line into use Win32::GUI qw(:compatibility_win32_gui) which will cause Win32::GUI to keep exporting the 300+ constants into the caller's namespace without warning. But this doesn't really solve the problem either .... Regards, Rob. |
From: Octavian R. <ora...@gm...> - 2007-06-06 05:57:09
|
Hi, Where can we find details about all those constants? (I hope not on MSDN. :-) Thanks. Octavian ----- Original Message ----- From: "Robert May" <rob...@us...> To: "Brian Rowlands (Greymouth High School)" <Row...@gr...> Cc: <per...@li...> Sent: Tuesday, June 05, 2007 11:32 PM Subject: Re: [perl-win32-gui-users] Deprecated Constants > On 05/06/07, Brian Rowlands (Greymouth High School) > <Row...@gr...> wrote: >> I've written my first GUI using The GUI Loft and all works fine except I >> get >> the following warnings: >> >> 'use Win32::GUI;' is currently exporting constants into the callers >> scope. >> This functionality is deprecated. Use 'use Win32::GUI();' or list your >> required exports explicitly instead. at >> C:/Perl/site/lib/Win32/GUI/Loft/Design.pm line 31 >> C:/Perl/site/lib/Win32/GUI/ToolbarWindow.pm line 23 >> C:/Perl/site/lib/Win32/GUI/BorderlessWindow.pm line 24 >> C:/Perl/site/lib/Win32/GUI/Loft/Cluster.pm line 21 >> C:/Perl/site/lib/Win32/GUI/AdHoc.pm line 31 >> C:/Perl/site/lib/Win32/GUI/Loft/Control/ListView.pm line 22 >> C:/Perl/site/lib/Win32/GUI/Loft/Control/TabStrip.pm line 23 >> C:/Perl/site/lib/Win32/GUI/TabStripGroup.pm line 25 >> C:/Perl/site/lib/Win32/GUI/HyperLink.pm line 6 >> >> Q1: Can someone advise as to the best way to overcome this issue please >> or >> must I just turn off warnings using: >> no warnings 'deprecated'; > > That's the easiest way, but it only masks the problem. We're in a > deprecation cycle, and in one of the next releases Win32::GUI will > stop exporting the constants by default, and then if any of these > modules rely on the constants being exported, they will fail. > > The best solution is to bug the module authors (and I'm the > Win32::GUI::HyperLink author) to fix their modules; or better yet > provide them with patches. > >> BTW, SourceForge say to either >> A) use Win32::GUI(); when not using constants >> B) explicitly name them if you are using constants >> >> Q2: Since constants are being used how do I tell what need to be named? > > If all the modules have > use strict; > near the start, then just change the > use Win32::GUI; > line to > use Win32::GUI qw(); > and re-run you script - it will fail to compile for each constant, and add > it > use Win32::GUI qw(YOUR_CONSTANT_HERE); > > If a module doesn't 'use strict' then it's harder, and you'll have to > look through the code for the constants. > > An (easier) alternative is to change each > use Win32::GUI; > line into > use Win32::GUI qw(:compatibility_win32_gui) > which will cause Win32::GUI to keep exporting the 300+ constants into > the caller's namespace without warning. But this doesn't really solve > the problem either .... > > Regards, > Rob. > > ------------------------------------------------------------------------- > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > _______________________________________________ > Perl-Win32-GUI-Users mailing list > Per...@li... > https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users > http://perl-win32-gui.sourceforge.net/ |