[16780] in Perl-Users-Digest
Perl-Users Digest, Issue: 4192 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Aug 31 18:05:49 2000
Date: Thu, 31 Aug 2000 15:05:24 -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: <967759524-v9-i4192@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Thu, 31 Aug 2000 Volume: 9 Number: 4192
Today's topics:
Re: "Premature end of script headers" reschramz@my-deja.com
Re: "Premature end of script headers" <lr@hpl.hp.com>
Re: "Premature end of script headers" (Jon Drukman)
Re: `pos' after !//g (Hideaki Hase)
Re: About reading the chinese file. <flavell@mail.cern.ch>
anyone interested in being part of a new website? <root@justbe.com>
Re: anyone interested in being part of a new website? paceman97@aol.com
Array Compare marxjkj123@my-deja.com
Re: Array Compare reschramz@my-deja.com
Re: Array Compare (Tim)
Re: Array Compare marxjkj123@my-deja.com
Re: Array Compare <lr@hpl.hp.com>
Re: Array Compare <lr@hpl.hp.com>
Re: Array Compare (Tim)
Re: Array Compare (Andrew Johnson)
Re: Array Compare <lr@hpl.hp.com>
Re: Array Compare (Andrew Johnson)
Re: Array Compare <lauren_smith13@hotmail.com>
Authentication via PAM ? <ajmas@bigfoot.com>
Re: Bug in perl 5.005_03 or 5.003_01? ("my" and loops) <tim@ipac.caltech.edu>
converting text to doc files... closetgeekla@my-deja.com
Re: Creating a subroutine library for PerlScript (Malcolm Dew-Jones)
Re: Creating a subroutine library for PerlScript <miltginsburg@email.com>
Re: Creating a subroutine library for PerlScript <flavell@mail.cern.ch>
doing a replace task in a file <rocket@acme.com>
Re: doing a replace task in a file <kelley.a.kent@intel.com>
Re: FTP through Firewall???? <rmore1@my-deja.com>
Re: hour difference between localtime and POSIX::mktime <lr@hpl.hp.com>
Re: How get all parameters of cgi-form? (Hasanuddin Tamir)
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 31 Aug 2000 18:13:03 GMT
From: reschramz@my-deja.com
Subject: Re: "Premature end of script headers"
Message-Id: <8om76q$2ef$1@nnrp1.deja.com>
In article <8olm1s$c80$1@nnrp1.deja.com>,
JL Goldstein <jgoldst@my-deja.com> wrote:
.....
> I've got a Perl CGI script that works just fine. However, I check the
> server's error log every so often just for chuckles, and I found a
> "Premature end of script headers" warning for this script. What does
> this apparently non-fatal error mean?
What I want to know is how your script manages to work just fine, when
usually truncated HTTP headers means that the CGI output won't display
at all. Are you using an <!--#exec ... --> or an <!--#include
virtual=... -->? Just curious.
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Thu, 31 Aug 2000 12:29:27 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: "Premature end of script headers"
Message-Id: <MPG.141851f447177e7898ad0d@nntp.hpl.hp.com>
[Rearranged and clipped.]
In article <39AE96CE.C42663A@aol.com> on Thu, 31 Aug 2000 13:33:03 -
0400, paceman97@aol.com <paceman97@aol.com> says...
> JL Goldstein wrote:
...
> > I've got a Perl CGI script that works just fine. However, I check the
> > server's error log every so often just for chuckles, and I found a
> > "Premature end of script headers" warning for this script. What does
> > this apparently non-fatal error mean?
> try to put
> exit;
> at the end of the script
Why? What do you expect that to change?
If the flow of control reaches the end of the program, an exit() is
implicitly performed.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Thu, 31 Aug 2000 21:08:11 GMT
From: jsd@cluttered.com (Jon Drukman)
Subject: Re: "Premature end of script headers"
Message-Id: <slrn8qti98.aqe.jsd@cluttered.com>
On Thu, 31 Aug 2000 18:13:03 GMT,
reschramz@my-deja.com <reschramz@my-deja.com> wrote:
>What I want to know is how your script manages to work just fine, when
>usually truncated HTTP headers means that the CGI output won't display
>at all.
most likely the script works fine some times and outputs errors
other times, which come out before the Content-type header.
using $|=1 sometimes eliminates this situation. better error
checking usually fixes it completely.
-jsd-
------------------------------
Date: 30 Aug 2000 09:13:19 GMT
From: hase@mech.usp.ac.jp (Hideaki Hase)
Subject: Re: `pos' after !//g
Message-Id: <8oij7f$r3a$1@spins1.spins.usp.ac.jp>
> Is there any way to keep the return of `pos' function the value before
> the corresponding pattern matching with `g' option when the matching
> results failure?
Mr|s. nobull@mail.com has told me 'c' option does it. Thank you.
---
Hideaki HASE
School of Mechanical Systems Engineering,
The University of Shiga Prefecture, 522-8533 JAPAN
2500 Hassaka-cho, Hikone-shi, Shiga
Phone: +81-749-28-8394 E-mail: hase@mech.usp.ac.jp
------------------------------
Date: Thu, 31 Aug 2000 19:54:12 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: About reading the chinese file.
Message-Id: <Pine.GHP.4.21.0008311930270.20255-100000@hpplus03.cern.ch>
On Thu, 31 Aug 2000, Bart Lateur wrote:
> In principle, this charset specification may alternatively be included
> in the content-type header. I think that in CGI.pm (I'm not a CGI.pm
> user myself, but the docs seem to suggest it), this should work:
>
> print header('text/html; charset=...');
The advertised method of dealing with charset in CGI.pm uses
the extended form of the argument list
print header(-type=>'text/html',-charset=>'...');
See http://stein.cshl.org/WWW/software/CGI/cgi_docs.html#header
However, in the aftermath of the CA-2000-02 security alert on
malicious content, new versions of CGI.pm went somewhat overboard in
regard to encoding HTML content. I suspect there are still some
issues with handling of non-Latin-1 codings in that area. As I don't
actually handle Chinese codings myself, I'm afraid I can't provide any
practical advice - only to suggest caution, and to urge that someone
who does have a grasp of the detailed issues should feed them back to
Lincoln Stein for use in the package.
On the other hand, anyone who decides to tackle this themselves
instead of relying on an existing module is running a much greater
risk of producing something with unintended security holes, so I'd
certainly stand by the regular advice to use a peer-reviewed and
tested module (we've seen from recent discussions that there are some
differences of opinion on just _which_ module(s) to use, but the
principle is still a good one).
> with the dots replaced by the name of your encoding.
Sure ;-)
------------------------------
Date: Thu, 31 Aug 2000 21:06:35 +0200
From: "Joerg Battermann" <root@justbe.com>
Subject: anyone interested in being part of a new website?
Message-Id: <8omabi$89c$18$1@news.t-online.com>
aloa... i gonna create a new plattform/community dedicated to BSD, linux,
opensource/games etc etc @ discoverthefuture.com (right now the domain is
being
transfered -> http://209.15.45.125 ). we still need people who help us with
the project.
if u are interested, mail me (root@justbe.com) , and i will tell u what u
get.. and what we need etc..
ciao
joerg
------------------------------
Date: Thu, 31 Aug 2000 16:34:57 -0400
From: paceman97@aol.com
Subject: Re: anyone interested in being part of a new website?
Message-Id: <39AEC170.B656ADD0@aol.com>
i'm a web developer/designer and always interested in internet idea's. tell
me more about this.
Joerg Battermann wrote:
> aloa... i gonna create a new plattform/community dedicated to BSD, linux,
> opensource/games etc etc @ discoverthefuture.com (right now the domain is
> being
> transfered -> http://209.15.45.125 ). we still need people who help us with
> the project.
> if u are interested, mail me (root@justbe.com) , and i will tell u what u
> get.. and what we need etc..
>
> ciao
> joerg
------------------------------
Date: Thu, 31 Aug 2000 18:36:48 GMT
From: marxjkj123@my-deja.com
Subject: Array Compare
Message-Id: <8om8ju$49m$1@nnrp1.deja.com>
Hello all, I have a bit of a problem. I have two arrays(array X &
array Y) and need to compare them against one another. If my array(X)
element is equal to an element in array(Y), do nothing. But if an
element in array(X) is not equal to any of the array(Y) elements append
array(X) element results into a third array(Z).
Yes I saw Perl FAQ on intersection but it doesen't help me because I
need to isolate array(X) elements only not the differences between the
two arrays.
thanks
mf
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Thu, 31 Aug 2000 19:02:43 GMT
From: reschramz@my-deja.com
Subject: Re: Array Compare
Message-Id: <8oma43$685$1@nnrp1.deja.com>
In article <8om8ju$49m$1@nnrp1.deja.com>,
marxjkj123@my-deja.com wrote:
> Hello all, I have a bit of a problem. I have two arrays(array X &
> array Y) and need to compare them against one another. If my array(X)
> element is equal to an element in array(Y), do nothing. But if an
> element in array(X) is not equal to any of the array(Y) elements
append
> array(X) element results into a third array(Z).
>
> Yes I saw Perl FAQ on intersection but it doesen't help me because I
> need to isolate array(X) elements only not the differences between the
> two arrays.
Probably an even faster/better/stronger way to do this... If so, I want
to hear it myself.
#!/usr/bin/perl -w
use strict;
my @arrayX = (1, 2, 3, 4, 5, 6);
my @arrayY = (2, 4, 6, 8, 10, 12);
my @arrayZ;
EYE: foreach my $i (@arrayX) {
JAY: foreach my $j (@arrayY) {
if ($i==$j) { next EYE; } else { next JAY; }
} push @arrayZ, $i;
}
print "@arrayZ\n";
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Thu, 31 Aug 2000 19:24:50 GMT
From: SPAM+indigo@dimensional.com (Tim)
Subject: Re: Array Compare
Message-Id: <8FA18CF4Findigodimcom@166.93.207.145>
marxjkj123@my-deja.com wrote in <8om8ju$49m$1@nnrp1.deja.com>:
>Hello all, I have a bit of a problem. I have two arrays(array X &
>array Y) and need to compare them against one another. If my array(X)
>element is equal to an element in array(Y), do nothing. But if an
>element in array(X) is not equal to any of the array(Y) elements append
>array(X) element results into a third array(Z).
>
>Yes I saw Perl FAQ on intersection but it doesen't help me because I
>need to isolate array(X) elements only not the differences between the
>two arrays.
my %h = ();
$h{$_}++ for @X;
push @Z, grep {not exists $h{$_}} @Y;
------------------------------
Date: Thu, 31 Aug 2000 19:46:49 GMT
From: marxjkj123@my-deja.com
Subject: Re: Array Compare
Message-Id: <8omcn0$9kn$1@nnrp1.deja.com>
In article <8oma43$685$1@nnrp1.deja.com>,
reschramz@my-deja.com wrote:
> In article <8om8ju$49m$1@nnrp1.deja.com>,
> marxjkj123@my-deja.com wrote:
> > Hello all, I have a bit of a problem. I have two arrays(array X &
> > array Y) and need to compare them against one another. If my array
(X)
> > element is equal to an element in array(Y), do nothing. But if an
> > element in array(X) is not equal to any of the array(Y) elements
> append
> > array(X) element results into a third array(Z).
> >
> > Yes I saw Perl FAQ on intersection but it doesen't help me because I
> > need to isolate array(X) elements only not the differences between
the
> > two arrays.
>
> Probably an even faster/better/stronger way to do this... If so, I
want
> to hear it myself.
>
> #!/usr/bin/perl -w
>
> use strict;
>
> my @arrayX = (1, 2, 3, 4, 5, 6);
> my @arrayY = (2, 4, 6, 8, 10, 12);
> my @arrayZ;
>
> EYE: foreach my $i (@arrayX) {
> JAY: foreach my $j (@arrayY) {
> if ($i==$j) { next EYE; } else { next JAY; }
> } push @arrayZ, $i;
> }
>
> print "@arrayZ\n";
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
>
My array looks like:
Arrayx
= "weblogic.ejb.deploy=\y:/main/CommerceServer/WORKAREA/WL_Property_WA/W
ebLogicCommerce/lib/STIGA."
and
Array(y)
= "weblogic.ejb.deploy=\y:/main/CommerceServer/WORKAREA/WL_Property_WA/W
ebLogicCommerce/lib/marcus.jary:/main/CommerceServer/WORKAREA/WL_Propert
y_WA/WebLogicCommerce/lib/dave.jary:/main/CommerceServer/WORKAREA/WL_Pro
perty_WA/WebLogicCommerce/lib/stiga.jar"
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Thu, 31 Aug 2000 12:51:08 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: Array Compare
Message-Id: <MPG.1418570527f3b19198ad0e@nntp.hpl.hp.com>
In article <8oma43$685$1@nnrp1.deja.com> on Thu, 31 Aug 2000 19:02:43
GMT, reschramz@my-deja.com <reschramz@my-deja.com> says...
> In article <8om8ju$49m$1@nnrp1.deja.com>,
> marxjkj123@my-deja.com wrote:
> > Hello all, I have a bit of a problem. I have two arrays(array X &
> > array Y) and need to compare them against one another. If my array(X)
> > element is equal to an element in array(Y), do nothing. But if an
> > element in array(X) is not equal to any of the array(Y) elements
> append
> > array(X) element results into a third array(Z).
> >
> > Yes I saw Perl FAQ on intersection but it doesen't help me because I
> > need to isolate array(X) elements only not the differences between the
> > two arrays.
You missed the more relevant FAQ. perlfaq4: "How can I tell whether a
list or array contains a certain element?"
> Probably an even faster/better/stronger way to do this... If so, I want
> to hear it myself.
Read the FAQ referred to. Use a hash!
<SNIP> of ugly O(M) * O(N) algorithm.
Oh, what the hell. Here is an O(M) + O(N) implementation, using your
framework:
#!/usr/bin/perl -w
use strict;
my @arrayX = (1, 2, 3, 4, 5, 6);
my @arrayY = (2, 4, 6, 8, 10, 12);
my %arrayY;
@arrayY{@arrayY} = ();
my @arrayZ = grep !exists $arrayY{$_} => @arrayX;
print "@arrayZ\n";
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Thu, 31 Aug 2000 12:53:39 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: Array Compare
Message-Id: <MPG.141857a2510dcfd398ad0f@nntp.hpl.hp.com>
In article <8FA18CF4Findigodimcom@166.93.207.145> on Thu, 31 Aug 2000
19:24:50 GMT, Tim <SPAM+indigo@dimensional.com> says...
> marxjkj123@my-deja.com wrote in <8om8ju$49m$1@nnrp1.deja.com>:
>
> >Hello all, I have a bit of a problem. I have two arrays(array X &
> >array Y) and need to compare them against one another. If my array(X)
> >element is equal to an element in array(Y), do nothing. But if an
> >element in array(X) is not equal to any of the array(Y) elements append
> >array(X) element results into a third array(Z).
> >
> >Yes I saw Perl FAQ on intersection but it doesen't help me because I
> >need to isolate array(X) elements only not the differences between the
> >two arrays.
>
> my %h = ();
> $h{$_}++ for @X;
> push @Z, grep {not exists $h{$_}} @Y;
You reversed @X and @Y, according to the spec.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Thu, 31 Aug 2000 20:16:23 GMT
From: SPAM+indigo@dimensional.com (Tim)
Subject: Re: Array Compare
Message-Id: <8FA19B897indigodimcom@166.93.207.145>
lr@hpl.hp.com (Larry Rosler) wrote in
<MPG.141857a2510dcfd398ad0f@nntp.hpl.hp.com>:
>In article <8FA18CF4Findigodimcom@166.93.207.145> on Thu, 31 Aug 2000
>19:24:50 GMT, Tim <SPAM+indigo@dimensional.com> says...
>> marxjkj123@my-deja.com wrote in <8om8ju$49m$1@nnrp1.deja.com>:
>>
>> >Hello all, I have a bit of a problem. I have two arrays(array X &
>> >array Y) and need to compare them against one another. If my array(X)
>> >element is equal to an element in array(Y), do nothing. But if an
>> >element in array(X) is not equal to any of the array(Y) elements append
>> >array(X) element results into a third array(Z).
>> >
>> >Yes I saw Perl FAQ on intersection but it doesen't help me because I
>> >need to isolate array(X) elements only not the differences between the
>> >two arrays.
>>
>> my %h = ();
>> $h{$_}++ for @X;
>> push @Z, grep {not exists $h{$_}} @Y;
>
>You reversed @X and @Y, according to the spec.
Um, my choice of variables was completely arbitrary...any similiarity
to the OP's vars is completely coincidental.
:)
-T
------------------------------
Date: Thu, 31 Aug 2000 20:35:07 GMT
From: andrew-johnson@home.com (Andrew Johnson)
Subject: Re: Array Compare
Message-Id: <%jzr5.10484$a5.92481@news1.rdc1.mb.home.com>
In article <MPG.1418570527f3b19198ad0e@nntp.hpl.hp.com>,
Larry Rosler <lr@hpl.hp.com> wrote:
[snip]
> Read the FAQ referred to. Use a hash!
>
> <SNIP> of ugly O(M) * O(N) algorithm.
>
> Oh, what the hell. Here is an O(M) + O(N) implementation, using your
> framework:
Hashes are so archaic -- ya gotta get with the future of computing
Larry:
use Quantum::Superpositions;
my @X = (1, 2, 3, 4, 5, 6);
my @Y = (2, 4, 6, 8, 10, 12);
my @Z = eigenstates(any(@X) != all(@Y));
print "@Z\n";
:-)
regards,
andrew
--
Andrew L. Johnson http://members.home.net/perl-epwp/
Optimist: The glass is half full.
Pessimist: The glass is half empty.
Engineer: The glass is twice as big as it needs to be.
------------------------------
Date: Thu, 31 Aug 2000 14:05:24 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: Array Compare
Message-Id: <MPG.1418686e6ae0258298ad10@nntp.hpl.hp.com>
In article <%jzr5.10484$a5.92481@news1.rdc1.mb.home.com> on Thu, 31 Aug
2000 20:35:07 GMT, Andrew Johnson <andrew-johnson@home.com> says...
...
> Hashes are so archaic -- ya gotta get with the future of computing
> Larry:
>
> use Quantum::Superpositions;
> my @X = (1, 2, 3, 4, 5, 6);
> my @Y = (2, 4, 6, 8, 10, 12);
> my @Z = eigenstates(any(@X) != all(@Y));
> print "@Z\n";
>
> :-)
Benchmarks, please!
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Thu, 31 Aug 2000 21:50:34 GMT
From: andrew-johnson@home.com (Andrew Johnson)
Subject: Re: Array Compare
Message-Id: <KqAr5.10486$a5.92735@news1.rdc1.mb.home.com>
In article <MPG.1418686e6ae0258298ad10@nntp.hpl.hp.com>,
Larry Rosler <lr@hpl.hp.com> wrote:
[snip]
> Benchmarks, please!
I'll run some as soon as Perl and Damian's module are ported to a
suitable quantum platform :-)
andrew
--
Andrew L. Johnson http://members.home.net/perl-epwp/
They're not soaking, they're rusting!
-- my wife on my dishwashing habits
------------------------------
Date: Thu, 31 Aug 2000 14:36:57 -0700
From: "Lauren Smith" <lauren_smith13@hotmail.com>
Subject: Re: Array Compare
Message-Id: <8omj24$nn2$1@brokaw.wa.com>
Larry Rosler <lr@hpl.hp.com> wrote in message
news:MPG.1418686e6ae0258298ad10@nntp.hpl.hp.com...
> In article <%jzr5.10484$a5.92481@news1.rdc1.mb.home.com> on Thu, 31 Aug
> 2000 20:35:07 GMT, Andrew Johnson <andrew-johnson@home.com> says...
>
> ...
>
> > Hashes are so archaic -- ya gotta get with the future of computing
> > Larry:
> >
> > use Quantum::Superpositions;
> > my @X = (1, 2, 3, 4, 5, 6);
> > my @Y = (2, 4, 6, 8, 10, 12);
> > my @Z = eigenstates(any(@X) != all(@Y));
> > print "@Z\n";
> >
> > :-)
>
> Benchmarks, please!
Benchmarks are nice, but not as nice as a well developed proof. Damian
Conway yelled "In constant time!" at me enough times, and that's enough
proof for me.
:-)
Lauren
--
print grep ord $_,map{y/a-zA-Z//d;$x.="+ $_";chr(eval $x)}
'J74u43-s2tA1-84n33o45th1er5-12-P3e13-82r48l21H13-a6-76
c40k25er2wx8-y6z13-81'=~m#([^!\n]{3})#g#tr/-0-9//d;print
------------------------------
Date: Thu, 31 Aug 2000 19:14:56 GMT
From: Andre-John Mas <ajmas@bigfoot.com>
Subject: Authentication via PAM ?
Message-Id: <8omaqr$71k$1@nnrp1.deja.com>
Hi,
Is there a way to authenticate a password against the user
database as specified by PAM, be it LDAP, NIS or /etc/passwd?
Andre
--
http://www.bigfoot.com/~ajmas/
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Thu, 31 Aug 2000 11:40:22 -0700
From: Tim Conrow <tim@ipac.caltech.edu>
Subject: Re: Bug in perl 5.005_03 or 5.003_01? ("my" and loops)
Message-Id: <39AEA696.9998CE84@ipac.caltech.edu>
Heiter wrote:
> Recently I found a part of code in a perl script, which
> behaved differently under two versions of perl.
> Consequently, there must be a bug in one of the versions,
> but I don't know which one behaves correctly.
>
> my @test_array = (1,2,3,4,5,6);
> foreach (@test_array) {
> print shift(@test_array)."\n";
> }
>
> The output was under perl, version 5.003_01 (+ suidperl security patch),
> installed on a dec unix alpha workstation:
> 1
> 2
> 3
> 4
> 5
> 6
>
> under perl, version 5.005_03 built for alpha-linux (Redhat 2.2.14):
> 1
> 2
> 3
It's a change in behavior, not a bug. I assume it's related to the change that
allowed 'for (1..1000000)' to avoid creating a list with 10^6 elements.
>2) In the case of the particular script I found this construct,
>it is not necessary and can be better written like this:
>
>my @test_array = (1,2,3,4,5,6);
># or the same without "my"
>foreach (@test_array) {
> print $_."\n";
>}
Or just ...
print join("\n",@test_array),"\n";
... if @test_array isn't too big.
--
-- Tim Conrow tim@ipac.caltech.edu 626-395-8435
------------------------------
Date: Thu, 31 Aug 2000 19:14:34 GMT
From: closetgeekla@my-deja.com
Subject: converting text to doc files...
Message-Id: <8omaq5$715$1@nnrp1.deja.com>
i need to convert formatted text documents (made from MAS90 reports) to
*.doc with landscape formatiing and with a courier 8pt font. Anyone have
any ideas on how to start?
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: 31 Aug 2000 11:54:36 -0800
From: yf110@vtn1.victoria.tc.ca (Malcolm Dew-Jones)
Subject: Re: Creating a subroutine library for PerlScript
Message-Id: <39aea9ec@news.victoria.tc.ca>
Alex T. (samara_biz@hotmail.com) wrote:
: Hi,
: I am designing a web-site using PerlScript for ASP. I have 3 scripts,
: which have a number of subroutines inside them. Some of them are same
: for all scripts, so I end up having multiple copies of the same
: subroutine.
: I wonder if there's any way I can put them in a separate file and then
: just link this file to all my scripts. I tried using require <library
: name> directive, but it said I have to specify the pathname to the
: library in @INC. After I did that, it still didn't want to use the
: subroutines from that file.
: How would you go about doing this? Could you give me a simple example?
One technique, until you figure out another way, could be to hard code the
path into the scripts.
e.g.
require 'D:/mystuff/testing/sharedlib.pl';
(You can use / or \ in paths, but / is easier to use in a string.)
------------------------------
Date: Thu, 31 Aug 2000 17:13:51 -0400
From: "Milt Ginsburg" <miltginsburg@email.com>
Subject: Re: Creating a subroutine library for PerlScript
Message-Id: <8omhqo$d3m$1@nntp9.atl.mindspring.net>
Malcolm Dew-Jones <yf110@vtn1.victoria.tc.ca> wrote in message
news:39aea9ec@news.victoria.tc.ca...
> Alex T. (samara_biz@hotmail.com) wrote:
> : Hi,
>
> : I am designing a web-site using PerlScript for ASP.
I thought only VBScript and Javascript worked in ASP?
I dropped CIWAH from the followups.
------------------------------
Date: Thu, 31 Aug 2000 23:39:44 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: Creating a subroutine library for PerlScript
Message-Id: <Pine.GHP.4.21.0008312339100.20255-100000@hpplus03.cern.ch>
On Thu, 31 Aug 2000, Milt Ginsburg wrote:
> > : I am designing a web-site using PerlScript for ASP.
>
> I thought only VBScript and Javascript worked in ASP?
Yeah, that figures, from one with your proven ability.
------------------------------
Date: Thu, 31 Aug 2000 12:47:53 -0700
From: JakeRocket <rocket@acme.com>
Subject: doing a replace task in a file
Message-Id: <FF4CFCBCAAED380C.0C67465652F6F6C2.D14EE4DAB4CF2B32@lp.airnews.net>
Well my Perl project has gone well so far using a single Learning Perl
Book. I have hit a brick wall and can't locate much helpuful
information to perfrom the following task. Any help appreciated.
I want to scan through each line in my project, strip some info, and
write a new line. No problem stripping a character.
What I can't seem to figure out how to do is a replace-type action. I
would like to replace all spaces on a line with a quotaion mark and
space.
Thanks in advance.
------------------------------
Date: Thu, 31 Aug 2000 13:07:19 -0700
From: "Kelley Kent" <kelley.a.kent@intel.com>
Subject: Re: doing a replace task in a file
Message-Id: <8omdrb$8p8@news.or.intel.com>
I'm not sure the exact design of your "quotation mark and space"
but here is how to do a replace on a string:
$string =~ s/pattern_old/pattern_new/g;
This will replace pattern_old occurences with pattern_new in $string.
The "s" means substitution. And if you want all occurences (not just
the first one) the "g" options means "global", as in all occurrences.
I think something close to what you want is:
$line =~ s/\s+/ \"/g;
"\s+" means whitespace, and " \"" is a space with a quote (with
an escape character before hand so it's not interpreted as a string).
Hope that helps.
--Kelley
"JakeRocket" <rocket@acme.com> wrote in message
news:FF4CFCBCAAED380C.0C67465652F6F6C2.D14EE4DAB4CF2B32@lp.airnews.net...
> Well my Perl project has gone well so far using a single Learning Perl
> Book. I have hit a brick wall and can't locate much helpuful
> information to perfrom the following task. Any help appreciated.
>
> I want to scan through each line in my project, strip some info, and
> write a new line. No problem stripping a character.
>
> What I can't seem to figure out how to do is a replace-type action. I
> would like to replace all spaces on a line with a quotaion mark and
> space.
>
> Thanks in advance.
------------------------------
Date: Thu, 31 Aug 2000 19:58:34 GMT
From: Rich More <rmore1@my-deja.com>
Subject: Re: FTP through Firewall????
Message-Id: <8omdcr$akk$1@nnrp1.deja.com>
In article <39ae80b2_3@news1.prserv.net>,
"EFM" <emuldown@bellsouth.net> wrote:
> I'm trying to test connecting to an FTP server outside my companies
> firewall. We do't use SOCKS but need to implement user@hostname. I'm
> unfamiliar with this and need a sample script if anyone has one.
From: perldoc lwpcook ( see also: perldoc LWP::UserAgent )
Some proxies also require that you send it a
username/password in order to let requests through. You
should be able to add the required header, with something
like this:
use LWP::UserAgent;
$ua = new LWP::UserAgent;
$ua->proxy(['http', 'ftp'] => 'http://proxy.myorg.com');
$req = new HTTP::Request 'GET',"http://www.perl.com";
$req->proxy_authorization_basic("proxy_user", "proxy_password");
--
=============================
Richard More
http://www.richmore.com/
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Thu, 31 Aug 2000 11:44:53 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: hour difference between localtime and POSIX::mktime
Message-Id: <MPG.1418477d1c061e0a98ad0a@nntp.hpl.hp.com>
In article <G05DC7.1rt@kithrup.com> on Thu, 31 Aug 2000 07:58:57 GMT,
Villy Kruse <vek@pharmnl.ohout.pharmapartners.nl> says...
> On Wed, 30 Aug 2000 10:23:41 -0700, Larry Rosler <lr@hpl.hp.com> wrote:
...
> >Presumably the POSIX Standard for library functions is that of the C
> >Standard, which says this in a footnote:
> >
> > Thus, a positive or zero value for tm_isdst causes the mktime function
> > to presume initially that Daylight Saving Time, respectively, is or is
> > not in effect for the specified time. A negative value for tm_isdst
> > causes the mktime function to attemp to determine whether Daylight
> > Saving Time is in effect for the specified time.
>
> Referring to which standards document? This issue deserves something more
> than a footnote somewhere.
"A footnote somewhere"? Isn't what I said explicit enough?
American National Standard for Information Systems -- Programming
Language -- C
ANSI X3.159-1989
Section 4.12.2.3 The mktime function
Footnote 139
HTH. HAND.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Fri, 01 Sep 2000 08:48:09 GMT
From: hasant@trabas.co.id (Hasanuddin Tamir)
Subject: Re: How get all parameters of cgi-form?
Message-Id: <slrn8qt8hk.me6.hasant@borg.intern.trabas.co.id>
On Thu, 31 Aug 2000 15:30:57 +0600, paul@pco.iis.nsk.su wrote:
> Hello,
>
> It's strange but I could not find the way to do it. I need array of all
> parameters of cgi form.
> I tried $q->param, but it did not work.
If you use v2.50 or later, you can use Vars().
san
--
trabasLabs * hasant@trabas.com * http://www.trabas.com
Zero Point * hasant@zp.f2s.com * http://www.zp.f2s.com
------------------------------
Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 16 Sep 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.
| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.
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 V9 Issue 4192
**************************************