[23036] in Perl-Users-Digest
Perl-Users Digest, Issue: 5256 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Jul 22 09:05:46 2003
Date: Tue, 22 Jul 2003 06:05:09 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Tue, 22 Jul 2003 Volume: 10 Number: 5256
Today's topics:
Re: Anyone using Perl to develop and deploy MS Windows (=?ISO-8859-1?Q?Stefan_Fischerl=E4nder?=)
Re: Anyone using Perl to develop and deploy MS Windows (=?ISO-8859-1?Q?Stefan_Fischerl=E4nder?=)
DBD::Oracle on Mac OS X <goedicke@goedsole.com>
Re: Effective Group ID not changing <admin@asarian-host.net>
Re: localize values of an object's hash key <ubl@schaffhausen.de>
Re: Multiple object types in a single .pm? <bernie@fantasyfarm.com>
Re: Multiple object types in a single .pm? <bernie@fantasyfarm.com>
Re: not recursing dir's using File::Find (david)
Passing parameters to a Perl Script from Command Line ( (Dave from Dublin)
Re: Passing parameters to a Perl Script from Command Li <abigail@abigail.nl>
Re: Passing parameters to a Perl Script from Command Li <Graham.T.Wood@oracle.com>
Re: Statistics for comp.lang.perl.misc <nobull@mail.com>
Re: Statistics for comp.lang.perl.misc <cat@no-spam.com>
Stupid newbie question re website hit counting <mpmcl@mitre.org>
theory vs practice ceases power (Xah Lee)
Re: Using 'my' within nested loops <nobull@mail.com>
Re: <bwalton@rochester.rr.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 22 Jul 2003 03:26:42 -0700
From: fischerlaender@gmx.de (=?ISO-8859-1?Q?Stefan_Fischerl=E4nder?=)
Subject: Re: Anyone using Perl to develop and deploy MS Windows apps?
Message-Id: <ff9bee6c.0307220226.66ce7c75@posting.google.com>
"John W. Krahn" <krahnj@acm.org> wrote in message news:<3F1C74FB.D30E32C2@acm.org>...
> If you already know BASIC then you may want to have a look at
> PowerBASIC.
> http://www.powerbasic.com/
Thanks for your recommendation, but my Perl knowledge is way better
than my Basic knowledge. And I'm using Perl all day for other tasks,
so it would be good to concentrate on one language.
Stefan
------------------------------
Date: 22 Jul 2003 03:28:58 -0700
From: fischerlaender@gmx.de (=?ISO-8859-1?Q?Stefan_Fischerl=E4nder?=)
Subject: Re: Anyone using Perl to develop and deploy MS Windows apps?
Message-Id: <ff9bee6c.0307220228.4466e217@posting.google.com>
"Richard Bennett" <leadbed@hotmail.com> wrote in message news:<3f1c6124$0$268$ba620e4c@reader0.news.skynet.be>...
> I did exactly the same, I also wanted to translate a few VB apps.
>
> What I can highly recommend is Activestate's Perl Dev Kit 5.
> It's not free, but there's an eval version. (don't distribute anything built
> with it though, as they will also expire)
> (..)
> You build your app in perl, using win32::gui if you need a gui (or TK), and
> then use the dev-kit to compile it into an exe.
> It includes all modules and 'require' files within the exe, as well as the
> perl interpreter. The end-user just needs to click on your exe to run the
> program, no installing or dependancies.
This sounds great. I'll give it a try.
> I can mail you a program offlist if you'd like to test the look & feel.
Thank you, but I'll just try the eval version.
Stefan
------------------------------
Date: Tue, 22 Jul 2003 11:31:43 GMT
From: William Goedicke <goedicke@goedsole.com>
Subject: DBD::Oracle on Mac OS X
Message-Id: <m3u19ex0fa.fsf@mail.goedsole.com>
Dear Y'all -
I'm having trouble install DBD::Oracle. When I run the nmedit command
recommended in README.macosx I get the following message:
nmedit: symbols names listed in: ./hints/macos_lib.syms not in: /Users/oracle/9iR2/orahome/lib/libclntsh.dylib
_dlclose
_dlsym
Using CPAN DBI installs fine, but when I try to install DBD::Oracle
I get the following:
WARNING: could not decode oracle version from
/Users/oracle/9iR2/orahome/orainst/inspdver, or /Users/oracle/9iR2/orahome/install/unix.rgs
or from ORACLE_HOME path /Users/oracle/9iR2/orahome.
Oracle version based logic in Makefile.PL may produce erroneous results.
ERROR: symbol table needs modification in Oracle library:
/Users/oracle/9iR2/orahome/lib/libclntsh.dylib.9.0
Any ideas?
Yours Billy -
============================================================
William Goedicke goedicke@goedsole.com
http://www.goedsole.com:8080
============================================================
Lest we forget:
I understand feedback.
------------------------------
Date: Tue, 22 Jul 2003 12:36:20 +0200
From: "Mark" <admin@asarian-host.net>
Subject: Re: Effective Group ID not changing
Message-Id: <BpOdnddFc6U7joCiRTvUrg@giganews.com>
"Aaron Baugher" <abaugher@esc.pike.il.us> wrote in message
news:86wueb1ix1.fsf@cail.baugher.pike.il.us...
> I have a program that runs as root and accepts logins and
> commands through a network socket. On each login, it changes the
> effective uid and gid to that of the user, like so:
>
> my( $uid, $gid ) = (getpwnam($user))[2,3];
> $> = $uid;
> $) = $gid;
>
> In most cases, $gid will be 1001, and $uid will be > 1000. This
> worked fine on FreeBSD, and files created after this point would be
> created with the uid/gid ownership assigned here. I recently tried
> running this program on RedHat (perl 5.6.1), and the gid doesn't
> change, although the uid does. If I print $), it still contains a
> list of root's groups, and files created get root's group ownership.
>
> Is there something I should be doing differently to get this to work?
In my modest experience, always change GID first: for if you change UID
first, you may no longer have the privileges to change GID! For my news
server, for instance, I do this, and it works like a charm:
($nlogin, $npass, $nuid, $ngid) = getpwnam ('news');
$) = $ngid;
$( = $ngid;
$> = $nuid;
$< = $nuid;
- Mark
------------------------------
Date: Tue, 22 Jul 2003 14:15:58 +0200
From: Malte Ubl <ubl@schaffhausen.de>
Subject: Re: localize values of an object's hash key
Message-Id: <bfjd21$rf5$1@news.dtag.de>
Eric J. Roode wrote:
> -----BEGIN xxx SIGNED MESSAGE-----
> Hash: SHA1
>
> "Joly, Patrick: IAC" <Joly.Patrick@ic.gc.ca> wrote in
> news:3E3612E8D41DD3118DCC0600000000000AEA96CB@pubgate-01.ic.gc.ca:
>
>
>>I need to localise (dynamically scope) the value of a hash key in an
>>object but I am facing a hurdle. I have been stuck on this problem
>>for 5 days so any help would be greatly appreciated.
>>
>>2) any other ideas?
>>
>>
>>Thanks, I am really desperate. Everything was going great so far,
>>until I got stumped by this.
>
>
> I'm not sure this is a *great* solution, but I've used this technique in
> the past:
It works for breaking circular references, too and is described here in
detail:
http://www.perl.com/pub/a/2002/08/07/proxyobject.html?page=1
bye
malte
------------------------------
Date: Tue, 22 Jul 2003 06:52:31 -0400
From: Bernie Cosell <bernie@fantasyfarm.com>
Subject: Re: Multiple object types in a single .pm?
Message-Id: <8o5qhvsejrf9l4t3ti5n60dd59gsrahib4@library.airnews.net>
"Eric J. Roode" <REMOVEsdnCAPS@comcast.net> wrote:
} Bernie Cosell <bernie@fantasyfarm.com> wrote in
} news:o97phvs6ev0bdjh4sk4uvr8ci60sgdmset@library.airnews.net:
}
} > I have two very closely related classes that I'd like to implement in
} > a single .pm. ...
}
} If they are object classes, why do you need Exporter? Why do you need an
} import subroutine?
Oh -- one of the two classes will have a few "class methods" calls I'd like
to Export -- I'm not sure at the moment about the other so I was asking
about the general case...
} To answer your other question, yes you can have two or more object
} classes in a single file, and the way you laid it out is pretty much how
} to do it.
Thanks! that's what I suspected...
/Bernie\
--
Bernie Cosell Fantasy Farm Fibers
bernie@fantasyfarm.com Pearisburg, VA
--> Too many people, too few sheep <--
------------------------------
Date: Tue, 22 Jul 2003 06:55:46 -0400
From: Bernie Cosell <bernie@fantasyfarm.com>
Subject: Re: Multiple object types in a single .pm?
Message-Id: <kr5qhvsnejal1iab8u5hvnuqvrn4u2hidj@library.airnews.net>
toddrw69@excite.com (trwww) wrote:
} Bernie Cosell <bernie@fantasyfarm.com> wrote in message news:<o97phvs6ev0bdjh4sk4uvr8ci60sgdmset@library.airnews.net>...
} > I have two very closely related classes that I'd like to implement in a
} > single .pm. ...
} >
} } It pretty much works like one ( or at least I ) would expect. You are
} right about the first part. The use() basically changes the ::'s to /
} and adds .pm to its argument, and looks for that file in @INC. But the
} packages defined therein do not have to correspond to the filename in
} any way:
Ah, I thought it always looked for an 'import' subroutine in the same-named
package. But I think I see what you're saying: if I don't need any import
machinery in the interior classes, I can just leave it out and then put
whichever classes I need just in the file [and as you point out, I don't
even need to *MENTION* the same-named package].
I just didn't know if there was any other "same-named magic" going on under
the covers that I'd need to worry about [cf trying to understand what "use
vars" does..:o)]
Thanks!
/Bernie\
--
Bernie Cosell Fantasy Farm Fibers
bernie@fantasyfarm.com Pearisburg, VA
--> Too many people, too few sheep <--
------------------------------
Date: 22 Jul 2003 04:29:48 -0700
From: dwlepage@yahoo.com (david)
Subject: Re: not recursing dir's using File::Find
Message-Id: <b09a22ae.0307220329.2907fe12@posting.google.com>
Thomas Wasell <wasell@bahnhof.se> wrote in message news:<MPG.1986d288a8b4792198970e@news.bahnhof.se>...
> In article <b09a22ae.0307211811.3a56d2c8@posting.google.com>, david
> <dwlepage@yahoo.com> wrote:
> >"Jürgen Exner" <jurgenex@hotmail.com> wrote in message news:<QYJSa.49016$kI5.38746@nwrddc02.gnilink.net>...
> >> david wrote:
> >> > Im trying to find all files ONLY in the current directory that are
> >> > called
> >> > "today.txt" or "sub.txt" and copy them to a different directory. Im
> >> > trying to do so using File::Find and File::Copy, but I cannot seem to
> >> > get this not to recurse through the directory structure. (There may be
> >> > other "today.txt" files below the current dir.
> >>
> >> In that case I wouldn't use File::Find but a simple glob().
> >> If standard filename expansion is not powerful enough for your needs then
> >> you can always filter the result using grep() in a second step.
> >>
> >> jue
> >
> >Thank you. That does work better. Now my next question is, now that I
> >can properly find and copy my files with:
> >
> >use strict;
> >use File::Copy;
> >
> >my $targetdir="./floppy";
> >my $today="./current/today.txt";
> >
> >open(OUT, ">>$today") || die "$!";
>
> What's the point of this line?
>
> >while ( <*.txt> ) {
> >copy $_, $targetdir if /today.+\.txt/i || die "Cant copy";
> ^^ ^^
> That's the same as
>
> copy($_, $targetdir) if (/today.+\.txt/I || die("Cant copy"));
>
> isn't it? Are you sure that's what you want? Besides, your pattern will
> match 'todayRANDOM_CHARACTERS.txt', but not 'today.txt' as in your original
> question.
>
> Why not simply do
>
> foreach ('today.txt', 'sub.txt') {
> next unless -e;
> copy $_, $targetdir or die "Can't copy '$_': $!\n";
> }
>
> instead of bothering with globs?
>
>
> >print OUT $_ if /today.+\.txt/i;
> >}
> >
> >How can I iterate through each *.txt (today.+\.txt) line by line?
>
> What do you mean? Do you want to open them and work with their contents?
>
>
> >Thanks!
> >
Thanks Thomas. I found that after my original post that I may have
multiple files in the same directory which I would need to catch also
- hence the last modification posted. So I might see 'today1.txt',
'today2.txt', etc also in the same directory. Foreach of these files I
need to parse them line for line.
> What do you mean? Do you want to open them and work with their contents?
Yes, exactly. I need to iterate through each file, if present.
Thanks,
Dave
------------------------------
Date: 22 Jul 2003 03:22:08 -0700
From: davidmcguinness@dublin.ie (Dave from Dublin)
Subject: Passing parameters to a Perl Script from Command Line (Linux)
Message-Id: <9d18d9fe.0307220222.7f0d86df@posting.google.com>
Hi,
I'm fairly new to both programming in shell script (linux) and in
programming in perl.
I need to pass a parameter to the perl script from the command line.
Does anyone know the syntax for this: both in command line and in the
perl script (to receive),
Can't seem to find a match for this on the web,
Thanks,
David
------------------------------
Date: 22 Jul 2003 10:44:18 GMT
From: Abigail <abigail@abigail.nl>
Subject: Re: Passing parameters to a Perl Script from Command Line (Linux)
Message-Id: <slrnbhq5c2.prg.abigail@alexandra.abigail.nl>
Dave from Dublin (davidmcguinness@dublin.ie) wrote on MMMDCXII September
MCMXCIII in <URL:news:9d18d9fe.0307220222.7f0d86df@posting.google.com>:
:) Hi,
:)
:) I'm fairly new to both programming in shell script (linux) and in
:) programming in perl.
:) I need to pass a parameter to the perl script from the command line.
:)
:) Does anyone know the syntax for this: both in command line and in the
:) perl script (to receive),
From the command line:
$ program.pl arg1 arg2 arg3
From the Perl program:
my $argc = 0;
foreach my $arg (@ARGV) {
printf "Argument %2d: '%s'\n", ++ $argc, $arg;
}
:) Can't seem to find a match for this on the web,
Why go on the web if you have all the documents you need on your
system, as they come with Perl?
Abigail
--
@;=split//=>"Joel, Preach sartre knuth\n";$;=chr 65;%;=map{$;++=>$_}
0,22,13,16,5,14,21,1,23,11,2,7,12,6,8,15,3,19,24,14,10,20,18,17,4,25
;print@;[@;{A..Z}];
------------------------------
Date: Tue, 22 Jul 2003 11:51:44 +0100
From: Graham Wood <Graham.T.Wood@oracle.com>
Subject: Re: Passing parameters to a Perl Script from Command Line (Linux)
Message-Id: <3F1D1740.670809B6@oracle.com>
This is a multi-part message in MIME format.
--------------C9B0720B78FD94ADAD68733A
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Dave from Dublin wrote:
> Hi,
>
> I'm fairly new to both programming in shell script (linux) and in
> programming in perl.
> I need to pass a parameter to the perl script from the command line.
>
> Does anyone know the syntax for this: both in command line and in the
> perl script (to receive),
Just type the arguments after the script name when you run the script.
You can then access them in perl via the predefined @ARGV array.
$ARGV[0] is the first argument
$ARGV[1] is the second argument and so on.
If by "command line" you mean shell scripting you get the arguments as
$1, $2, $3 etc.
Hope this helps
Graham (from Leixlip)
--------------C9B0720B78FD94ADAD68733A
Content-Type: text/x-vcard; charset=UTF-8;
name="Graham.T.Wood.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Graham Wood
Content-Disposition: attachment;
filename="Graham.T.Wood.vcf"
begin:vcard
n:;Graham
x-mozilla-html:FALSE
adr:;;;;;;
version:2.1
email;internet:Graham.Wood@oracle.com
fn:Graham Wood
end:vcard
--------------C9B0720B78FD94ADAD68733A--
------------------------------
Date: 22 Jul 2003 13:10:40 +0100
From: Brian McCauley <nobull@mail.com>
Subject: Re: Statistics for comp.lang.perl.misc
Message-Id: <u94r1ewym7.fsf@wcl-l.bham.ac.uk>
Cat <cat@no-spam.com> writes:
> No appologies for the top posting...
No apologies for forming a very low oppinion of you.
If you do not want to be part of the community why don't you just
leave?
> Wander, I do, what these stats would look like if they
> also included the hits for posters who only post things
> like
> rtfm
> perldoc
> not a perl question
> wrong ng
> ...you get the picture ;=-)
There are very few you post _only_ those.
There are those like myself, Tad, Uri, Jurgen who sometimes appear to
post mostly those.
> What good is statistics if it only paints the picture
> _you_ want to see?
It would be interesting if you were to correlate the posters who shout
"RTFM" and "OT" with those posters who give the best detailed, correct
and helpful answers to well asked non-trivial[1], on-topic questions.
Also interesting would be to look at the quality of answers (if any)
provided by those who complain about those of us who object to a
deluge of off-topic and trivial questions.
But of course you wouldn't want to do that because it would paint a
picture you wouldn't want to see.
[1] By "trivial" I don't mean trivial to a Perl guru, I mean trivial
to a complete newcommer who's prepared to RTFM.
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: Tue, 22 Jul 2003 22:50:29 +1000
From: Cat <cat@no-spam.com>
Subject: Re: Statistics for comp.lang.perl.misc
Message-Id: <3F1D3315.F7393DE4@no-spam.com>
Brian McCauley wrote:
>
> Cat <cat@no-spam.com> writes:
>
> > No appologies for the top posting...
>
> No apologies for forming a very low oppinion of you.
>
> If you do not want to be part of the community why don't you just
> leave?
>
> > Wander, I do, what these stats would look like if they
> > also included the hits for posters who only post things
> > like
> > rtfm
> > perldoc
> > not a perl question
> > wrong ng
> > ...you get the picture ;=-)
>
> There are very few you post _only_ those.
>
> There are those like myself, Tad, Uri, Jurgen who sometimes appear to
> post mostly those.
>
> > What good is statistics if it only paints the picture
> > _you_ want to see?
>
> It would be interesting if you were to correlate the posters who shout
> "RTFM" and "OT" with those posters who give the best detailed, correct
> and helpful answers to well asked non-trivial[1], on-topic questions.
>
> Also interesting would be to look at the quality of answers (if any)
> provided by those who complain about those of us who object to a
> deluge of off-topic and trivial questions.
>
> But of course you wouldn't want to do that because it would paint a
> picture you wouldn't want to see.
>
> [1] By "trivial" I don't mean trivial to a Perl guru, I mean trivial
> to a complete newcommer who's prepared to RTFM.
>
> --
> \\ ( )
> . _\\__[oo
> .__/ \\ /\@
> . l___\\
> # ll l\\
> ###LL LL\\
I _did_ expect some bull. And here it is. LOL
------------------------------
Date: Tue, 22 Jul 2003 08:17:49 -0400
From: Michael McLaughlin <mpmcl@mitre.org>
Subject: Stupid newbie question re website hit counting
Message-Id: <bfja38$hpb$1@newslocal.mitre.org>
Once a month, I run a (mostly perl) script that reads my all my
webserver log files and tallies hits to several webpages. However, I
have always wondered about the accuracy of these counts.
Specifically, if a reader has been to a page before, has this page in
his browser cache and surfs to that URL, does the log still register
that hit with the usual status code (200)? Does it register it at all?
Thanks in advance for any tips.
--
Mike McLaughlin
------------------------------
Date: 22 Jul 2003 04:57:04 -0700
From: xah@xahlee.org (Xah Lee)
Subject: theory vs practice ceases power
Message-Id: <7fe97cc4.0307220357.6bc896da@posting.google.com>
i'm posting the following in hope that "theory vs practice" can cease
its misleading power.
from
http://www.xahlee.org/UnixResource_dir/writ/theory_practice.html
merlyn@stonehenge.com (Randal L. Schwartz) quoted:
| The difference between theory and practice in theory is much less
| than the difference between theory and practice in practice.
Popular quotes have attributes of equivocal interpretation and
theatrical display. When interpreted and pondered by the wise, it
lights up a wisdom, but dullards quote them equally, and delight in
their drama. (the latter happens a lot in Perl and unix communities.)
From American Heritage Dictionary:
theory n. pl. theories
1. a. Systematically organized knowledge applicable in a relatively
wide variety of circumstances, especially a system of assumptions,
accepted principles, and rules of procedure devised to analyze,
predict, or otherwise explain the nature or behavior of a specified
set of phenomena. b. Such knowledge or such a system. 2. Abstract
reasoning; speculation. 3. A belief that guides action or assists
comprehension or judgment: rose early, on the theory that morning
efforts are best; the modern architectural theory that less is
more. 4. An assumption based on limited information or knowledge; a
conjecture.
The word 'theory', in practice, has more meanings than in theory.
For example, in the above usage, 'theory' is used twice. In the first
instance, it is used for a purpose but not for its meaning. It is part
of a construction in a language that discuss the language itself. In
theory it does not come up, but in practice it does all the time. In
practice, we can say that the first instance of usage of the word
'theory' has no meaning given the context. In the second appearance of
the word, it has myriad of interpretations due to the construction of
the phrase.
People may mean: "The word 'theory', in practice, has more meanings
than people would think." Here the word is thus used conveniently to
stand for "mob's knowledge".
From a logical linguist's mouth, the intent might be: "The word
'theory', outside academia, acquire more meanings and purposes than we
require in linguistics." The sensibility of such semantic content is
demonstrated in the previous paragraph.
People may say: "in theory, tomorrow'll rain." They really mean "the
broadcast station lady said that tomorrow will rain."
A detective might say, "in theory, that guy is the murderer.". He
really means: "according to my investigations, it is highly probably
that that guy is the murderer.". (dictionary definition #4.)
In a strict sense, 'theory' means systematic and organized principles
derived by scientific means (dictionary definition #1.). In a more
strict mathematical sense, 'theory' is the body of theorems, and
theorem by definition describes practices correctly always, else it is
not a theorem. It is possible for a mathematical theorem to be
incorrect (we are humans, after all), but in practice to assume that
theorems can be incorrect is like assuming one might be hit by a
meteor tomorrow. Theoretically correct, but not sensible.
As you can see, the word 'theory' is subject to wanton abuses. In
fact, all English words are subject to extraneous purposes to yield
sentences or paragraphs that has a meaningful ambiguous
interpretation. (this is how poetry works, in theory.) All in all,
English is extremely malleable and ambiguous. The phrase "The word
'theory', in practice, has more meanings than in theory" is really
silly, except in really well-defined context. In our context, the
quote amounts to illustrating the stupidity of Perlers who don't have
a solid background in logic or linguistics, but like to quote about
differences of theory vs. practice.
Larry Wall likes to mention how he had a linguistics background, and
how he utilized the (good) human qualities of English to create
Perl. To the Perl folks of beady eyes, they are sold a grand advance
in computer science, but to discerning eyes, it's artful garbage.
Sorry i don't have time to address the above points of Wall's, but
this will definitely be another lesson for you folks down the road.
The perl folks with their beads of little eyes, cannot see beyond
imperative languages.
Xah
xah@xahlee.org
http://xahlee.org/PageTwo_dir/more.html
------------------------------
Date: 22 Jul 2003 12:20:18 +0100
From: Brian McCauley <nobull@mail.com>
Subject: Re: Using 'my' within nested loops
Message-Id: <u9adb6x0y5.fsf@wcl-l.bham.ac.uk>
"David Oswald" <spamblock@junkmail.com> writes:
> I am curious about the amount of overhead created with the first example
> below as compared to the second example below:
>
>
> Example 1:
> my $this;
> my $that;
> foreach $this (@somearray) {
> foreach $that (@some_other_array) {
> ........
> }
> }
>
>
> Example 2: foreach my $this (@somearray) { foreach my $that
> (some_other_array) { ....... } }
IMNSHO you should _always_ put an explicit my() or our() on the
foreach iterator variable. If you use an existing lexically scoped
variable then Perl will, in effect, create _another_ lexically scoped
variable of the same name.
Your Example 1 is, in fact, interpreted more like:
my $this;
my $that;
foreach my $this (@somearray) {
foreach my $that (@some_other_array) {
........
}
}
IMNSHO Perl should emit a warning when it does this but it doesn't.
> It seems to me that while the second example does a better job of limiting
> the scope of variables just to the block in which they're applicable, the
> second example does cause the construction of a variable each time the outer
> foreach iterates.
Yes, that's what most people would intuatively think. That's why I think we need
a warning.
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: Sat, 19 Jul 2003 01:59:56 GMT
From: Bob Walton <bwalton@rochester.rr.com>
Subject: Re:
Message-Id: <3F18A600.3040306@rochester.rr.com>
Ron wrote:
> Tried this code get a server 500 error.
>
> Anyone know what's wrong with it?
>
> if $DayName eq "Select a Day" or $RouteName eq "Select A Route") {
(---^
> dienice("Please use the back button on your browser to fill out the Day
> & Route fields.");
> }
...
> Ron
...
--
Bob Walton
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>
Administrivia:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V10 Issue 5256
***************************************