Bookmarks

Yahoo Gmail Google Facebook Delicious Twitter Reddit Stumpleupon Myspace Digg

Search queries

sqldatasource dal, wwwxxxenden, convert raid5 to raid 10 mdadm, apache force chunked, nrao wwwxxx, xxxxxdup, procmail change subject header, wwwXxx not20, Wwwxxx.doks sas, linux raid resync after reboot

Links

XODOX
Impressum

#1: Cosmetic questions: order of module use significant? double

Posted on 2011-07-19 16:20:08 by Deane.Rothenmaier

--===============0470131847==
Content-Type: multipart/alternative;
boundary="_000_115007D93766724DAE9F518846E121DE931AACDMSS8MP 2MBwagreso_"
Content-Language: en-US

--_000_115007D93766724DAE9F518846E121DE931AACDMSS8MP2MBwagre so_
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset="us-ascii"

Hi, wizards.

I went through my dead-tree library, CPAN, and other places, and found noth=
ing that answers this question, so I'm going to kick it out to the communit=
y...

Question one: I've inherited a program (if it matters, the program's compil=
ed to an executable, rather than run by the interpreter) that uses about a =
dozen different modules and, picky soul that I am, I'd like to list them in=
alphabetic order rather than all higgledy-piggledy as they are now. Is the=
order in which modules are use-ed significant? That is, is there a differe=
nce-either at compile time or at run-time-between this list:
Use Win32;
use Win32::Process;
use Win32::API;
use Win32::AdminMisc;
use Win32::GUI;
use Win32::TieRegistry;
use Win32::Service;
use Win32::Sound;
use Getopt::Std;
use File::Copy;
use File::Content;

And this list:
use File::Content;
use File::Copy;
use Getopt::Std;
Use Win32;
use Win32::API;
use Win32::AdminMisc;
use Win32::GUI;
use Win32::Process;
use Win32::Service;
use Win32::Sound;
use Win32::TieRegistry;

I know, it's entirely cosmetic, but, as James Cagney said in "The Strawberr=
y Blonde", "that's just the kind of hairpin I am."

Question two: In the code's library list, use Win32::Process appears twice.=
Is this necessary? Is it okay? Is it justifiable? The code works with the=
double use statement, so I'm guessing it's okay. Just wondering if removin=
g the second invocation would be a problem rather than a solution.

Thanks, O Wise Ones.

Deane Rothenmaier
Programmer/Analyst - IT-StdCfg
Walgreens Corp.
2 Overlook Point #N51022D
MS 6515
Lincolnshire, IL 60069
224-542-5150

Vincit qui patitur. -- Persius


--_000_115007D93766724DAE9F518846E121DE931AACDMSS8MP2MBwagre so_
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html; charset="us-ascii"

