[15562] in Perl-Users-Digest
Perl-Users Digest, Issue: 2975 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon May 8 09:08:58 2000
Date: Mon, 8 May 2000 06:05:12 -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: <957791111-v9-i2975@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Mon, 8 May 2000 Volume: 9 Number: 2975
Today's topics:
Re: 8i + Oraperl DBD mozarty@my-deja.com
Re: @array holding %hash <nospam@devnull.com>
Re: [problem solved] sorting hashes by value rather tha <nospam@devnull.com>
Re: [problem solved] sorting hashes by value rather tha (Randal L. Schwartz)
a cgi problem... <lywong7@hongkong.com>
Re: Best way to connect to MS-SQL Server from Perl? <grassdan@hotmail.com>
Re: BUG? Get comand line parameter with ActiveState Per <enders@mail.sub.uni-goettingen.de>
Command Line input chris2037@my-deja.com
Re: Command Line input <phill@modulus.com.au>
dynamic html <trookat@q-net.net.au>
FAQ for configuring Perl on Win NT <lord_kthulu@hotmail.com>
formmail: different form data gets mixed up <stopp@eye.ch>
Re: formmail: different form data gets mixed up (Eric Bohlman)
Re: Free hosting with Mod_perl ? (Randal L. Schwartz)
Re: Function to filter HTML? <c.treczoks@ndh.net>
Re: Function to filter HTML? (Bart Lateur)
Re: Function to filter HTML? (Randal L. Schwartz)
Getting the platform on which Perl is running (Hans Scholte)
Re: Getting the platform on which Perl is running <billy@arnis-bsl.com>
Help wanted <dan@maxos.com>
how to compile perl <zwong@ascc01.ascc.lucent.com>
Re: How to find a matching ")"? (Bart Lateur)
Re: how to keep your own module/library directory [was: <phill@modulus.com.au>
Re: How to use Perl script in Windows Logon <CharlieL3@yahoo.com>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 08 May 2000 04:41:20 GMT
From: mozarty@my-deja.com
Subject: Re: 8i + Oraperl DBD
Message-Id: <8f5ghe$2gb$1@nnrp1.deja.com>
Hi Don,
I try to do the same for ORACLE 8.1.5
on Sun Solaris 2.6
Could you tell me how exactly looks
your perl Makefile.PL command line ?
Thanks,
Yakov
In article <8euf5f$mj6$1@nnrp1.deja.com>,
db112i@my-deja.com wrote:
> Help,
>
> I have installed Oracle 8i (8.1.6) on Sun
Solaris 7. I have installed
> the latest version of production perl 5.005 and
now I'm trying to build
> DBD and DBI.
>
> The make and build of DBI 1.13 seems to work,
test, and install fine.
>
> The make and build of DBD 1.03 will build but
always fails the "make
> test" with an error that simply says "You need a
> Solaris patch to run this version of java
runtime". No mention of what
> patch.
>
> I've gone to sunsolve and called Sun ... no
help.
> I've gone to metalink and called Oracle ... no
help.
>
> Let my people go. I need an answer.
>
> I realize that ORACLE_HOME/JRE is a link to the
Oracle JRE 1.1.8, but
> you must use this version with Oracle.
>
> Someone must have figured this out.
>
> Thanks,
> -Don
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
>
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: 8 May 2000 10:10:59 GMT
From: The WebDragon <nospam@devnull.com>
Subject: Re: @array holding %hash
Message-Id: <8f63rj$elj$1@216.155.32.56>
In article <391578D0.497EDE20@home.com>, Rick Delaney
<rick.delaney@home.com> wrote:
| > | And why anyone would choose to write it the 'way too tricky'
| > | way is beyond me!
| >
| > that's why I want to know ! I mean, there HAS to be a reason that
| > such a method of parsing the line was included, aside from the
| > possibility that it was accidental. =;)
|
| Because it is not exactly equivalent.
|
| my @a = qw/a b c/;
| my @b = qw/x y z/;
| my @AoA;
| $AoA[0] = \@a;
| # $AoA[0] = [ @b ]; # output = a b c
| @{ $AoA[0] } = @b; # output = x y z
| print "@a\n";
|
| Swap the comment on the lines marked "output" and see how the output
| changes.
|
|
| $AoA[$i] = \@array;
|
| This gives you two ways to access the *same* array. So $AoA[$i][1]
| always refers to the same thing (memory location) as $array[1].
|
| $AoA[$i] = [@array];
|
| This creates a new array with the same contents as @array. Accessing
| $AoA[$i][1] has no relation to accessing $array[1].
|
| @{$AoA[$i]} = @array;
|
| This copies the contents of @array into the array referenced by
| $AoA[$i]. This is only equivalent to the previous case if $AoA[$i] is
| undefined, in which case a new array will be created to hold the
| contents of @array.
thanks again for the details.. :) I've filed this in my bin of snippets
for later 'mnemonic parsing' as my understanding of references slowly
grows into cohesion (cuz it's not there yet)
--
send mail to mactech (at) webdragon (dot) net instead of the above address.
this is to prevent spamming. e-mail reply-to's have been altered
to prevent scan software from extracting my address for the purpose
of spamming me, which I hate with a passion bordering on obsession.
------------------------------
Date: 8 May 2000 10:20:10 GMT
From: The WebDragon <nospam@devnull.com>
Subject: Re: [problem solved] sorting hashes by value rather than by key in a foreach loop
Message-Id: <8f64cq$elj$2@216.155.32.56>
In article <m1snvuwav3.fsf@halfdome.holdit.com>, merlyn@stonehenge.com
(Randal L. Schwartz) wrote:
| >>>>> "The" == The WebDragon <nospam@devnull.com> writes:
|
| The> the docs REALLY need to be more succinct about the possibilities of
| The> generating that error..
|
| The> you see, an inadvertant use of an 'undef' value can also trigger
| that
| The> response.. even if you would think it would assume a zero value for
| The> comparison purposes if you are used to other similar languages...
| :)
|
| If you turn on warnings, you are warned for each detected questionable
| operation. I would certainly want to know if I was passing undef to
| spaceship (<=>), because I wouldn't expect to do that. :)
|
| In this case, the warning system worked as documented, and it would
| have been easy for you to look up the message in perldiag(1), which
| would quickly point out where your error was.
that's just it. I DID look there, but I guess my cluefulness index was
rather low at the time.
| The docs are probably just fine on this point, unless you think it
| possible for the docs to read something like "WebDragon, be careful!
| For this particular operation [and any others, now that we think about
| it], don't pass undef to <=>!". In practice, this is not possible.
No no, I don't mean taking things that far =)
| You are expected to be able to put some text from one section together
| with some text from another to synthesize a larger understanding.
Indeed this is normal, and usually I'm pretty good at collating such
understanding eventually... with one caveat -- 'given enough information
to associate with' :)
| print "Just another Perl hacker," unless undef;
*chuckle* and since 'undef' will never return true, this will always
print.
--
send mail to mactech (at) webdragon (dot) net instead of the above address.
this is to prevent spamming. e-mail reply-to's have been altered
to prevent scan software from extracting my address for the purpose
of spamming me, which I hate with a passion bordering on obsession.
------------------------------
Date: 08 May 2000 05:18:05 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: [problem solved] sorting hashes by value rather than by key in a foreach loop
Message-Id: <m1zoq1tev6.fsf@halfdome.holdit.com>
>>>>> "The" == The WebDragon <nospam@devnull.com> writes:
The> | print "Just another Perl hacker," unless undef;
The> *chuckle* and since 'undef' will never return true, this will always
The> print.
<cowboy_voice>You're new in these parts, aren't ya?</cowboy_voice>
--
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: Mon, 08 May 2000 15:57:08 +0800
From: Ken Wong Lai Yin <lywong7@hongkong.com>
Subject: a cgi problem...
Message-Id: <39167353.37FAB50@hongkong.com>
Dear all,
I have met with a problem...
I'm now trying to set up a http server on pc(Apache), with perl support.
My problem is, when i try send the request from the web page to server
by using form, it works improperly...
By using Netscape...
with no proxy setting, directly connected to Internet, it returns "The
request method POST is not allowed for the URL / testre1.pl"
with proxy setting , the returns is "The requested URL could not be
retrieved........"
what's wrong with it?
Thanks in advanced.
--
Best regards,
Ken
------------------------------
Date: Mon, 8 May 2000 04:12:16 -0700
From: "Dan Grass" <grassdan@hotmail.com>
Subject: Re: Best way to connect to MS-SQL Server from Perl?
Message-Id: <shd87au15uh32@corp.supernews.com>
"Greg Griffiths" <greg2@surfaid.org> wrote in message
news:39156FB9.46FA0E83@surfaid.org...
> try WIN32::ODBC by Tim Roth http://www.roth.net or the DBI module
>
> Tom Williamson wrote:
> >
> > Hello -
> >
> > I'm looking for some information - facts and/or advice - on the best way
to
> > connect to a SQL Server 7 database running on NT, from a Linux box using
> > Perl. So far I have checked www.perl.org, www.perl.com and the CPAN
archive
> > including the FAQs and the DBI/DBD readme files (those I have been able
to
> > locate). I have discovered the following:
> >
> > 1) There is not, so far as I can tell, a DBD::SQLServer module or
anything
> > like it (why?);
> > 2) The DBD::ODBC module (my second choice) cheerfully announces itself
as
> > "ALPHA SOFTWARE - YOUR MILEAGE MAY VARY". Is there another
(non-alpha)
> > module that people can use for ODBC?
> >
> > Is anyone out there actually interfacing Perl to SQL Server? And
please -
> > how are you doing it? If you are using ODBC, how are you creating your
DSN
> > on the Unix client box?
> >
> > Thanks....
The method I use involves ADO heres an example
use Win32::OLE;
$oCon = Win32::OLE->CreateObject("ADODB.Connection") || die
"CreateObject: $!";
$oCon->{Provider} = "SQLOLEDB";
$oCon->{Properties}->{"Initial Catolog"} = "DBname";
$oCon->{Properties}->{"Data Source"} = "Server_Name";
$oCon->{Properties}->{"Integrated Security"} = "SSPI";
$oCon->{Open};
$grpsql = "INSERT INTO nonscamsum (date, totalmachines,) VALUES
(\'$date_variable\', \'$machttl\',)";
$rs = $oCon->Execute($grpsql);
------------------------------
Date: Mon, 08 May 2000 10:39:09 +0100
From: Markus Enders <enders@mail.sub.uni-goettingen.de>
Subject: Re: BUG? Get comand line parameter with ActiveState Perl
Message-Id: <39168B3D.A68B1F49@mail.sub.uni-goettingen.de>
Bart Lateur wrote:
> >print "Anzahl:".$#ARGV."\n";
>
> Er... that's one too few.
Yepp, it is.
> p.s. This is all pretty much beside the point, isn't it? Sorry for that.
:-) It is... I'm still wondering what makes Perl-scripts not to get any
command line parameters anymore and so suddently (from one second to the
other...) And I'm still curious what this message in the event monitor
means...
Does anybody have an idea?
Ciao
Markus
------------------------------
Date: Mon, 08 May 2000 08:08:06 GMT
From: chris2037@my-deja.com
Subject: Command Line input
Message-Id: <8f5skv$fo2$1@nnrp1.deja.com>
Hello,
Reading in command line inputs seems to be the simpliest of tasks. I
have read all I can in books as well as in FAQs but still stuck. I have
tried Getopts, getopt, Getoptions, @ARG but none seem to work the way I
want it to. All I want to do is this:
The user can type in a multitude of switches then filenames like so
myscript -nvrs file1
or
myscript -n file1 file2
or
myscript file1 file2
etc...
Hope you can help. Thanks.
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Mon, 08 May 2000 18:38:58 +1000
From: Peter Hill <phill@modulus.com.au>
Subject: Re: Command Line input
Message-Id: <39167D22.56FB@modulus.com.au>
chris2037@my-deja.com wrote:
>
> Hello,
>
> Reading in command line inputs seems to be the simpliest of tasks. I
> have read all I can in books as well as in FAQs but still stuck. I have
> tried Getopts, getopt, Getoptions, @ARG but none seem to work the way I
> want it to. All I want to do is this:
>
> The user can type in a multitude of switches then filenames like so
>
> myscript -nvrs file1
> or
> myscript -n file1 file2
> or
> myscript file1 file2
> etc...
>
> Hope you can help. Thanks.
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
perldoc perlrun is quite helpful here; in particular look at the -s
switch, which simplifies what you are aiming for; nevertheless, even
without that switch, @ARGV contains your command parameters in a
friendly array.
hth.
--
Peter Hill,
Modulus Pty. Ltd.,
http://www.modulus.com.au/
------------------------------
Date: Mon, 8 May 2000 14:27:37 +0800
From: "Matthew Armarego" <trookat@q-net.net.au>
Subject: dynamic html
Message-Id: <957767281.642127@hearts.q-net.net.au>
is this achivable via perl .. any sites you can refer me to?
------------------------------
Date: Mon, 8 May 2000 14:18:38 +1000
From: "Kthulu" <lord_kthulu@hotmail.com>
Subject: FAQ for configuring Perl on Win NT
Message-Id: <JhrR4.15400$PL4.383799@ozemail.com.au>
Hello from a Perl Newbee,
Is there a FAQ for setting up Perl
on IIS 4 on Win NT Server. I've set security permissions of my CGI
directory to Full Access, I can run *.pl files from a command line but cant
run through a browser. No doubt this is a common and simple problem, does
anyone know what the answer is, or can anyone point me to a relevant FAQ.
TIA,
K
------------------------------
Date: Mon, 08 May 2000 10:29:57 +0200
From: Michael Stopp <stopp@eye.ch>
Subject: formmail: different form data gets mixed up
Message-Id: <39167B05.67679D54@eye.ch>
Hi!
I have a strange problem with my formmail script. It occasionally
happens that somebody gets an email with some data from his own
form and some data from a completely different form. Or even worse:
somebody (who uses the formmail script) gets only data from a
different form.
Unfortunately, this cannot be reproduced. It just happens every
now and then, but more often recently (as more people are using
it). It seems to me that the different processes somehow get
mixed up, probably when two calls of the script happen more or
less simultaneously. But I've no idea whether the problem lies
between Apache and the formmail script or between the formmail
script and sendmail or just within the formmail script itself.
Anybody got a clue about what's going on here? Where do you
start with debugging such a problem?
Any help appreciated!
-Michael
------------------------------
Date: 8 May 2000 09:53:18 GMT
From: ebohlman@netcom.com (Eric Bohlman)
Subject: Re: formmail: different form data gets mixed up
Message-Id: <8f62qe$6bv$2@slb1.atl.mindspring.net>
Michael Stopp (stopp@eye.ch) wrote:
: I have a strange problem with my formmail script. It occasionally
: happens that somebody gets an email with some data from his own
: form and some data from a completely different form. Or even worse:
: somebody (who uses the formmail script) gets only data from a
: different form.
: Unfortunately, this cannot be reproduced. It just happens every
: now and then, but more often recently (as more people are using
: it). It seems to me that the different processes somehow get
: mixed up, probably when two calls of the script happen more or
: less simultaneously. But I've no idea whether the problem lies
: between Apache and the formmail script or between the formmail
: script and sendmail or just within the formmail script itself.
:
: Anybody got a clue about what's going on here? Where do you
: start with debugging such a problem?
Since you haven't provided any code (if the code is substantial, please
post a URL from which the code can be downloaded rather than posting the
code here), it's impossible to do more than guess. Are you using any
temporary files? If so, are you using proper file locking on them (read
the sections in the FAQ on file locking if you haven't already done so)?
If not, it's possible that the results of multiple near-simultaneous
requests are getting jammed together; the seemingly random occurrence of
the problem suggests a race condition of some sort.
------------------------------
Date: 08 May 2000 05:30:24 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: Free hosting with Mod_perl ?
Message-Id: <m1n1m1tean.fsf@halfdome.holdit.com>
>>>>> "Dave" == Dave <daveb@banet.net> writes:
Dave> Anyone know of any companies which offer free hosting which also have
Dave> Mod_perl installed. This is for personal/semi-commercial use.
That's fairly unlikely. I wouldn't let a random user load Perl code
into my server, since there's really no way to keep them from
overwriting %CGI:: or %Apache:: with a trojan horse.
mod_perl works well when everyone who uses the same server is known
and trusted. Not very good for the anonymous random users of a free
hosting service.
--
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: Mon, 08 May 2000 11:27:44 +0200
From: Christian Treczoks <c.treczoks@ndh.net>
Subject: Re: Function to filter HTML?
Message-Id: <39168890.178AD3E3@ndh.net>
Ilmari Karonen schrieb:
> In article <391179C0.AFE59B6B@ndh.net>, Christian Treczoks wrote:
> >What I have: A tainted string (returned from an HTML form).
> >What I want: The string cleaned of any "harmful" HTML formatting.
>
> http://search.cpan.org/search?dist=HTML-Parser-XS
Thanks for the tip, but I got this already. I tossed it because I
would either have to write my string to a file (which is not possible,
no file access on host, only remote DB access), or I would have to
rewrite the whole class (just the thing I'd like to avoid, thank you).
Still searching... there is so much to learn and so little time...
Thank you for your efforts, pal
yours, Christian
------------------------------
Date: Mon, 08 May 2000 11:24:21 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Function to filter HTML?
Message-Id: <39169b0e.11441426@news.skynet.be>
Christian Treczoks wrote:
>I can't believe that there is no function or module for this task:
>
>What I have: A tainted string (returned from an HTML form).
>What I want: The string cleaned of any "harmful" HTML formatting.
>
>No "harmful" HTML is defined by a limitation to certain tags
>(e.g. <I>, </I>, <B>, </B>, <BR>), checking the matching of opening
>and closing tags, and the correctness of special character encodings
>("ü" etc.).
I use HTML::TokeParser for this. Read one item at a time, pass on plain
text, pass on tags only if they're in my list of acceptable tags, and
kill comments and processing instructions. Those last two are a bit
problematic anyway, because HTML::TokeParser doesn't return the original
text for it (Ugh!), as it does for text and tags. The good thing is that
it kills Javascripts as well, which usually are inside comments.
It does NOT check for unrecognized character entities, though. You could
add support for that, both in the plain text items, and inside tag
attributes. I don't see a reason for it: browsers tend to just show them
as plain text if they don't recognize them.
Instead of "print", you can concat into a buffer in memory: replace both
occurences of "print" with "$buffer .=".
#!/usr/local/bin/perl -w
my %allow = map { $_ => 1 } qw(b i u br p); # tags in lower case!
use HTML::TokeParser;
my $p = HTML::TokeParser->new('test.htm')
or die "Cannot read HTML file: $!";
# Alternatively, you may pass a string containing the HTML,
# by passing a reference to the scalar, as:
# $p = HTML::TokeParser->new(\$html);
# or an open file handle:
# $p = HTML::TokeParser->new(*DATA);
my $token;
# $p->get_tag('body'); # optionally, skip header
while($token = $p->get_token) {
if($token->[0] eq 'T') {
# text aka #PCDATA
print $token->[-1];
} elsif ($token->[0] =~ /[SE]/) {
# start or end tag
print $token->[-1] if $allow{$token->[1]};
}
}
--
Bart.
------------------------------
Date: 08 May 2000 05:16:44 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: Function to filter HTML?
Message-Id: <m17ld5uthv.fsf@halfdome.holdit.com>
>>>>> "Christian" == Christian Treczoks <c.treczoks@ndh.net> writes:
>> http://search.cpan.org/search?dist=HTML-Parser-XS
Christian> Thanks for the tip, but I got this already. I tossed it
Christian> because I would either have to write my string to a file
Christian> (which is not possible, no file access on host, only remote
Christian> DB access), or I would have to rewrite the whole class
Christian> (just the thing I'd like to avoid, thank you).
Uh, my mind boggles. Why do you think you need to write the string to
a file? All HTML::Parser (XS version) does is call your callbacks.
Your callbacks can do *anything* with the data; they don't have to
write it to a file!
Or, on re-reading this, perhaps you mean your input string has to come
from a file? Again, not true. The ->parse() method takes the string
directly. See the synopsis.
In either case, I've written more than one program that uses
HTML::Parser to go from memory to memory, never involving a file.
Some examples are 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: Mon, 08 May 2000 11:14:32 GMT
From: hans@salience.nl (Hans Scholte)
Subject: Getting the platform on which Perl is running
Message-Id: <3916a10d.12672762@news.nl.net>
Hi,
Does anybody know if there is a way (a standard function or some
predefined variable) to ask Perl on what platform it is running?
Thanks in advance,
Hans Scholte
------------------------------
Date: Mon, 08 May 2000 11:48:42 GMT
From: Ilja <billy@arnis-bsl.com>
Subject: Re: Getting the platform on which Perl is running
Message-Id: <8f69im$sre$1@nnrp1.deja.com>
In article <3916a10d.12672762@news.nl.net>,
hans@salience.nl (Hans Scholte) wrote:
> Hi,
>
> Does anybody know if there is a way (a standard function or some
> predefined variable) to ask Perl on what platform it is running?
>
From perlfaq8:
"How do I find out which operating system I'm running under?"
The $^O variable ($OSNAME if you use English) contains the operating system
that your perl binary was built for.
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Mon, 08 May 2000 11:02:47 GMT
From: Dan Graham <dan@maxos.com>
Subject: Help wanted
Message-Id: <39169F30.61A9FF80@maxos.com>
This is a multi-part message in MIME format.
--------------24FEBDC576DFA6BD3578ECA9
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Programmers wanted for Linux dev, C, C++, TKL/TK and Perl prefered in
the Edmonton, Alberta area.
Send resumes to Dan Graham. dan@maxos.com
--------------24FEBDC576DFA6BD3578ECA9
Content-Type: text/x-vcard; charset=us-ascii;
name="dan.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Dan Graham
Content-Disposition: attachment;
filename="dan.vcf"
begin:vcard
n:Graham;Dan
x-mozilla-html:TRUE
adr:;;;;;;
version:2.1
email;internet:dan@maxos.com
x-mozilla-cpt:;-9152
fn:Dan Graham
end:vcard
--------------24FEBDC576DFA6BD3578ECA9--
------------------------------
Date: Mon, 08 May 2000 13:46:52 +0800
From: Tim Wang Zhiyan <zwong@ascc01.ascc.lucent.com>
Subject: how to compile perl
Message-Id: <391654CC.54EC6801@ascc01.ascc.lucent.com>
I have used module Net::FTP write a tool which can transfer a file
automatically. I'd like compile this tool so that when I installed it on
another machine, I do not need to configure the environment. But when I
tried to use "perlcc" to compile it, it only compile the tool itself, it
didn't compile Net::FTP modules. How can I make it runnable in a machine
(UNIX) which only has perl itself?
Thanks!
------------------------------
Date: Mon, 08 May 2000 09:15:00 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: How to find a matching ")"?
Message-Id: <39167ead.4176002@news.skynet.be>
Dayang Lily wrote:
>(value name linda mary)
>(value class A B C)
>(value title "Note").
>
>My script works something like this:
>while(<my_file>) {
> if(/value name/)
> { $thename = $_}
> if(/value title)
> { $thetitle = $_
> &dosomething($thename,$thetitle)}
>}
>
>The problem occurs when I have more than one line in the list, eg
>(value name linda mary
>jane peter
>joan ross
>)
>How do I read this entire list into my variable? How do I find a
>matching ")"?
I've been thinking about using a "/(/ .. /)/" construct for that. Let's
see if I can make it work.
while(<DATA>) {
if((/\(value\s+(\w+)\s*([^\)\n]*)/g and my($open, $cont) = ($1, $2))
.. (/\G(.*?)\)/g and my($close) = $1)) {
print "OPEN: $open\n$cont\n" if defined $open;
print "-> $_" unless defined $open || defined $close;
print "CLOSE: $close\n" if defined $close;
}
}
__DATA__
(value name linda mary)
(value class A B C)
(value title and now
for something
really funky)
A bit of explanation:
- The second test, following "..", is done even if the first one
succeeds. Therefore, opening and closing parentheses on the same line
can be detected.
- The second test continues where the first test left off. If it fails,
this failure will reset pos(), so on the next line it will start
matching again at the beginning of the line, which is exactly what I
want.
- I need //g for the /\G/ thing to work. But, OTOH, //g will interefere
with any attempt to directly capture the matches, because that would
generate a list context for the regex, and make it match globally, and
not stop at one. That's why I need the
/(PAT)/g and $match = $1
- If the first test succeeds (opening parentheses) but the second fails
(no closing parentheses), I lost my pos() index. That is why the regex
in the first test captures so much --> $cont.
Oh, and for the lazy/impatient people, this is the output of the above
script. Feel free to improve on it.
OPEN: name
linda mary
CLOSE:
OPEN: class
A B C
CLOSE:
OPEN: title
and now
-> for something
CLOSE: really funky
--
Bart.
------------------------------
Date: Mon, 08 May 2000 18:25:21 +1000
From: Peter Hill <phill@modulus.com.au>
Subject: Re: how to keep your own module/library directory [was: how to compile perl]
Message-Id: <391679F1.2EED@modulus.com.au>
Tim Wang Zhiyan wrote:
>
> I have used module Net::FTP write a tool which can transfer a file
> automatically. I'd like compile this tool so that when I installed it on
> another machine, I do not need to configure the environment. But when I
> tried to use "perlcc" to compile it, it only compile the tool itself, it
> didn't compile Net::FTP modules. How can I make it runnable in a machine
> (UNIX) which only has perl itself?
>
> Thanks!
perlfaq8 provides information on "How to keep your own module/library
directory".
Thus, you don't need the sysadmin to install Net::FTP; you can do so
yourself.
Thus, you don't need to compile perl (which, as you've noted, is not a
good solution).
Thus, I've changed the subject line.
--
Peter Hill,
Modulus Pty. Ltd.,
http://www.modulus.com.au/
------------------------------
Date: Mon, 08 May 2000 01:56:28 -0400
From: Chuck Lawhorn <CharlieL3@yahoo.com>
Subject: Re: How to use Perl script in Windows Logon
Message-Id: <3916570B.368BC8BA@yahoo.com>
Put PerlCRT.dll into the NetLogon share of all your domain controllers. I use
scripts compiled with Perl2Exe in my scripts, and I put both of the required
DLL's (PerlCRT and P2xdll.dll) into the NetLogon shares, and the compiled script
runs on all PC's using logon scripts.
Hope this helps,
--Chuck
JP wrote:
> I am trying to put a logon script into the NT Netlogon share so that users
> have to run the script during a login. The script is called by a batch file
> and the domain controllers are all installed with Perl.
>
> The problem I have is that the script keeps complaining that the dynamic
> library PerlCRT.dll cannot be located. There is no Perl installed on the
> client. But I can run the script if I log on to the server.
>
> How can I have the logon script runs probably when the client log on from a
> workstation?
>
> TIA.
------------------------------
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 2975
**************************************