[12644] in Perl-Users-Digest
Perl-Users Digest, Issue: 53 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Jul 7 10:48:17 1999
Date: Wed, 7 Jul 1999 07:37:36 -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 Wed, 7 Jul 1999 Volume: 9 Number: 53
Today's topics:
URL re-direction question <bgladd@wren-foundation.org>
Re: URL re-direction question (Abigail)
Re: URL re-direction question <ptimmins@itd.sterling.com>
Re: URL re-direction question (David Efflandt)
Re: URL re-direction question <bgladd@wren-foundation.org>
Re: URL re-direction question (Abigail)
Re: URL re-direction question (Tony Greenwood)
urlencoded standard? <StefanRieken@SoftHome.net>
Re: urlencoded standard? (Abigail)
Using PERL_OBJECT? <eger@cc.gatech.edu>
Using PERL_OBJECT? <eger@cc.gatech.edu>
Re: Using PERL_OBJECT? <matt@sergeant.org>
Using strict (Anno Siegel)
Re: Using strict (Anno Siegel)
Re: Using strict <uri@sysarch.com>
Re: Using strict (Andrew Allen)
Re: Using strict (Anno Siegel)
Re: Using the GETSTORE command <swiftkid@bigfoot.com>
Re: Using the GETSTORE command <ian@oven.com>
Re: Using the GETSTORE command <swiftkid@bigfoot.com>
Re: Using the GETSTORE command </dev/null@davidthornton.com>
Re: Viral matters [completely off-topic] (Kai Henningsen)
Re: Viral matters [completely off-topic] (Paul Anderson)
Re: Web based email designed in PERL (Mark P.)
Re: Web based email designed in PERL (Abigail)
Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sat, 03 Jul 1999 15:57:49 -0700
From: "R.E. Gladd" <bgladd@wren-foundation.org>
Subject: URL re-direction question
Message-Id: <377E956D.5287@wren-foundation.org>
Can anyone help me?
We recently registered a 2nd domain name that we wish to point to our
main website IP address. My ISP tech support says they can only do a
re-direction to the top-level domain name, whereas the index.html page
and associated files for this 2nd URL are in a sub-directory on our
site.
What we prefer is to have any http requests made to the new address to
point straight at this subdirectory (instead of having to split up our
default home page with links to the primary site and the new one). The
tech person who emailed me said that a Perl script might be capable of
performing this task. Is this true?
Basically just an 'if-else-endif' statement that intercepts, evaluates,
and appropriately routes incoming IP calls?
Can anyone help? I know nothing of Perl.
Thanks -
Bobby Gladd
------------------------------
Date: 4 Jul 1999 00:42:51 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: URL re-direction question
Message-Id: <slrn7ntt28.31h.abigail@alexandra.delanet.com>
R.E. Gladd (bgladd@wren-foundation.org) wrote on MMCXXXII September
MCMXCIII in <URL:news:377E956D.5287@wren-foundation.org>:
%% Can anyone help me?
%%
%% We recently registered a 2nd domain name that we wish to point to our
%% main website IP address. My ISP tech support says they can only do a
%% re-direction to the top-level domain name, whereas the index.html page
%% and associated files for this 2nd URL are in a sub-directory on our
%% site.
%%
%% What we prefer is to have any http requests made to the new address to
%% point straight at this subdirectory (instead of having to split up our
%% default home page with links to the primary site and the new one). The
%% tech person who emailed me said that a Perl script might be capable of
%% performing this task. Is this true?
%%
%% Basically just an 'if-else-endif' statement that intercepts, evaluates,
%% and appropriately routes incoming IP calls?
%%
%% Can anyone help? I know nothing of Perl.
The tech person is right. But so is the person who said that pigs can fly.
If you don't know anything about Perl, then you should not handle this
problem using Perl. Use a language that you know. There isn't any problem
that can only be solved by Perl. There are many problems for which Perl
is a bad choice.
This seems to be one of them.
But before you go off and ask in all the comp.lang.* groups the same
question, with Perl substituted by the language of that group, take
an hour or two and figure out how the web and http works. Then get the
manual of your server and figure out what you need to do.
Abigail
--
sub f{sprintf'%c%s',$_[0],$_[1]}print f(74,f(117,f(115,f(116,f(32,f(97,
f(110,f(111,f(116,f(104,f(0x65,f(114,f(32,f(80,f(101,f(114,f(0x6c,f(32,
f(0x48,f(97,f(99,f(107,f(101,f(114,f(10,q ff)))))))))))))))))))))))))
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: Sun, 04 Jul 1999 07:23:24 GMT
From: Patrick Timmins <ptimmins@itd.sterling.com>
Subject: Re: URL re-direction question
Message-Id: <7ln259$nkk$1@nnrp1.deja.com>
In article <377E956D.5287@wren-foundation.org>,
bgladd@wren-foundation.org wrote:
> We recently registered a 2nd domain name that we wish to point to our
> main website IP address. My ISP tech support says they can only do a
> re-direction to the top-level domain name, whereas the index.html page
> and associated files for this 2nd URL are in a sub-directory on our
> site.
>
> What we prefer is to have any http requests made to the new address to
> point straight at this subdirectory (instead of having to split up our
> default home page with links to the primary site and the new one). The
> tech person who emailed me said that a Perl script might be capable of
> performing this task. Is this true?
>
> Basically just an 'if-else-endif' statement that intercepts,
> evaluates, and appropriately routes incoming IP calls?
URL Rewriting:
http://www.apache.org/docs/mod/mod_rewrite.html
http://www.engelschall.com/pw/apache/rewriteguide/
It's not as easy as it first seems.
$monger{Omaha}[0]
Patrick Timmins
ptimmins@itd.sterling.com
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: 4 Jul 1999 19:51:25 GMT
From: efflandt@xnet.com (David Efflandt)
Subject: Re: URL re-direction question
Message-Id: <slrn7nvel6.5kl.efflandt@efflandt.xnet.com>
On Sat, 03 Jul 1999 15:57:49 -0700, R.E. Gladd
<bgladd@wren-foundation.org> wrote:
>Can anyone help me?
>
>We recently registered a 2nd domain name that we wish to point to our
>main website IP address. My ISP tech support says they can only do a
>re-direction to the top-level domain name, whereas the index.html page
>and associated files for this 2nd URL are in a sub-directory on our
>site.
>
>What we prefer is to have any http requests made to the new address to
>point straight at this subdirectory (instead of having to split up our
>default home page with links to the primary site and the new one). The
>tech person who emailed me said that a Perl script might be capable of
>performing this task. Is this true?
>
>Basically just an 'if-else-endif' statement that intercepts, evaluates,
>and appropriately routes incoming IP calls?
It would be easier if you got a web host that allowed virtual domains.
For example my www.de-serv.com/ is really www.ccs-ols.com/de-srv/ and can
be accessed by either URL.
In your case you cannot do that if you don't want files for both domains
in your top web directory. All files for your second domain will have
to be in a subdirectory and that subdirectory will show up in the URL.
You have to use a full url for the redirection or links may not work
properly. If you can use an index.cgi as a default index in your main
directory you could use that to redirect to a subdirectory based on
$ENV{HTTP_HOST}.
if ($ENV{HTTP_HOST} eq 'www.second.domain.com') {
print "Location: http://$ENV{HTTP_HOST}/subdir/\n\n"
} else {
print "Location: home.html\n\n"; 1st domain
}
--
David Efflandt efflandt@xnet.com http://www.xnet.com/~efflandt/
http://www.de-srv.com/ http://cgi-help.virtualave.net/
------------------------------
Date: Sun, 04 Jul 1999 19:56:35 -0700
From: "R.E. Gladd" <bgladd@wren-foundation.org>
Subject: Re: URL re-direction question
Message-Id: <37801EE3.4A57@wren-foundation.org>
Abigail wrote:
> The tech person is right. But so is the person who said that pigs can fly.
.....
> But before you go off and ask in all the comp.lang.* groups the same
> question, with Perl substituted by the language of that group, take
> an hour or two and figure out how the web and http works. Then get the
> manual of your server and figure out what you need to do.
OK.
Thanks. Sorry to have bothered you. Believe me, I won't be spamming the
comp.lang.* newsgroups with gratuitous ignorant requests for help.
Here's the deal:
I'm just a guy who is trying to serve people struggling with cancer. I'm
no (web) programmer hardhat. I simply put up a website for our
non-profit organization, and now have a second IP that needs re-routing
to a sub-dir if possible. Someone at my ISP told me a Perl script could
do it.
Conceptually, irrespective of language, the task is simply
if incoming URL request = 'this'
'go here'
else
'go /there'
endif
Just a simple and sincere plea for a little help &/or advice.
Bobby Gladd
WREN Foundation
http://www.wren-foundation.org
------------------------------
Date: 5 Jul 1999 01:56:32 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: URL re-direction question
Message-Id: <slrn7o0lo9.h6v.abigail@alexandra.delanet.com>
R.E. Gladd (bgladd@wren-foundation.org) wrote on MMCXXXIV September
MCMXCIII in <URL:news:37801EE3.4A57@wren-foundation.org>:
.. Abigail wrote:
..
.. > The tech person is right. But so is the person who said that pigs can fly.
..
.. .....
..
.. > But before you go off and ask in all the comp.lang.* groups the same
.. > question, with Perl substituted by the language of that group, take
.. > an hour or two and figure out how the web and http works. Then get the
.. > manual of your server and figure out what you need to do.
..
.. OK.
..
.. Just a simple and sincere plea for a little help &/or advice.
And my advice didn't work because of?
Abigail
--
perl -MLWP::UserAgent -MHTML::TreeBuilder -MHTML::FormatText -wle'print +(
HTML::FormatText -> new -> format (HTML::TreeBuilder -> new -> parse (
LWP::UserAgent -> new -> request (HTTP::Request -> new ("GET",
"http://work.ucsd.edu:5141/cgi-bin/http_webster?isindex=perl")) -> content))
=~ /(.*\))[-\s]+Addition/s) [0]'
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: Mon, 05 Jul 1999 09:56:56 GMT
From: tony@webscripts.org (Tony Greenwood)
Subject: Re: URL re-direction question
Message-Id: <3783772b.1162100@news.freeserve.co.uk>
Hey! "R.E. Gladd" <bgladd@wren-foundation.org>
>Conceptually, irrespective of language, the task is simply
>
>if incoming URL request = 'this'
>'go here'
>else
>'go /there'
>endif
>
>Just a simple and sincere plea for a little help &/or advice.
Hi, I found and installed such a script as I had 4 names pointing to
the same server :) I got one from
http://www.kastle.net/products/
After installing it and investigating, it didn't take long to figure
it out exactly how it works, in fact I recall feeling embarrassed that
I hadn't sussed it myself, but then again.. only learning.. so you can
go get that one and just use or learn from it.
HTH:)
--
Tony Greenwood
PORTFOLIO www.webscripts.org
------------------------------
Date: Tue, 06 Jul 1999 00:34:52 +0200
From: Stefan Rieken <StefanRieken@SoftHome.net>
Subject: urlencoded standard?
Message-Id: <3781330C.4DCAF84F@SoftHome.net>
Hi,
It occurs to me that there is some kind of standard in writing
urlencoded data. Both Netscape and Internet Explorer do for instance
encode the "$", while they leave alone the rest of the safe charachters
"-" | "_" | "." | "+" .
This confuses me a little. Which way is "standard"? How "bad" is it to
do any other way? Is there any real good standard for urlencoded data?
Greets,
Stefan
------------------------------
Date: 5 Jul 1999 19:16:59 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: urlencoded standard?
Message-Id: <slrn7o2in7.h6v.abigail@alexandra.delanet.com>
Stefan Rieken (StefanRieken@SoftHome.net) wrote on MMCXXXIV September
MCMXCIII in <URL:news:3781330C.4DCAF84F@SoftHome.net>:
$$
$$ It occurs to me that there is some kind of standard in writing
$$ urlencoded data. Both Netscape and Internet Explorer do for instance
$$ encode the "$", while they leave alone the rest of the safe charachters
$$ "-" | "_" | "." | "+" .
$$
$$ This confuses me a little. Which way is "standard"? How "bad" is it to
$$ do any other way? Is there any real good standard for urlencoded data?
And your Perl question is?
[Answer to your question: RTFRFC]
Abigail
--
sub _'_{$_'_=~s/$a/$_/}map{$$_=$Z++}Y,a..z,A..X;*{($_::_=sprintf+q=%X==>"$A$Y".
"$b$r$T$u")=~s~0~O~g;map+_::_,U=>T=>L=>$Z;$_::_}=*_;sub _{print+/.*::(.*)/s}
*_'_=*{chr($b*$e)};*__=*{chr(1<<$e)};
_::_(r(e(k(c(a(H(__(l(r(e(P(__(r(e(h(t(o(n(a(__(t(us(J())))))))))))))))))))))))
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: Mon, 05 Jul 1999 21:59:20 -0400
From: David Thomas Eger <eger@cc.gatech.edu>
Subject: Using PERL_OBJECT?
Message-Id: <378162F8.75E83B9@cc.gatech.edu>
I'm trying to use the CPerlObj feature described in perl.h, but don't
know where to start. Do I need to #define PERL_OBJECT before I compile
Perl or simply declare it in my C++ programs? How do I use this
feature?
-David Thomas Eger (eger@cc.gatech.edu)
------------------------------
Date: Mon, 05 Jul 1999 22:03:10 -0400
From: David Thomas Eger <eger@cc.gatech.edu>
Subject: Using PERL_OBJECT?
Message-Id: <378163DE.AB2A365F@cc.gatech.edu>
I'm trying to use the CPerlObj feature described in perl.h, but don't
know where to start. Do I need to #define PERL_OBJECT before I compile
Perl or simply declare it in my C++ programs? How do I use this
feature?
-David Thomas Eger (eger@cc.gatech.edu)
------------------------------
Date: Tue, 06 Jul 1999 11:33:12 +0100
From: Matt Sergeant <matt@sergeant.org>
Subject: Re: Using PERL_OBJECT?
Message-Id: <3781DB68.E549C575@sergeant.org>
David Thomas Eger wrote:
>
> I'm trying to use the CPerlObj feature described in perl.h, but don't
> know where to start. Do I need to #define PERL_OBJECT before I compile
> Perl or simply declare it in my C++ programs? How do I use this
> feature?
You might find the following URL useful - it's a complete VC++ project
embedding ActiveState perl (it doesn't do anything except implement an
ISAPI DLL, but I never got around to going further with it).
http://www.fastnetltd.ndirect.co.uk/Perl/mod_perlISAPI-0.00.tar.gz
Matt.
------------------------------
Date: 3 Jul 1999 20:07:42 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Using strict
Message-Id: <7llqie$jm3$1@lublin.zrz.tu-berlin.de>
Uri Guttman <uri@sysarch.com> wrote in comp.lang.perl.misc:
>>>>>> "AS" == Anno Siegel <anno4000@lublin.zrz.tu-berlin.de> writes:
>
> AS> Uri Guttman <uri@sysarch.com> wrote in comp.lang.perl.misc: [...]
>
> >> have declared all your variables. remember to use my in almost all
> >> cases and declare them in the tightest scope that works, i.e in a
> >> sub or loop or the file.
[my objection snipped and re-stated below]
>i meant the tightest scope that is needed. so if it is a var used in a loop,
>declaring it before the loop is fine. i tend to not use my in for
>statements but i declare them at the beginning of the sub. but that
>still is a tighter scope than file level or global.
Oh, okay. I understood "tightest scope that works, i.e. in a ... loop"
to mean "if it works in a loop, put it there". Not to belabor the
point, but I think it can be read that way, and if it is, it makes for
less than clear code.
By the way, when experimenting with pertinent examples, I noticed
that the relatively new feature of allowing "my" in the loop
initialization "foreach my $i ( 0 .. 3 )" and friends) works as if
there was a "my $i" inside the loop. Is this behavior documented
somewhere? It's not entirely intuitive.
In an earlier (now superseded) version of this article I claimed
the same thing for "for ( my $i = 0; ... )". This isn't so. Witness
#!/usr/bin/perl -w
my @coll;
foreach my $i ( 0 .. 2 ) { push @coll, \$i; }
print "@coll\n";
@coll = ();
for ( my $i = 0; $i < 3; $i++ ) { push @coll, \$i; }
print "@coll\n";
This prints:
SCALAR(0x80c4434) SCALAR(0x80cac18) SCALAR(0x80ced58)
SCALAR(0x80cecd4) SCALAR(0x80cecd4) SCALAR(0x80cecd4)
Curiouser and curiouser...
>>>>>> "AS" == Anno Siegel <anno4000@lublin.zrz.tu-berlin.de> writes:
>
>
> AS> but, of course,
>
> AS> my @coll;
> AS> foreach ( 1 .. 3 ) {
> AS> my $x = somefunc( $_);
> AS> push @coll, \$x;
> AS> }
>
> AS> What gives?
>
>what do you mean by that? when you are doing the above code the my HAS
>to be in the loop so you get a fresh value each time. this is perl's way
>of building data structures, by having values with positive reference
>counts alive outside the scope where they were created.
Oh... another scope issue, this time a linguistic one. I meant "What
gives?" to apply to the whole article, or at least to the two contrasting
code examples I gave, not only to the last one. The snippet above
was *meant* to be an example for when "my" must (usually) be inside
the loop.
Anno
------------------------------
Date: 3 Jul 1999 17:48:19 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Using strict
Message-Id: <7llid3$jbt$1@lublin.zrz.tu-berlin.de>
Uri Guttman <uri@sysarch.com> wrote in comp.lang.perl.misc:
[...]
>have declared all your variables. remember to use my in almost all cases
>and declare them in the tightest scope that works, i.e in a sub or loop or
>the file.
This piece of advice bothers me a bit. Putting "my" inside a loop
is asking perl for a new variable each time through. Efficiency
issues aside, there's a principle of good standing that can be
summed up as "If you don't need it, don't ask for it." This is
applied, among other things, to the use of single quotes if you don't
want interpolation or backslash escapes, as well as using "system"
rather backticks in a void context. Yet I've seen this bit about
"my" go unchallenged a couple of times.
So, unless someone gives me compelling reason to do otherwise, I'll
keep writing
my ( $x, @coll);
foreach ( 1 .. 3 ) {
$x = somefunc( $_);
push @coll, $x;
}
but, of course,
my @coll;
foreach ( 1 .. 3 ) {
my $x = somefunc( $_);
push @coll, \$x;
}
What gives?
Anno
------------------------------
Date: 03 Jul 1999 14:06:22 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Using strict
Message-Id: <x7oghtzjz5.fsf@home.sysarch.com>
>>>>> "AS" == Anno Siegel <anno4000@lublin.zrz.tu-berlin.de> writes:
AS> Uri Guttman <uri@sysarch.com> wrote in comp.lang.perl.misc: [...]
>> have declared all your variables. remember to use my in almost all
>> cases and declare them in the tightest scope that works, i.e in a
>> sub or loop or the file.
AS> This piece of advice bothers me a bit. Putting "my" inside a loop
AS> is asking perl for a new variable each time through. Efficiency
AS> issues aside, there's a principle of good standing that can be
AS> summed up as "If you don't need it, don't ask for it." This is
AS> applied, among other things, to the use of single quotes if you
AS> don't want interpolation or backslash escapes, as well as using
AS> "system" rather backticks in a void context. Yet I've seen this
AS> bit about "my" go unchallenged a couple of times.
i meant the tightest scope that is needed. so if it is a var used in a loop,
declaring it before the loop is fine. i tend to not use my in for
statements but i declare them at the beginning of the sub. but that
still is a tighter scope than file level or global.
>>>>> "AS" == Anno Siegel <anno4000@lublin.zrz.tu-berlin.de> writes:
AS> but, of course,
AS> my @coll;
AS> foreach ( 1 .. 3 ) {
AS> my $x = somefunc( $_);
AS> push @coll, \$x;
AS> }
AS> What gives?
what do you mean by that? when you are doing the above code the my HAS
to be in the loop so you get a fresh value each time. this is perl's way
of building data structures, by having values with positive reference
counts alive outside the scope where they were created.
uri
--
Uri Guttman ----------------- SYStems ARCHitecture and Software Engineering
uri@sysarch.com --------------------------- Perl, Internet, UNIX Consulting
Have Perl, Will Travel ----------------------------- http://www.sysarch.com
The Best Search Engine on the Net ------------- http://www.northernlight.com
"F**king Windows 98", said the general in South Park before shooting Bill.
------------------------------
Date: 3 Jul 1999 19:16:52 GMT
From: ada@fc.hp.com (Andrew Allen)
Subject: Re: Using strict
Message-Id: <7llnj4$a41$5@fcnews.fc.hp.com>
Anno Siegel (anno4000@lublin.zrz.tu-berlin.de) wrote:
: Uri Guttman <uri@sysarch.com> wrote in comp.lang.perl.misc:
: [...]
: >have declared all your variables. remember to use my in almost all cases
: >and declare them in the tightest scope that works, i.e in a sub or loop or
: >the file.
: This piece of advice bothers me a bit. Putting "my" inside a loop
: is asking perl for a new variable each time through. Efficiency
: issues aside, there's a principle of good standing that can be
: summed up as "If you don't need it, don't ask for it."
Efficiency, of course, is a non-issue:
$ time perl5 -e 'for($i=0;$i<1000000;$i++){my $a; $a=7;}'
real 0m8.29s
user 0m8.10s
sys 0m0.01s
$ time perl5 -e 'my $a; for($i=0;$i<1000000;$i++){$a=7;}'
real 0m6.45s
user 0m6.25s
sys 0m0.01s
And if you really follow "if you don't need it, don't ask for it",
then why would you leave a variable hanging around outside your block
when you don't need it? I like declaring "my" variables inside of my
blocks, because when the block exits, I can forget about it (and so
can my program). It saves brain cycles. For very few computer cycles.
The only time I declare "my" variables outside of blocks (loops) is
when I need to use them afterwards. Otherwise, they simply clutter the
namespace (and my brainspace).
: So, unless someone gives me compelling reason to do otherwise, I'll
: keep writing
: my ( $x, @coll);
: foreach ( 1 .. 3 ) {
: $x = somefunc( $_);
: push @coll, $x;
: }
Good. There's more than one way to do it.
Andrew
------------------------------
Date: 3 Jul 1999 20:28:25 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Using strict
Message-Id: <7llrp9$jnc$1@lublin.zrz.tu-berlin.de>
Andrew Allen <ada@fc.hp.com> wrote in comp.lang.perl.misc:
>Anno Siegel (anno4000@lublin.zrz.tu-berlin.de) wrote:
>: Uri Guttman <uri@sysarch.com> wrote in comp.lang.perl.misc:
>
>: [...]
>
>: >have declared all your variables. remember to use my in almost all cases
>: >and declare them in the tightest scope that works, i.e in a sub or loop or
>: >the file.
>
>: This piece of advice bothers me a bit. Putting "my" inside a loop
>: is asking perl for a new variable each time through. Efficiency
>: issues aside, there's a principle of good standing that can be
>: summed up as "If you don't need it, don't ask for it."
>
>Efficiency, of course, is a non-issue:
[convincing benchmarks snipped]
>And if you really follow "if you don't need it, don't ask for it",
>then why would you leave a variable hanging around outside your block
>when you don't need it? I like declaring "my" variables inside of my
>blocks, because when the block exits, I can forget about it (and so
>can my program). It saves brain cycles. For very few computer cycles.
>
>The only time I declare "my" variables outside of blocks (loops) is
>when I need to use them afterwards. Otherwise, they simply clutter the
>namespace (and my brainspace).
...or, for that matter, if you want to use the value it had the last
time around, depending on the placement of "my" in the loop.
In fact, the principle puts you in a bind there, which probably
means it needs reformulation. In any case, I think I'm slowly
persuaded that "my" inside a loop is, in general, a good thing.
If nothing else, it gives -w a better chance to catch you red-handed
using an uninitialized value, inside the loop as well as outside.
[rest snipped]
Anno
------------------------------
Date: Sat, 3 Jul 1999 12:17:34 +0500
From: "Faisal Nasim" <swiftkid@bigfoot.com>
Subject: Re: Using the GETSTORE command
Message-Id: <7llgnu$9hc1@news.cyber.net.pk>
> I must say I don't understand that bit of code. What does it do and how
does it
> work?
> # $^T is initialized when the script is started
> my $sec = time - $^T;
Get the processing time in $sec (seconds)
$^T is initialized when the program has started (automatically)
>
> $approx = sprintf (
> "%02d:%02d:%02d" ,
> int ( $sec / 3600 ) ,
> int ( $sec / 60 ) % 60 ,
> $sec % 60 ,
> );
Conver the seconds to traditional hh:mm:ss format.
------------------------------
Date: Sat, 03 Jul 1999 03:38:04 -0700
From: Ian Duggan <ian@oven.com>
Subject: Re: Using the GETSTORE command
Message-Id: <377DE80C.FD5A4BA8@oven.com>
If you don't like the cron job suggestion or don't have access to it, you can try using "nohup" to start your script as well. That will prevent
it from receiving hangup signals when you log out or close your shell
prompt> nohup myscipt.pl
-- Ian
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Ian Duggan ian@oven.com
OVEN Digital (212)253-2100 x170
www.oven.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Faisal Nasim wrote:
> > I must say I don't understand that bit of code. What does it do and how
> does it
> > work?
>
> > # $^T is initialized when the script is started
> > my $sec = time - $^T;
>
> Get the processing time in $sec (seconds)
>
> $^T is initialized when the program has started (automatically)
>
> >
> > $approx = sprintf (
> > "%02d:%02d:%02d" ,
> > int ( $sec / 3600 ) ,
> > int ( $sec / 60 ) % 60 ,
> > $sec % 60 ,
> > );
>
> Conver the seconds to traditional hh:mm:ss format.
------------------------------
Date: Sat, 3 Jul 1999 23:16:59 +0500
From: "Faisal Nasim" <swiftkid@bigfoot.com>
Subject: Re: Using the GETSTORE command
Message-Id: <7lmnd5$ai56@news.cyber.net.pk>
> If you don't like the cron job suggestion or don't have access to it, you
can try using "nohup" to start your script as well. That will prevent
> it from receiving hangup signals when you log out or close your shell
>
> prompt> nohup myscipt.pl
Wow! I never knew about that!
Thanx
--
Faisal Nasim (the Whiz Kid)
Web: http://wss.hypermart.net/
AOL: Whiz Swift ICQ: 4265451
FAX: (815) 846-2877
------------------------------
Date: Sun, 4 Jul 1999 06:50:04 +0100
From: David Thornton </dev/null@davidthornton.com>
Subject: Re: Using the GETSTORE command
Message-Id: <4ZzruwAMYvf3Ewrr@davidthornton.com>
At 03:38:04 on Sat, 3 Jul 1999, in article <377DE80C.FD5A4BA8@oven.com>,
Ian Duggan <ian@oven.com> writes
>prompt> nohup myscipt.pl
Thanks. I can actually get to grips with a one line command. Very useful
and works excellently.
--
David Thornton
------------------------------
Date: 04 Jul 1999 23:01:00 +0200
From: kaih=7KFtu0Gmw-B@khms.westfalen.de (Kai Henningsen)
Subject: Re: Viral matters [completely off-topic]
Message-Id: <7KFtu0Gmw-B@khms.westfalen.de>
kullstam@ne.mediaone.net (Johan Kullstam) wrote on 28.06.99 in <uvhc8z2zr.fsf@res.raytheon.com>:
> if you simply assume that people are using i386 linux, it'd be a snap
> to include a trojan horse binary (statically linked for maximum
> portability) to be installed at the make install step. scripting
> languages like perl are reasonably portable and could wreak havok as
> well. this could trap a number of unsuspecting people.
Remember the famous Internet Worm?
Remember that one of the holes it used was in sendmail?
Did you know *why* that hole was in sendmail in the first place?
So the sendmail author could get root on his main test machine, where he
didn't have the root password.
Yes, the hole was deliberate. He just forgot to take it out again for
release.
Now why is it I won't ever trust sendmail or it's author again ...
Oh, and there is this story about the hole in login that is put there by a
hole in cc so you won't ever see it in the source ... IIRC you can search
for a title like "reflections on trusting trust" or something like that.
Kai
--
http://www.westfalen.de/private/khms/
"... by God I *KNOW* what this network is for, and you can't have it."
- Russ Allbery (rra@stanford.edu)
------------------------------
Date: 5 Jul 1999 19:26:50 -0400
From: paul@geeky1.ebtech.net (Paul Anderson)
Subject: Re: Viral matters [completely off-topic]
Message-Id: <7lrevq$s24$1@geeky1.ebtech.net>
kaih=7KFtu0Gmw-B@khms.westfalen.de (Kai Henningsen) writes:
>Remember that one of the holes it used was in sendmail?
>
IIRC, it only used a bug in finger - that allowed to the server to be setup to
run code for debugging purposes.
------------------------------
Date: Sat, 03 Jul 1999 05:42:27 GMT
From: mag@imchat.com (Mark P.)
Subject: Re: Web based email designed in PERL
Message-Id: <377da26f.51852890@news.ionet.net>
You might want to check out AtDot at atdot.org
On Fri, 02 Jul 1999 22:34:36 GMT, "Jorge Escobar"
<jescobar@intermedios.com> wrote:
>Hi!
>
>I am a webmaster for a Web Portal, and I am looking any resources out there
>that help me visualize or offers some tips to design my own Web Based Email
>System.
>
>I know there is an O'Reilly book coming in October about this, but I thought
>I could find some resources on the web, but haven't had any luck.
>
>Any ideas? (Please reply to my email also: jescobar@interlatin.net)
>
>Thanxs!
>
>Jorge Escobar
>interLatin
>
>
------------------------------
Date: 3 Jul 1999 04:56:57 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Web based email designed in PERL
Message-Id: <slrn7nrnin.31h.abigail@alexandra.delanet.com>
Jorge Escobar (jescobar@intermedios.com) wrote on MMCXXXI September
MCMXCIII in <URL:news:08bf3.191$dV1.23974@typhoon1.gnilink.net>:
==
== I am a webmaster for a Web Portal, and I am looking any resources out there
== that help me visualize or offers some tips to design my own Web Based Email
== System.
Use Visual Basic.
Abigail
--
perl5.004 -wMMath::BigInt -e'$^V=Math::BigInt->new(qq]$^F$^W783$[$%9889$^F47]
.qq]$|88768$^W596577669$%$^W5$^F3364$[$^W$^F$|838747$[8889739$%$|$^F673$%$^W]
.qq]98$^F76777$=56]);$^U=substr($]=>$|=>5)*(q.25..($^W=@^V))=>do{print+chr$^V
%$^U;$^V/=$^U}while$^V!=$^W'
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: 1 Jul 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 1 Jul 99)
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.misc (and this Digest), send your
article to perl-users@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.
The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.
The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.
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 V9 Issue 53
************************************