<html xmlns:v=3D"urn:schemas-microsoft-com:vml" xmlns:o=3D"urn:schemas-micr=
osoft-com:office:office" xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns:m=3D"http://schemas.microsoft.com/office/2004/12/omml" xmlns=3D"http:=
//www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3Dus-ascii"=
>
<meta name=3D"Generator" content=3D"Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri","sans-serif";
color:windowtext;}
..MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri","sans-serif";}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext=3D"edit" spidmax=3D"1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext=3D"edit">
<o:idmap v:ext=3D"edit" data=3D"1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang=3D"EN-US" link=3D"blue" vlink=3D"purple">
<div class=3D"WordSection1">
<p class=3D"MsoNormal">Hi, wizards.<o:p></o:p></p>
<p class=3D"MsoNormal"><o:p>&nbsp;</o:p></p>
<p class=3D"MsoNormal">I went through my dead-tree library, CPAN, and other=
places, and found nothing that answers this question, so I&#8217;m going t=
o kick it out to the community&#8230;<o:p></o:p></p>
<p class=3D"MsoNormal"><o:p>&nbsp;</o:p></p>
<p class=3D"MsoNormal">Question one: I&#8217;ve inherited a program (if it =
matters, the program&#8217;s compiled to an executable, rather than run by =
the interpreter) that uses about a dozen different modules and, picky soul =
that I am, I&#8217;d like to list them in alphabetic
order rather than all higgledy-piggledy as they are now. Is the order in w=
hich modules are use-ed significant? That is, is there a difference&#8212;e=
ither at compile time or at run-time&#8212;between this list:<o:p></o:p></p=
>
<p class=3D"MsoNormal">Use Win32;<o:p></o:p></p>
<p class=3D"MsoNormal">use Win32::Process;<o:p></o:p></p>
<p class=3D"MsoNormal">use Win32::API;<o:p></o:p></p>
<p class=3D"MsoNormal">use Win32::AdminMisc;<o:p></o:p></p>
<p class=3D"MsoNormal">use Win32::GUI;<o:p></o:p></p>
<p class=3D"MsoNormal">use Win32::TieRegistry;<o:p></o:p></p>
<p class=3D"MsoNormal">use Win32::Service;<o:p></o:p></p>
<p class=3D"MsoNormal">use Win32::Sound; <o:p></o:p></p>
<p class=3D"MsoNormal">use Getopt::Std;<o:p></o:p></p>
<p class=3D"MsoNormal">use File::Copy;<o:p></o:p></p>
<p class=3D"MsoNormal">use File::Content; <o:p></o:p></p>
<p class=3D"MsoNormal"><o:p>&nbsp;</o:p></p>
<p class=3D"MsoNormal">And this list:<o:p></o:p></p>
<p class=3D"MsoNormal">use File::Content; <o:p></o:p></p>
<p class=3D"MsoNormal">use File::Copy;<o:p></o:p></p>
<p class=3D"MsoNormal">use Getopt::Std;<o:p></o:p></p>
<p class=3D"MsoNormal">Use Win32;<o:p></o:p></p>
<p class=3D"MsoNormal">use Win32::API;<o:p></o:p></p>
<p class=3D"MsoNormal">use Win32::AdminMisc;<o:p></o:p></p>
<p class=3D"MsoNormal">use Win32::GUI;<o:p></o:p></p>
<p class=3D"MsoNormal">use Win32::Process;<o:p></o:p></p>
<p class=3D"MsoNormal">use Win32::Service;<o:p></o:p></p>
<p class=3D"MsoNormal">use Win32::Sound; <o:p></o:p></p>
<p class=3D"MsoNormal">use Win32::TieRegistry;<o:p></o:p></p>
<p class=3D"MsoNormal"><o:p>&nbsp;</o:p></p>
<p class=3D"MsoNormal">I know, it&#8217;s entirely cosmetic, but, as James =
Cagney said in &#8220;The Strawberry Blonde&#8221;, &#8220;that&#8217;s jus=
t the kind of hairpin I am.&#8221;<o:p></o:p></p>
<p class=3D"MsoNormal"><o:p>&nbsp;</o:p></p>
<p class=3D"MsoNormal">Question two: In the code&#8217;s library list, use =
Win32::Process appears twice. Is this necessary? Is it okay? Is it justifia=
ble?&nbsp; The code works with the double use statement, so I&#8217;m guess=
ing it&#8217;s okay. Just wondering if removing the second
invocation would be a problem rather than a solution.<o:p></o:p></p>
<p class=3D"MsoNormal"><o:p>&nbsp;</o:p></p>
<p class=3D"MsoNormal">Thanks, O Wise Ones.<o:p></o:p></p>
<p class=3D"MsoNormal"><o:p>&nbsp;</o:p></p>
<p class=3D"MsoNormal">Deane Rothenmaier<o:p></o:p></p>
<p class=3D"MsoNormal">Programmer/Analyst &#8211; IT-StdCfg<o:p></o:p></p>
<p class=3D"MsoNormal">Walgreens Corp.<o:p></o:p></p>
<p class=3D"MsoNormal">2 Overlook Point #N51022D<o:p></o:p></p>
<p class=3D"MsoNormal">MS 6515<o:p></o:p></p>
<p class=3D"MsoNormal">Lincolnshire, IL 60069<o:p></o:p></p>
<p class=3D"MsoNormal">224-542-5150<o:p></o:p></p>
<p class=3D"MsoNormal"><o:p>&nbsp;</o:p></p>
<p class=3D"MsoNormal"><i>Vincit qui patitur.</i> -- Persius<o:p></o:p></p>
<p class=3D"MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
</body>
</html>

--_000_115007D93766724DAE9F518846E121DE931AACDMSS8MP2MBwagre so_--


--===============0470131847==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
--===============0470131847==--

Report this message

#2: Re: Cosmetic questions: order of module use significant? double

Posted on 2011-07-21 00:21:27 by Jenda Krynicky

From: "Rothenmaier, Deane C." <deane.rothenmaier@walgreens.com>
> Question one: I've inherited a program (if it matters, the program's
> compiled to an executable, rather than run by the interpreter) that
> uses about a dozen different modules and, picky soul that I am, I'd
> like to list them in alphabetic order rather than all
> higgledy-piggledy as they are now. Is the order in which modules are
> use-ed significant? That is, is there a difference-either at compile
> time or at run-time-between this list:

> use Win32;
> use Win32::Process;
> use Win32::API;
> use Win32::AdminMisc;
> use Win32::GUI;
> use Win32::TieRegistry;
> use Win32::Service;
> use Win32::Sound;
> use Getopt::Std;
> use File::Copy;
> use File::Content;
>
> And this list:
> use File::Content;
> use File::Copy;
> use Getopt::Std;
> Use Win32;
> use Win32::API;
> use Win32::AdminMisc;
> use Win32::GUI;
> use Win32::Process;
> use Win32::Service;
> use Win32::Sound;
> use Win32::TieRegistry;

Well. I would not do it. It should not make a difference, but you
know how is it with the "should"s. Some module may check whether a
certain other module is loaded, two modules may export a variable or
subroutine of the same name and the last one wins, ...

use Module::Name;

in Perl does much more than

using Namespace.Name;

does in C#.

> Question two: In the code's library list, use Win32::Process appears
> twice. Is this necessary? Is it okay? Is it justifiable? The code
> works with the double use statement, so I'm guessing it's okay. Just
> wondering if removing the second invocation would be a problem rather
> than a solution.

No. It's not necessary. That is if the use statement doesn't have any
additional parameters.

use Module::Name qw(some things);
....
use Module::Name qw(other things);

might be combined into a single statement, but you definitely cannot
safely delete the second statement leaving the first intact. If they
are both without parameters then in general case you are extremely
unlikely to have problems if you remove the later invocation. In case
of Win32::Process I did not test it thoroughly, but looking at the
code I do not see any danger in removing it.

Jenda
===== Jenda@Krynicky.cz === http://Jenda.Krynicky.cz =====
When it comes to wine, women and song, wizards are allowed
to get drunk and croon as much as they like.
-- Terry Pratchett in Sourcery

_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Report this message