[19460] in Perl-Users-Digest
Perl-Users Digest, Issue: 1655 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Aug 30 09:05:26 2001
Date: Thu, 30 Aug 2001 06:05:10 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <999176709-v10-i1655@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Thu, 30 Aug 2001 Volume: 10 Number: 1655
Today's topics:
a mystery to me: EOF (Joachim Ziegler)
Re: Converting Perl to C (Bernard El-Hagin)
each() bug (?) <ilya@martynov.org>
Re: each() bug (?) (Rafael Garcia-Suarez)
Re: each() bug (?) <ilya@martynov.org>
Re: Godzilla Stomps Code Red (Michel Dalle)
Re: Godzilla Stomps Code Red <Thomas@Baetzler.de>
Re: Good old regexp teaser <goldbb2@earthlink.net>
Re: how to get character from string one by one? (Anno Siegel)
Newbie question <ash@dailydose.net>
Re: Newbie question (Randal L. Schwartz)
Re: Newbie question <Thomas@Baetzler.de>
Re: NT question <CCX138@coventry.ac.uk>
Re: perl cgi <stefan@wirelessopinion.com>
Re: perl cgi <nowhere@dot.com>
Re: perl cgi (mbower)
Perl->M$ SQL <nll@nospam.com>
Script not reading templates - why?? <gbirchley@hotmail.com>
Re: search.cpan.org (Michel Dalle)
Re: search.cpan.org (Tim Hammerquist)
Re: search.cpan.org <Tassilo.Parseval@post.rwth-aachen.de>
Re: search.cpan.org <ilya@martynov.org>
Re: search.cpan.org <Tassilo.Parseval@post.rwth-aachen.de>
Re: search.cpan.org <randy@theory.uwinnipeg.ca>
Re: subroutines in @INC ? <goldbb2@earthlink.net>
Re: system call (Anno Siegel)
Re: use statement runs package's subs before they are c (Rafael Garcia-Suarez)
Re: use statement runs package's subs before they are c <tinamue@zedat.fu-berlin.de>
Re: Weird @INC if run from web <nowhere@dot.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 30 Aug 2001 05:39:58 -0700
From: ziegler@algorilla.de (Joachim Ziegler)
Subject: a mystery to me: EOF
Message-Id: <93aad7d0.0108300439.1844dabb@posting.google.com>
hi perlers,
reading the documentation of Perl's eof(), i'm wondering what EOF
really is.
pressing CTRL-D on my keyboard is said to generate an
"end-of-file-character". so is this a legal ASCII-character?
(btw, how do i generate this character by a keyboard-stroke under
Windows?)
i can't find it in my ASCII-table, because it does not show the
non-printable characters. can someone please point me to a complete table?
i'm conjecturing the following:
the EOF-character is *not* the last character of any file, right?
the EOF returned by C's getc() is *not* the same as the above
character generated by a keyboard-stroke, but a symbolic constant
(usually negative) returned by this function to indicate, that there
are no more characters left in a file/stream... right?
but internally, where does getc() know from that the stream is empty?
it's system-dependent, right?
the last line read by a <FILEHANDLE>-construct in Perl does *never*
contain any special EOF-character at the end, right?
------------------------------
Date: Thu, 30 Aug 2001 10:15:59 +0000 (UTC)
From: bernard.el-hagin@lido-tech.net (Bernard El-Hagin)
Subject: Re: Converting Perl to C
Message-Id: <slrn9os47n.1sp.bernard.el-hagin@gdndev25.lido-tech>
On Thu, 30 Aug 2001 13:57:31 +0400, Oleg Bogumirsky <oleg_b@newmail.ru> wrote:
>Hello ALL,
>Could anybody help me to get C source for my perl program, i mean to convert
>Perl source to C/C++ source, so I could compile this C source with c
>compiler.
Read the faqing FAQ.
Cheers,
Bernard
--
perl -l54e's yyw q q tvmrx "h\ywx ersxliv zivp legoiv"qiy;y #a-zA-Z#d-gu-z#
chefghijklmnopqrstuvwxyzcJab-def-uPwxyzc;s j j s u u s t t s r r s
ppevalpereeteueje'
------------------------------
Date: 30 Aug 2001 16:05:57 +0400
From: Ilya Martynov <ilya@martynov.org>
Subject: each() bug (?)
Message-Id: <87heupg3bu.fsf@abra.ru>
Any ideas why following code (under Perl 5.6.1) causes infinite loop?
while(my($value, $uiname) = each %{{ true => 'Yes', false => 'No' }}) {
print "$uiname\n";
}
While this code works as expected
my $href = { true => 'Yes', false => 'No' };
while(my($value, $uiname) = each %{$href}) {
print "$uiname\n";
}
--
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
| Ilya Martynov (http://martynov.org/) |
| GnuPG 1024D/323BDEE6 D7F7 561E 4C1D 8A15 8E80 E4AE BE1A 53EB 323B DEE6 |
| AGAVA Software Company (http://www.agava.com/) |
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
------------------------------
Date: 30 Aug 2001 12:47:56 GMT
From: rgarciasuarez@free.fr (Rafael Garcia-Suarez)
Subject: Re: each() bug (?)
Message-Id: <slrn9osdqj.mjl.rgarciasuarez@rafael.kazibao.net>
Ilya Martynov wrote in comp.lang.perl.misc:
}
} Any ideas why following code (under Perl 5.6.1) causes infinite loop?
}
} while(my($value, $uiname) = each %{{ true => 'Yes', false => 'No' }}) {
} print "$uiname\n";
} }
}
} While this code works as expected
}
} my $href = { true => 'Yes', false => 'No' };
} while(my($value, $uiname) = each %{$href}) {
} print "$uiname\n";
} }
Looks like %{{...}} is re-evaluated at each loop iteration; thus a new
hash, and a new each-iterator, is created, positioned at the 1st hash
element. (am I clear?)
--
Rafael Garcia-Suarez / http://rgarciasuarez.free.fr/
print map substr($_,7).&$_, grep defined &$_, sort values %::;
sub Just {" another "}; sub Perl {" hacker,\n"};
------------------------------
Date: 30 Aug 2001 16:54:55 +0400
From: Ilya Martynov <ilya@martynov.org>
Subject: Re: each() bug (?)
Message-Id: <878zg1g128.fsf@abra.ru>
>>>>> On 30 Aug 2001 12:47:56 GMT, rgarciasuarez@free.fr (Rafael Garcia-Suarez) said:
RG> Ilya Martynov wrote in comp.lang.perl.misc:
RG> }
RG> } Any ideas why following code (under Perl 5.6.1) causes infinite loop?
RG> }
RG> } while(my($value, $uiname) = each %{{ true => 'Yes', false => 'No' }}) {
RG> } print "$uiname\n";
RG> } }
RG> }
RG> } While this code works as expected
RG> }
RG> } my $href = { true => 'Yes', false => 'No' };
RG> } while(my($value, $uiname) = each %{$href}) {
RG> } print "$uiname\n";
RG> } }
RG> Looks like %{{...}} is re-evaluated at each loop iteration; thus a new
RG> hash, and a new each-iterator, is created, positioned at the 1st hash
RG> element. (am I clear?)
Yep. Very clear. Thanks for explanation of mistery.
--
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
| Ilya Martynov (http://martynov.org/) |
| GnuPG 1024D/323BDEE6 D7F7 561E 4C1D 8A15 8E80 E4AE BE1A 53EB 323B DEE6 |
| AGAVA Software Company (http://www.agava.com/) |
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
------------------------------
Date: Thu, 30 Aug 2001 10:09:44 GMT
From: news@mikespub.net (Michel Dalle)
Subject: Re: Godzilla Stomps Code Red
Message-Id: <9ml3q9$i8k$2@dackel.pdb.sbs.de>
In article <3B8D3E08.55B5B701@stomp.stomp.tokyo>, "Godzilla!" <godzilla@stomp.stomp.tokyo> wrote:
>
>There is a very serious note of caution which you should
>abide, do not discount this. Use of either script below
>my signature could very well put you in a World Of Hurt.
[snip]
I'm sure I've seen an almost identical script on the Web,
with the same twisted logic...
The biggest difference was that it didn't contain the user
agent "Godzilla Stomped Your Code Red Infected Server",
and that it had the following copyright notice at the top :
# default.ida in perl
# Copyright 2001 Sam Phillips <sam@dasbistro.com>
# ideas borrowed from Erin Quinlan <erin@dasbistro.com>
# ideas provided by various Internet folk, and all those darn
# Crackmonkeys (http://www.crackmonkey.org) and Pigdoggers
# (http://www.pigdog.org)
:)
Michel.
--
Welcome to Mike's Pub
http://mikespub.net/forum/
------------------------------
Date: Thu, 30 Aug 2001 13:10:22 +0200
From: =?ISO-8859-1?Q?Thomas_B=E4tzler?= <Thomas@Baetzler.de>
Subject: Re: Godzilla Stomps Code Red
Message-Id: <lm7sot4u9891a3oq8mlhddhf104l2fn215@4ax.com>
On Thu, 30 Aug 2001, news@mikespub.net (Michel Dalle) wrote:
[snip]
>I'm sure I've seen an almost identical script on the Web,
>with the same twisted logic...
[snip]
Gee, how dare these people steal Kira's code.
--
Thomas Baetzler - http://baetzler.de/ - Clan LoL - http://lavabackflips.de/
I am the "ILOVEGNU" signature virus. Just copy me to your signature.
This post was infected under the terms of the GNU General Public License.
------------------------------
Date: Thu, 30 Aug 2001 07:01:29 -0400
From: Benjamin Goldberg <goldbb2@earthlink.net>
Subject: Re: Good old regexp teaser
Message-Id: <3B8E1D09.712892C0@earthlink.net>
Anno Siegel wrote:
>
> According to S Warhurst <s.warhurst@rl.ac.uk>:
[snip]
> > Take a string:
> >
> > $line = "subscription= by owner ack= yes confidential= yes";
> >
> > These are listserv keywords and their appropriate settings, eg:
> > "subscription= by owner", "ack= yes" and "confidential= yes". What I
> > want to do is break them up into individual keyword/setting pairs.
>
> One way to do it uses split to break the line at every "<name>="
> point:
>
> my @pairs = split /(\S+=)/, $line;
> shift @pairs; # drop empty first field
> my %assoc = @pairs;
>
> now $assoc{ subscription=} is " by owner", etc. You can take it from
> there.
I don't think you really want the = sign as part of the key, nor do you
want the whitespace from the end of the prior field.
(undef,my %assoc) = split /\s*(\S+)=\s*/, $line, -1;
Will have similar effects to:
%assoc = (
subscription => "by owner",
ack => "yes",
confidential => "yes",
)
--
"I think not," said Descartes, and promptly disappeared.
------------------------------
Date: 30 Aug 2001 12:03:58 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: how to get character from string one by one?
Message-Id: <9mla3e$c6l$1@mamenchi.zrz.TU-Berlin.DE>
According to Tad McClellan <tadmc@augustmail.com>:
> 194.203.212.8 [demerphq@hotmail.com]
> <194.203.212.8[demerphq@hotmail.com]> wrote:
> >> Yves Orton wrote:
>
> >> > 'rex_class' => '$s =~ /([\x00-\xFF])/gs',
> >> ^
> >> The /s modifier isn't required as you are not using the period (.) in
> >> the regex.
> >
> >Hmm. Ok. But do you think it affects efficiency?
>
>
> Without a doubt it has a negative effect on efficiency.
>
> When I see code with "non-default" things, such as options,
> I have to pause in scanning the code to make sure I get what
> non-standard thing is happening...
>
> ... only to discover that NO non-standard thing is happening.
>
> I was tricked into wasting time considering what the 's' was
> there for. ...
And it isn't just the single regex with a superfluous /s. Once you've
seen a few misleading additions that "can't hurt" in a program, trust
in the source is diminished and you'll decide to better read everything
very carefully.
I have heard this addressed as a form of "defensive programming", but
defensive programming is against rouge data. If a programmer feels
the need to defend herself against the language she's using, she can't
be on too friendly terms with it.
Anno
------------------------------
Date: Thu, 30 Aug 2001 12:21:02 +0100
From: "Ash W" <ash@dailydose.net>
Subject: Newbie question
Message-Id: <Okpj7.8212$%P3.64638@news11-gui.server.ntli.net>
Hi all,
I'd really appreciate any insights or suggestions anyone could offer
regarding a query I have please.
I've developed a few web sites that are using Perl scripts running in the
cgi-bin of the server. I won't pretend to understand how the scripts work as
I don't have such a grasp of programming, but I can get by using third party
scripts and modifying them enough to suit my needs as features for the web
pages I've made.
I've just developed a web site that uses a number of Perl scripts, and have
been asked whether it's possible to put the site onto a CD Rom and make it
fully functional. Obviously this won't happen as some of the interactive
features of the site use the Perl scripts, which in turn need the cgi-bin of
the server to function correctly - which in turn requires an active internet
connection to the server.
My query was whether there is a way to emulate the Perl interpreter (that
sits on the server) on a cd rom, so that the site and the scripts would
function on a standalone cd regardless of whether the viewer has an internet
connection or not. The path to the scripts would then be to *something* on
the CD Rom.
I don't know if or how this would be possible to be honest. What I
essentially need is an application on the cd that would run when one of the
forms in the html required a Perl script to process it, and to do so without
forcing the user to have to install Perl on their system. Is this a
non-starter??
Any advice would be very gratefully received.
Thanks for your time.
Ash W
------------------------------
Date: 30 Aug 2001 05:18:25 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: Newbie question
Message-Id: <m1ofoxpwq6.fsf@halfdome.holdit.com>
>>>>> "Ash" == Ash W <ash@dailydose.net> writes:
Ash> My query was whether there is a way to emulate the Perl
Ash> interpreter (that sits on the server) on a cd rom, so that the
Ash> site and the scripts would function on a standalone cd regardless
Ash> of whether the viewer has an internet connection or not. The path
Ash> to the scripts would then be to *something* on the CD Rom.
Ash> I don't know if or how this would be possible to be honest. What
Ash> I essentially need is an application on the cd that would run
Ash> when one of the forms in the html required a Perl script to
Ash> process it, and to do so without forcing the user to have to
Ash> install Perl on their system. Is this a non-starter??
That application is called "a web server". :)
You can either just stick Apache on your CDROM, with a simple
configuration that provides service only for a localhost access, or
you can build a small HTTPD server with HTTP::Daemon. I've done so in
a few of my columns at:
http://www.stonehenge.com/merlyn/WebTechniques/
print "Just another Perl hacker,"
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
------------------------------
Date: Thu, 30 Aug 2001 14:21:25 +0200
From: =?ISO-8859-1?Q?Thomas_B=E4tzler?= <Thomas@Baetzler.de>
Subject: Re: Newbie question
Message-Id: <spbsotcm66c2r74oefhedmouc3ca626gt8@4ax.com>
On Thu, 30 Aug 2001 12:21:02 +0100, "Ash W" <ash@dailydose.net> wrote:
[...]
>I've developed a few web sites that are using Perl scripts running in the
>cgi-bin of the server.
[...]
>My query was whether there is a way to emulate the Perl interpreter (that
>sits on the server) on a cd rom, so that the site and the scripts would
>function on a standalone cd regardless of whether the viewer has an internet
>connection or not. The path to the scripts would then be to *something* on
>the CD Rom.
[...]
Any particular reason why you can't put an Apache webserver on that
CD?
HTH,
--
Thomas Baetzler - http://baetzler.de/ - Clan LoL - http://lavabackflips.de/
I am the "ILOVEGNU" signature virus. Just copy me to your signature.
This post was infected under the terms of the GNU General Public License.
------------------------------
Date: Thu, 30 Aug 2001 11:15:19 +0100
From: JT <CCX138@coventry.ac.uk>
Subject: Re: NT question
Message-Id: <3B8E1237.2B864AEE@coventry.ac.uk>
e2e4@pacbell.net wrote:
>
> How can I get a list of active users off of a NT server from a remote
> location? I can see the list I need using perf mon, but how do I get it
> into a script that will run every 10 minutes?
if the perf mon works at a the command line you can always capture the
out put using backticks.
@all_users = `perf mon`;
you can check if the command worked by checking $?.
Hope that helps.
John
------------------------------
Date: Thu, 30 Aug 2001 11:59:56 GMT
From: "s.petersson" <stefan@wirelessopinion.com>
Subject: Re: perl cgi
Message-Id: <0Vpj7.52212$e5.2448683@newsb.telia.net>
S: This could be an Apache thingy. How is the "ScriptAlias" set, and how
does the <Directory> directive look for the cgi-bin in Your Apache config
file?
> Hi all,
>
> I have the following question.
> I have set the apache will appropriate setting that can run CGI. Then
> I use write a CGI with perl as follow.
>
> #!/usr/bin/perl
>
> print "Content-type: text/html\n\n";
>
> print "<html><head></head>\n";
> print "<h2>abc</h2>\n";
> print "</html>\n";
>
> I put the above script under my home directory (say $HOME/public_html)
> and access it from
> http://localhost/~user/index.cgi
> without problem.
>
> Then I put the above script under a path of my home directory (say
> $HOME/public_html/patha) and
> access it from
> http://localhost/~user/patha/index.cgi
> But the browser shows me the "Internal Server Error" and I found the
> apache error log as follow.
> Premature end of script headers:
> /home/user/public_html/patha/index.cgi
>
> I doubt why it only works under home directory. How do I specify all
> the directories under public_html can work with CGI??
>
> Rgds,
> unplug
------------------------------
Date: Thu, 30 Aug 2001 22:27:35 +1000
From: "Gregory Toomey" <nowhere@dot.com>
Subject: Re: perl cgi
Message-Id: <hfqj7.7303$Nd2.106247@newsfeeds.bigpond.com>
"unplug" <unplug@poboxes.com> wrote in message
news:90f52794.0108300144.14527375@posting.google.com...
> Hi all,
>
> I have the following question.
> I have set the apache will appropriate setting that can run CGI. Then
> I use write a CGI with perl as follow.
...
Have a look at the Perl cgi fixit faq:
http://www.cpan.org/doc/FAQs/cgi/idiots-guide.html
gtoomey
------------------------------
Date: Thu, 30 Aug 2001 12:29:30 GMT
From: mbower@ibuk.bankgesellschaft.de (mbower)
Subject: Re: perl cgi
Message-Id: <3b8e30a3.1811009671@news>
check out the apache/logs/error_log file as well for more specific
messages, but you should also have
<body> </body> in the html.
On Thu, 30 Aug 2001 11:59:56 GMT, "s.petersson"
<stefan@wirelessopinion.com> wrote:
>S: This could be an Apache thingy. How is the "ScriptAlias" set, and how
>does the <Directory> directive look for the cgi-bin in Your Apache config
>file?
------------------------------
Date: Thu, 30 Aug 2001 11:17:22 +0100
From: "Nuno" <nll@nospam.com>
Subject: Perl->M$ SQL
Message-Id: <9ml477$c3e$1@venus.telepac.pt>
Hello, i am working that would connect to a M$ SQL Server and get data.
Can anyone give me some help on this? (interface to use..etc..)
Tanks in Advance
Nuno
------------------------------
Date: Thu, 30 Aug 2001 11:20:07 +0100
From: "Gifford Birchley" <gbirchley@hotmail.com>
Subject: Script not reading templates - why??
Message-Id: <tsoj7.5160$wX5.780202@news6-win.server.ntlworld.com>
I have a Perl application from Network Solutions - ISP Tools v1.3 - which
reads in a set of templates and returns formatted web pages to STDOUT. The
templates are supposed to be editable to customise the HTML output. Problem
is, the script seems to be reading in the templates first time it runs, and
then ignoring them from then on. I can edit, move or delete the templates -
no change! Even rebooting - no change!! I am running RH Linux 7.1,
Apache1.3, Perl 5. Anyone give me a clue as to what's happening?
------------------------------
Date: Thu, 30 Aug 2001 10:14:14 GMT
From: news@mikespub.net (Michel Dalle)
Subject: Re: search.cpan.org
Message-Id: <9ml42n$i8k$3@dackel.pdb.sbs.de>
In article <87wv3lg9so.fsf@abra.ru>, Ilya Martynov <ilya@martynov.org> wrote:
[snip]
>It wasn't sarcasm. I really would like to know if there exists any
>alternative website. I use search.cpan.org often to read perldoc's of
>modules without downloading them and recent problems with
>search.cpan.org are very annoying.
http://theoryx5.uwinnipeg.ca/CPAN/cpan-search.html
YMMV,
Michel.
--
Welcome to Mike's Pub
http://mikespub.net/forum/
------------------------------
Date: Thu, 30 Aug 2001 10:12:17 GMT
From: tim@vegeta.ath.cx (Tim Hammerquist)
Subject: Re: search.cpan.org
Message-Id: <slrn9os52f.3h9.tim@vegeta.ath.cx>
Me parece que Ilya Martynov <ilya@martynov.org> dijo:
> >>>>> On 30 Aug 2001 13:46:15 +0400, Ilya Martynov <ilya@martynov.org> said:
>
> IM> It wasn't sarcasm. I really would like to know if there exists any
> IM> alternative website. I use search.cpan.org often to read perldoc's of
> IM> modules without downloading them and recent problems with
> IM> search.cpan.org are very annoying.
In this case, my apologies to you.
> I've just found good alternative to search.cpan.org:
>
> http://theoryx5.uwinnipeg.ca/CPAN/cpan-search.html
>
> At first look it seems to be even more powerfull CPAN search engine
> than search.cpan.org.
For some reason the theoryx5 site sounds familiar. =) Thank you for
posting the link!
Tim
--
If you do not climb, you will not fall. This is true.
But is it that bad to fail, that hard to fall?
-- Morpheus, The Sandman
------------------------------
Date: Thu, 30 Aug 2001 12:59:38 +0200
From: Tassilo von Parseval <Tassilo.Parseval@post.rwth-aachen.de>
Subject: Re: search.cpan.org
Message-Id: <3B8E1C9A.6030002@post.rwth-aachen.de>
Ilya Martynov wrote:
> I've just found good alternative to search.cpan.org:
>
> http://theoryx5.uwinnipeg.ca/CPAN/cpan-search.html
>
> At first look it seems to be even more powerfull CPAN search engine
> than search.cpan.org.
It seems to offer a few things beyond search.cpan.org. Have you actually
seen ftp://theoryx5.uwinnipeg.ca/pub/other/perldoc-soap ? It is a
modificated perldoc requiring SOAP::Lite that behaves just as the
ordinary perldoc does only that it will retrieve the documentation for a
module from a SOAP-server if the requested documentation can't be found
in your local directory-tree. If you often look up documentation of not
installed modules (you said that you do from time to time) this should
be a nice thing.
Tassilo
--
$a=[(74,116)];$b=[($a->[1]-1,$a->[1]++,0x20)];$c=[(97,110)];$d=[($c->
[1]+1,$b->[1],"her")];for(@{[$a,$b,$c,$d]}){for(@{$_}){$_=~/\d+/?print
(chr($_)):print;}}$c=sub{$l=shift;[(0x20+$l-1,0x50,0x65,0x73-0x01,108
),(0x20,0x68,0x61,)]};print(map{chr($_)}@{($c->(1))});$h={a=>33*3,b=>
10**2+7,c=>"1"."0"."1",d=>0162};@h=sort(keys(%$h));for(@h){print(chr(
ord(chr($h->{$_}))))};
------------------------------
Date: 30 Aug 2001 16:01:26 +0400
From: Ilya Martynov <ilya@martynov.org>
Subject: Re: search.cpan.org
Message-Id: <87n14hg3jd.fsf@abra.ru>
>>>>> On Thu, 30 Aug 2001 12:59:38 +0200, Tassilo von Parseval <Tassilo.Parseval@post.rwth-aachen.de> said:
TvP> Ilya Martynov wrote:
>> I've just found good alternative to search.cpan.org:
>> http://theoryx5.uwinnipeg.ca/CPAN/cpan-search.html
>> At first look it seems to be even more powerfull CPAN search engine
>> than search.cpan.org.
TvP> It seems to offer a few things beyond search.cpan.org. Have you
TvP> actually seen ftp://theoryx5.uwinnipeg.ca/pub/other/perldoc-soap ? It
TvP> is a modificated perldoc requiring SOAP::Lite that behaves just as the
TvP> ordinary perldoc does only that it will retrieve the documentation for
TvP> a module from a SOAP-server if the requested documentation can't be
TvP> found in your local directory-tree. If you often look up documentation
TvP> of not installed modules (you said that you do from time to time) this
TvP> should be a nice thing.
Thanks. I'll try it.
--
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
| Ilya Martynov (http://martynov.org/) |
| GnuPG 1024D/323BDEE6 D7F7 561E 4C1D 8A15 8E80 E4AE BE1A 53EB 323B DEE6 |
| AGAVA Software Company (http://www.agava.com/) |
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
------------------------------
Date: Thu, 30 Aug 2001 14:32:31 +0200
From: Tassilo von Parseval <Tassilo.Parseval@post.rwth-aachen.de>
Subject: Re: search.cpan.org
Message-Id: <3B8E325F.3070400@post.rwth-aachen.de>
Ilya Martynov wrote:
[perldoc-soap]
> Thanks. I'll try it.
Ummh....unfortunately the soap-uri that is used by the script for
retrieving the documentation is no longer valid, as I had to realize. :-(
A quick research hasn't yet brought up an alternative SOAPed
repositoriy of documentation. I wonder whether perldoc.com could
possibly (one day) provide the documentation via SOAP. This'd be quite nice.
Tassilo
--
$a=[(74,116)];$b=[($a->[1]-1,$a->[1]++,0x20)];$c=[(97,110)];$d=[($c->
[1]+1,$b->[1],"her")];for(@{[$a,$b,$c,$d]}){for(@{$_}){$_=~/\d+/?print
(chr($_)):print;}}$c=sub{$l=shift;[(0x20+$l-1,0x50,0x65,0x73-0x01,108
),(0x20,0x68,0x61,)]};print(map{chr($_)}@{($c->(1))});$h={a=>33*3,b=>
10**2+7,c=>"1"."0"."1",d=>0162};@h=sort(keys(%$h));for(@h){print(chr(
ord(chr($h->{$_}))))};
------------------------------
Date: Thu, 30 Aug 2001 07:33:39 -0500
From: "Randy Kobes" <randy@theory.uwinnipeg.ca>
Subject: Re: search.cpan.org
Message-Id: <9mlcct$dnk$1@canopus.cc.umanitoba.ca>
"Tassilo von Parseval" <Tassilo.Parseval@post.rwth-aachen.de> wrote
in message news:3B8E325F.3070400@post.rwth-aachen.de...
> Ilya Martynov wrote:
>
> [perldoc-soap]
>
> > Thanks. I'll try it.
>
> Ummh....unfortunately the soap-uri that is used by the script for
> retrieving the documentation is no longer valid, as I had to realize. :-(
> A quick research hasn't yet brought up an alternative SOAPed
> repositoriy of documentation. I wonder whether perldoc.com could
> possibly (one day) provide the documentation via SOAP. This'd be quite
nice.
What is the URI in your perldoc-soap that's not working? The
original was contained in the lines
my $soap_uri = 'http://theoryx5.uwinnipeg.ca/Apache/DocServer';
my $soap_proxy = 'http://theoryx5.uwinnipeg.ca/soap';
which connects fine from here (locally).
best regards,
randy kobes
------------------------------
Date: Thu, 30 Aug 2001 06:38:57 -0400
From: Benjamin Goldberg <goldbb2@earthlink.net>
Subject: Re: subroutines in @INC ?
Message-Id: <3B8E17C1.1AA3996D@earthlink.net>
Abigail wrote:
>
> Bart Lateur wrote:
> && Anno Siegel wrote:
> &&
> && >So it appears that it does indeed expect a filehandle to be
> && >returned, and a module is read from it if so. No %INC entry is
> && >made.
> &&
> && A file handle?
> &&
> && This sounds like a feature to make tools like perl2exe and perlapp,
> && that include module source into the same file.
> &&
> && But I can imagine doing strange stuff like pulling in modules over
> && a network socket.
>
> You mean as in the following CPAN module?
[snip]
> ($VERSION) =~ q $Revision: 1.1 $ =~ /([\d.]+)/;
Umm, what does (scalar =~ scalar =~ regex) do?
[snip]
> my $fh = IO::File -> new_tmpfile or die "Failed to create temp file: $!\n";
> $fh -> print ($document) or die "Failed to print: $!\n";
> $fh -> seek (0, Fcntl::SEEK_SET()) or die "Failed to seek: $!\n";
>
> $fh;
What's wrong with using an IO::Scalar object?
*my* version of this would be something like:
package ex::lib::www;
our $VERSION = pack "U*", q$Revision$ =~ /\d+/g;
sub import {
shift;
my @baseurls = @_;
push @INC, sub {
require LWP::Simple;
require IO::Scalar;
my $name = pop;
my $doc;
last if $doc = LWP::Simple::get($_.$name)
for( @baseurls );
return unless $doc;
tie local(*fh), "IO::Scalar", \$doc;
*fh;
};
}
__END__
=head1 NAME
ex::lib::www -- Use the world wide web to fetch your required modules.
=head1 SYNOPSIS
use ex::lib::www qw(http://www.example.com/);
use ex::lib::www qw(http://www.example.com/cgi-bin/foo.cgi&file=);
use Module.pm;
=head1 DESCRIPTION
An extension to let you C<use> things direct from the web.
No temporary files. No subprocesses.
=head2 EXPORT
Nothing.
=head1 BUGS
no "no ex::lib::www" to remove things yet.
no code to remove trailing duplicates from @INC yet.
=head1 CAEVATS
untested.
=head1 AUTHOR
Benjamin Goldberg
=head1 SEE ALSO
L<LWP::Simple>
--
"I think not," said Descartes, and promptly disappeared.
------------------------------
Date: 30 Aug 2001 10:35:19 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: system call
Message-Id: <9ml4t7$6pj$1@mamenchi.zrz.TU-Berlin.DE>
According to Doug King <Doug.King@abh.siemens.com>:
>
>
> Tad McClellan wrote:
>
> > Dale Bohl <dbohl@sgi.com> wrote:
> > >Doug King wrote:
> > >>
> > >> Don't do the | awk '{print $5}' in your rsh command, and just parse the
> > >> output of the ls command in perl.
> >
> > Don't do the "ls -l" in your rsh command either:
> >
> > $size = -s '/etc/passwd';
>
> But, that only gives you the size of the /etc/passwd file on the machine the
> perl script is running on. He needs the size of the file on the remote
> machines. Is there a perl-only way to do this? That doesn't rely on perl
> being on the remote machine? ...
How do you expect that to work when the foreign system runs under some
Martian OS? It may not even have files.
Anno
------------------------------
Date: 30 Aug 2001 10:13:37 GMT
From: rgarciasuarez@free.fr (Rafael Garcia-Suarez)
Subject: Re: use statement runs package's subs before they are called
Message-Id: <slrn9os4p8.lvc.rgarciasuarez@rafael.kazibao.net>
Laith Suheimat wrote in comp.lang.perl.misc:
} i thought that 'use <pkg>' simply parses the package, so why is it
} running it?
You thought wrong. 'use' actually runs the package. See the
documentation for 'use' and 'require' in perlfunc.
To test if your .pm file is 'use'd by another program or if it is run as
a standalone program, you can test the value of $^S. It will be true in
the 1st case, false in the second. Look to the perlvar documentation for
more info on $^S.
--
Rafael Garcia-Suarez / http://rgarciasuarez.free.fr/
------------------------------
Date: 30 Aug 2001 10:44:47 GMT
From: Tina Mueller <tinamue@zedat.fu-berlin.de>
Subject: Re: use statement runs package's subs before they are called
Message-Id: <9ml5ev$2ribo$2@fu-berlin.de>
Laith Suheimat <l.suheimat@mdx.ac.uk> wrote:
> i have a package ('PKG') that has a number of subroutines that i call
> from another script, eg:
> use PKG;
> $foo = PKG::pkg_sub1();
> $bar = PKG::pkg_sub2();
> because i now want to run the package as a script, calling it directly
> from the command line, i added calls to the package's subroutines into
> the package script:
> $foo = pkg_sub1();
> $bar = pkg_sub2();
> sub pkg_sub1 {
> ...
> }
> sub pkg_sub2 {
> ...
> }
> the problem is that the use statement in the calling script now
> executes pkg_sub1 and pkg_sub2 (ie. the subs called in the package's
> main::) before they are explicitly called (in fact, as soon as the
> calling script is run).
> i thought that 'use <pkg>' simply parses the package, so why is it
> running it?
well, the answer is on your harddrive. if you check perldoc -f
use, you'll see, it'll call require(). perldoc -f require
will tell you it'll will do() the file.
you should decide if you want to call the file as a module
or as script.
you can also do something like:
my @a = caller();
if ((@a && $a[0] eq __PACKAGE__ )|| !$a[0]) {
$foo = pkg_sub1();
$bar = pkg_sub2();
}
this just calls the methods if it's called from the
commandline or if you set the package explicitly in the
calling script.
hth, tina
--
http://www.tinita.de \ enter__| |__the___ _ _ ___
tina's moviedatabase \ / _` / _ \/ _ \ '_(_-< of
search & add comments \ \ _,_\ __/\ __/_| /__/ perception
--- Warning: content of homepage hopelessly out-dated ---
------------------------------
Date: Thu, 30 Aug 2001 22:30:48 +1000
From: "Gregory Toomey" <nowhere@dot.com>
Subject: Re: Weird @INC if run from web
Message-Id: <jiqj7.7310$Nd2.106457@newsfeeds.bigpond.com>
"Batara Kesuma" <bkesuma@yahoo.com> wrote in message
news:8a89aec5.0108300200.209ec718@posting.google.com...
> Hi,
>
> I tried using require 'something.pl' so I could run the subroutine
> inside that file from my main file. If I run it from the terminal, it
> is ok. But when I try to run it from the web, it gives me 500 error.
> Please help.
Like my other Perl post today, have a look at the Perl cgi fixit faq first:
http://www.cpan.org/doc/FAQs/cgi/idiots-guide.html
gtoomey
------------------------------
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 1655
***************************************