[10223] in Perl-Users-Digest
Perl-Users Digest, Issue: 3816 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Sep 24 17:08:17 1998
Date: Thu, 24 Sep 98 14:00:18 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Thu, 24 Sep 1998 Volume: 8 Number: 3816
Today's topics:
Re: any way to encrypt my script? (Abigail)
Re: Can't get cgi-lib.pl to work!? droby@copyright.com
Re: Can't get cgi-lib.pl to work!? <uri@camel.fastserv.com>
Re: cat reese > /dev/null (was Re: Perl & Java - differ (Abigail)
Re: Database with Perl (Eric Lee Green)
Re: Database with Perl (brian d foy)
Re: help! <adam@lts-csi.com>
Re: How to activate a process on filechange? (Mads Toftum)
Re: how to reduce ugly multiple if statements (David A. Black)
Re: Perl & Java - differences and uses <zenin@bawdycaste.org>
Re: Perl & Java - differences and uses <borg@imaginary.com>
Re: Perl & Java - differences and uses <borg@imaginary.com>
Re: Perl & Java - differences and uses <zenin@bawdycaste.org>
Re: Perl & Java - differences and uses (Abigail)
Re: Perl & Java - differences and uses (Abigail)
Re: Perl & Redirecting STDIN & NT <baliga@synopsys.com>
Perl debugging in windows.... <shellymargolis@erols.com>
Perl GMTIME?? <marlboro9@hknet.com>
Re: Problems running Perlshop on my NT tharper@copperkey.com
Quick question about perl (Juan C. Paez)
Re: Quick question about perl <baliga@synopsys.com>
Sending filehandle to a client before closing socket <user@cisco.com>
Re: Where to put cgi-lib.pl (Patrick Timmins)
Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 24 Sep 1998 20:48:58 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: any way to encrypt my script?
Message-Id: <6ueb7q$eka$3@client3.news.psi.net>
jmh@pubserv.com (jmh@pubserv.com) wrote on MDCCCL September MCMXCIII in
<URL:news:6udma6$add$1@nnrp1.dejanews.com>:
++ I don't mean to get back to the point or anything, but...
++
++ I have a situation in which a client specifically wants the source code
++ "protected" (for my purposes, this can be read "obfuscated"). The portability
++ and ease of use of Perl have made it my choice for implementation, so I was
++ hoping that the original poster's intent was similar to mine.
++
++ Can anyone suggest additional methods for implementing (or resources
++ discussing approaches for) obfuscating Perl code?
1) Lots of knowledge of Perl, including all special cases and syntax
oddities.
2) Keep your programs under 300 bytes, including white space and comment.
3) Charge $300/h for maintainance, $500/h for enhancements.
Of course, choosing Perl for its portability and ease of maintaince, and
then writing obfuscated code is mindboggling.
Abigail
--
sub _'_{$_'_=~s/$a/$_/}map{$$_=$Z++}Y,a..z,A..X;*{($_::_=sprintf+q=%X==>"$A$Y".
"$b$r$T$u")=~s~0~O~g;map+_::_,U=>T=>L=>$Z;$_::_}=*_;sub _{print+/.*::(.*)/s}
*_'_=*{chr($b*$e)};*__=*{chr(1<<$e)};
_::_(r(e(k(c(a(H(__(l(r(e(P(__(r(e(h(t(o(n(a(__(t(us(J())))))))))))))))))))))))
------------------------------
Date: Thu, 24 Sep 1998 18:54:01 GMT
From: droby@copyright.com
Subject: Re: Can't get cgi-lib.pl to work!?
Message-Id: <6ue4g9$r5v$1@nnrp1.dejanews.com>
In article <360111E6.3BF14345@mindspring.com>,
Brian Enderle <benderle@mindspring.com> wrote:
> I am attempting to build a cgi file using the cgi-lib.pl file but am
> unable to get even the simple following script to work:
>
> #!/usr/local/bin/perl
>
> push(@INC, "/cgi-bin/submit");
This is probably the wrong path. "/cgi-bin" is commonly a server-based alias
or at any rate a "relative path" off the server root. You need to find out
(from your server administrator) what the real path is if you need to specify
it.
But this is probably not where you want it.
> require ("cgi-lib.pl");
>
This require happens at compile-time. The above push happens at run-time. So
even if it had the correct path, it would happen to late to help this require
find your library. There is a section in the FAQ dealing with ways to load
your own modules. I'd suggest you read that.
You'd also be better off using CGI.pm. If your server is using a recent
version of Perl, this may also already be there, so that you don't need to
deal with setting up your own library.
> print &PrintHeader;
> print "hello!";
>
> When I try to run the script I just receive a '500 Server Error'
> cgi-bin/submit is the directory where my cgi scripts are stored and the
> server my provider is using is NCSA servers on BSD UNIX machines.
>
The real error is probably in the server's log files. Of course the
administrator might not let you see those, but perhaps you should ask.
> Any help would be greatly appreciated
>
> Brian Enderle
>
> PS: I would prefer replys be sent to my e-mail at
> benderle@mindspring.com
>
>
If you want to learn Perl, and especially if you want to get anything out of
this group, you should read the group.
--
Don Roby
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
------------------------------
Date: 24 Sep 1998 15:23:42 -0400
From: Uri Guttman <uri@camel.fastserv.com>
Subject: Re: Can't get cgi-lib.pl to work!?
Message-Id: <sarvhmdwc01.fsf@camel.fastserv.com>
>>>>> "d" == droby <droby@copyright.com> writes:
>> require ("cgi-lib.pl");
d> This require happens at compile-time. The above push happens at
d> run-time. So even if it had the correct path, it would happen to
d> late to help this require find your library. There is a section in
d> the FAQ dealing with ways to load your own modules. I'd suggest
d> you read that.
require happens at run time unless it is in a BEGIN block. use happens
at compile time.
uri
--
Uri Guttman Fast Engines -- The Leader in Fast CGI Technology
uri@fastengines.com http://www.fastengines.com
------------------------------
Date: 24 Sep 1998 20:28:18 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: cat reese > /dev/null (was Re: Perl & Java - differences and uses)
Message-Id: <6uea12$eka$2@client3.news.psi.net>
Kiril (work@nospam.idea.co.uk) wrote on MDCCCL September MCMXCIII in
<URL:news:360A69FC.D030FE2D@nospam.idea.co.uk>:
++ Ugh-Ogh
++
++ Dear All
++
++ I have had the pleasure of reading Mr. George Reese's rants for more
++ than
++ two years now, most notably on rec.games.mud.*... The pattern of his
++ "arguments",
++ "logic", etc, etc, has always been identical to what has been recently
++ unleashed on c.l.p.m.
I left rec.games.mud.* years ago - just to get away from George. Over 50%
of the postings from him, in the same style his is showing on clpm. And
of course, 80% of the posting were flames against George.
++ Abigail, do you mind sharing with us what is it that you have had to
++ support?
++ Not something called 'Nightmare', per chance :-) ?
Oh, my goodness, no. I don't I could have survived that.
Abigail
--
perl -we 'print split /(?=(.*))/s => "Just another Perl Hacker\n";'
------------------------------
Date: 24 Sep 1998 19:30:57 GMT
From: eric@linux-hw.com (Eric Lee Green)
Subject: Re: Database with Perl
Message-Id: <B0B72B93CDB8E0FE.52BD4C9B77BC6560.E54CDACED0DA6285@library-proxy.airnews.net>
On Thu, 24 Sep 1998 10:48:38 +0200, Marco Jdger <marco.jaeger@dwm.ch> wrote:
>I have to produce a CD-Rom for a customer. Because the content must be
>copied to a web-server, i'd like to do it with HTML and Perl. Can I
>program a database access with perl without using a web-server ?
>(Anything must be viewable with a browser).
CGI runs on the web server. If you are viewing HTML files directly on
your disk without going through a web server, obviously CGI files cannot
run. Try Java or some other client-side language.
But: it's easy enough to run the query beforehand and create a static
data tree. You can use your normal DBI interface to Perl to do your
query, and generate HTML to individual (linked) files containing the
data.
I assume you are trying to create some sort of directory?
--
Eric Lee Green eric@linux-hw.com http://www.linux-hw.com/~eric
Systems Specialist Linux Hardware Solutions -- Quality Designed for Linux
------------------------------
Date: Thu, 24 Sep 1998 16:09:52 -0400
From: comdog@computerdog.com (brian d foy)
Subject: Re: Database with Perl
Message-Id: <comdog-ya02408000R2409981609520001@news.panix.com>
Keywords: from just another new york perl hacker
In article <B0B72B93CDB8E0FE.52BD4C9B77BC6560.E54CDACED0DA6285@library-proxy.airnews.net>, eric@linux-hw.com posted:
>CGI runs on the web server.
CGI doesn't run at all. it's a protocol, not a program. note that
CGI.pm allows one to run CGI scripts from the command line without
an HTTP server. other programs are perfectly able to use CGI scripts
by passing data in the way that the protocol describes.
--
brian d foy <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
Comprehensive Perl Archive Network (CPAN) <URL:http://www.perl.com>
Perl Mongers needs volunteers! <URL:http://www.pm.org/to-do.html>
------------------------------
Date: Mon, 21 Sep 1998 14:30:38 -0400
From: adam <adam@lts-csi.com>
Subject: Re: help!
Message-Id: <36069B4E.2D3B@lts-csi.com>
cim@online.ee wrote:
>
> * open(IPS,"<$ips");
> * @ips = <IPS>;
> * close(IPS);
$last_ten = ($#ips - 9);
> * $all_ips = join('|',@ips);
try:
$last_ten_ips = join '|', @ips[$last_ten .. $#ips];
-adam
> I have a file with separate data on each line:
> data1
> data2
> etc.
>
> I need to get the 10 last ones, not all of them (as the code above
> does)
>
> How can i do it?
------------------------------
Date: Thu, 24 Sep 1998 19:12:19 GMT
From: mt@dev.null (Mads Toftum)
Subject: Re: How to activate a process on filechange?
Message-Id: <360d9652.5114603@news.inet.tele.dk>
On Thu, 24 Sep 1998 16:12:57 GMT, bjshapir@undergrad.math.uwaterloo.ca
(Beaker Ben Shapiro) wrote:
> I am in the situation where I need to write a program that
>essentially sits and watches a set of files to see if any one of
>them changes, and if it does, it needs to copy it quickly to a
>few other filenames as well - they are configuration files and any
>one of them may change.
I used to run a diff on two sets of directories to figure out wether I
needed to run a backup or not, but then I didn't really need high
speed and had lots of cpu power to spare.
If it was something I needed to do very often, I suppose capturing the
output of an `ls -lR` checking wether it is equal to what I got after
the last change. Then just take it from there...
vh.
Mads Toftum, (QDPH/JAPH)
---
A computer lets you make more mistakes faster than any other
invention, with the possible exceptions of handguns and Tequilla.
-- Mitch Ratcliffe
------------------------------
Date: Thu, 24 Sep 1998 16:18:13 EDT
From: dblack@saturn.superlink.net (David A. Black)
Subject: Re: how to reduce ugly multiple if statements
Message-Id: <6ue9e5$kse$1@earth.superlink.net>
Hello -
vicuna@my-dejanews.com writes:
>Hi,
> Background: I have a set of files that needs to be matched to another set
>of files. The second set of files always have the same name results.txt and
>are uniquely identified by their directory path name which should include a
>directory named control. Unfortunately, data entry folks in the past of
>named the control directories idiosyncratically so that sometimes they are
>crtnl crtl crtlrev and so on. What I want to do is loop over guesses as to
>the name of directory. I am using a set of if statements which work but just
>look ugly to me. Basically the structure is:
> $first_guess = 'h:\first\second\third\control\file.ext'; if (!-e
>$first_guess) {$first_guess =~ s/control/cntrl/i; print "found\n"; if (!-e
>$first_guess) {$first_guess =~ s/cntrl/cntrl1/i;print "found\n"} }
> $real = 'h:\first\second\third\cntrl2\file.ext';
> $first_guess = 'h:\first\second\third\control\file.ext';
> if (!-e $first_guess$first_guess ne $real) {
> $first_guess =~ s/control/cntrl/i;
> if (!-e $first_guess) {
> $first_guess =~ s/cntrl/cntrl1/i;
> if (!-e $first_guess) {$first_guess = ();print "not found\n";}
> }
> }
Something's garbled here. But in any case, you could indeed make it
easier to read and to maintain. The only thing is.... I'm not sure how
to make Micros**t pathnames behave with Perl, so my example would have
to be modified by someone who did. Anyway, the approach might be
helpful.
my @dirs = qw( control cntrl cntrl1 );
my $base = 'h:\first\second\third\';
my $file = 'file.ext';
my ($real) = grep { -e && $_ } map { "$base/$_/$file" } @dirs;
David Black
dblack@saturn.superlink.net
------------------------------
Date: 24 Sep 1998 18:55:30 GMT
From: Zenin <zenin@bawdycaste.org>
Subject: Re: Perl & Java - differences and uses
Message-Id: <906663277.387399@thrush.omix.com>
[ Article reposted from comp.lang.python ]
[ Author was Paul Prescod ]
[ Posted on Thu, 24 Sep 1998 17:31:35 GMT ]
Zenin wrote:
>
> Could you make a count object instead? Of course, but that would
> not be functional programming, which of course is fine as functional
> programming isn't all that either.
So why do you mention it? It seems to me that you are casting around,
trying to understand the issue, and writing a usenet post at the same
time. I would suggest you understand and THEN post. Anyhow, I can make
callable objects "up", "set" and "down" whose interface is EXACTLY the
same as yours. I can do this trivially with Python's function defining
features alone, or with classes.
> Beyond this however, there are
> limitations. For instance, what if many (as yet unknown) classes needed
> access to this counter? A global counter object?
If many classes need access to the counter, then you hand them the count
object. But you don't need a count object anyhow. I can make global
functions that behave exactly as your "up", "set" and "down" do, even
though I would consider that obfuscatory and bad practice.
> and we're back to functional and
> procedural programming. What if only one class needed access to it?
> You'd need a class visible "global" object, buy why carry around
> such an animal when all you need is $counter?
An object that is class-visible is not global. The only thing that needs
to be carried around is the counter.
The only real difference between closures and objects is syntax. Sometimes
the closure syntax is more convenient, and it is unfortunate that Python
does not have better support for it. More often. the OO syntax is more
convenient, which is why OO is more popular than functional programming.
Paul Prescod - http://itrc.uwaterloo.ca/~papresco
How many of the Congresspeople who voted for the CDA do you suppose
also voted to release the report that reads like a borderline por-
nographic dime-store romance written by a Texas preacher's son?
- Keith Dawson, TBTF
http://www.tbtf.com/archive/09-14-98.html
http://www.tbtf.com/resource/hypocrites.html
--
-Zenin (zenin@archive.rhps.org) From The Blue Camel we learn:
BSD: A psychoactive drug, popular in the 80s, probably developed at UC
Berkeley or thereabouts. Similar in many ways to the prescription-only
medication called "System V", but infinitely more useful. (Or, at least,
more fun.) The full chemical name is "Berkeley Standard Distribution".
------------------------------
Date: Thu, 24 Sep 1998 19:32:29 GMT
From: George Reese <borg@imaginary.com>
Subject: Re: Perl & Java - differences and uses
Message-Id: <h7xO1.1855$Ge.6111472@ptah.visi.com>
In comp.lang.java.programmer Zenin <zenin@bawdycaste.org> wrote:
: George Reese <borg@imaginary.com> wrote:
: : Inner classes should be avoided like the plague for the most part.
: IYO, of course.
: Please be carful not to phrase your opinions as declarations,
: at least without sighting proof.
You are such a prick. I cite proof. I stated that they open up your
private fields to external classes that would not otherwise have such
access. What about that is not proof?
See, here it is:
: : they allow priveledged package
: : level access to the private members of their containing class.
: In the functional programming paradigm this is considered a
: feature. Beyond that, it is a form of encapsulation. Not object
: based encapsulation of course, but encapsulation none the less.
Well, Java does not support the functional programming paradigm. Only
a tiny small part of inner classes are designed even to work as event
handlers.
--
George Reese (borg@imaginary.com) http://www.imaginary.com/~borg
PGP Key: http://www.imaginary.com/servlet/Finger?user=borg&verbose=yes
"Keep Ted Turner and his goddamned Crayolas away from my movie."
-Orson Welles
------------------------------
Date: Thu, 24 Sep 1998 19:35:18 GMT
From: George Reese <borg@imaginary.com>
Subject: Re: Perl & Java - differences and uses
Message-Id: <W9xO1.1856$Ge.6111472@ptah.visi.com>
In comp.lang.java.programmer Chris Russo <news@russo.org> wrote:
:>John Porter <jdporter@min.net> wrote:
:>> So we (some of us) are still waiting for the proof that
:>> all Americans speak French. Maybe you could cite some Bureau of
:>> Census statistics.
:>
:>George Reese <borg@imaginary.com> writes:
:>> No, this is not the case at all. Only one person has actually
:>> challenged any of my premises. And that appears to be the only
:>> constructive line of discussion going on in this thread.
: George, you threw away your credibility at the very beginning of this
: thread, when you asked for just *one* example of Perl that was simpler
: than an equivalent task performed in Python.
: One was given to you, and you denied that it was simpler - demonstrating a
: clear lack of judgement.
: You've demonstrated no better judgement since then.
: As Mr. Fardy stated, don't let silence be confused for assent.
: I, for one, don't spend a lot of time debating matters with fools.
I threw away my credibility by making it easy to refute my claim???
And the example given had a functionally equivalent python
counterpart.
Sorry, your logic does not follow.
--
George Reese (borg@imaginary.com) http://www.imaginary.com/~borg
PGP Key: http://www.imaginary.com/servlet/Finger?user=borg&verbose=yes
"Keep Ted Turner and his goddamned Crayolas away from my movie."
-Orson Welles
------------------------------
Date: 24 Sep 98 19:33:27 GMT
From: Zenin <zenin@bawdycaste.org>
Subject: Re: Perl & Java - differences and uses
Message-Id: <906665843.590885@thrush.omix.com>
Joseph Allen Dane <jdane@hawaii.edu> wrote:
: Zenin <zenin@bawdycaste.org> writes:
: [ closure stuff ]
: > Java can not do this. Not with interfaces, inner classes, or
: > anything else (well, except for JPL <evil grin>).
:
: Are you sure about this?
Yes.
: Look at the following and tell me what makes it different from what you are
: talking about above.
>snip java example<
: Which produces
:
: 10
: 20
: 15
:
: as output.
$ javac closure.java
closure.java:2: Public interface printer must be defined in a file called
"printer.java".
public interface printer {
^
1 error
$ java -version
java_X version "jdk1.1.5-Freebsd:02/25/98"
It might at that, but we may never know, because it can't even be
*compiled*...
If you're going to play with the big boys, at the very least make
sure your examples actually *run* before you try to use them as
evidence. It reflects badly on you to be so lazy as to not perform
such simple, fundamental tests on your evidence before sighting it
as any form of proof.
--
-Zenin (zenin@archive.rhps.org) From The Blue Camel we learn:
BSD: A psychoactive drug, popular in the 80s, probably developed at UC
Berkeley or thereabouts. Similar in many ways to the prescription-only
medication called "System V", but infinitely more useful. (Or, at least,
more fun.) The full chemical name is "Berkeley Standard Distribution".
------------------------------
Date: 24 Sep 1998 19:36:14 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Perl & Java - differences and uses
Message-Id: <6ue6ve$ddn$1@client3.news.psi.net>
George Reese (borg@imaginary.com) wrote on MDCCCXLIX September MCMXCIII
in <URL:news:8HeO1.1641$Ge.5442150@ptah.visi.com>:
++
++ It is a combination of the two. Given:
++ * OO is a paradigm based on the use and reuse of designed components.
++ * Given proven behaviour of the parts, a process for putting together
++ the parts that is repeatable is going to have an advantage in
++ predictably producing a quality whole.
++ - Thus OO has an advantage over other paradigms.
You have two premisses which both deal with OO. You cannot derive
any conclusion about a relative order between OO and other paradigms
from that.
As for the statements themselves:
- OO is not necessary for use or reuse of designed components. Any
well designed module will do, regardless whether that's OO, functional
or procedurial.
- OO does not prove behaviour. Use and analysis prove behaviour.
OO isn't necessary to use components.
Abigail
--
perl -e '$_ = q *4a75737420616e6f74686572205065726c204861636b65720a*;
for ($*=******;$**=******;$**=******) {$**=*******s*..*qq}
print chr 0x$& and q
qq}*excess********}'
------------------------------
Date: 24 Sep 1998 19:57:54 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Perl & Java - differences and uses
Message-Id: <6ue882$eka$1@client3.news.psi.net>
David Formosa (dformosa@zeta.org.au) wrote on MDCCCL September MCMXCIII
in <URL:news:6uccc3$ocs$1@godzilla.zeta.org.au>:
++ In <906602811.387276@thrush.omix.com> Zenin <zenin@bawdycaste.org> writes:
++
++ [...]
++
++ > This is a function pointer to an anonymous function. A lambda style
++ > function is more powerful as in addition to this aspect, it also holds
++ > the state at the time it was defined. Perl example:
++
++
++ This is what I would noramly call a lambda closure. Could someone please
++ clarify the diffrences between an anonomuous function, a lambda function and
++ a lambda closure?
Anonymous functions and lambda functions or closures are the same. (Well,
some people will say they are not the same, but anonymous functions are
just degenerated lambda functions. Or lambda functions are special case
anonymous function, depending on your point of view). They both will
remember the scopes they were defined in, it's just that functions that
don't use that scope are labelled as "anonymous functions", while those
that do are labelled "closures" or "lambda functions".
Since you came with the term "lambda closure", I let you tell us the
difference.
Abigail
--
perl -we 'print split /(?=(.*))/s => "Just another Perl Hacker\n";'
------------------------------
Date: Thu, 24 Sep 1998 12:14:22 -0700
From: Yogish Baliga <baliga@synopsys.com>
To: Stephen Elias <steven_elias@ml.com>
Subject: Re: Perl & Redirecting STDIN & NT
Message-Id: <360A9A0E.A42FC66A@synopsys.com>
I Think the driver.txt file contain the first line as blank line and the
phrase
STDIN Perl Test
is on the second line of the file
Baliga
Stephen Elias wrote:
> Hello,
>
> I'm using the following version of Perl under NT 4.0
>
> This is perl, version 5.005_02 built for MSWin32-x86-object
>
> Copyright 1987-1998, Larry Wall
>
> Binary build 502 provided by ActiveState Tool Corp.
> http://www.ActiveState.com
> Built 10:59:41 Aug 11 1998
>
> It appears STDIN isn't working as I had expected with Perl. I'm trying
> to redirect (from STDIN) a single line.
>
> I have a file named, driver.txt which contains :
>
> STDIN Perl Test
>
> I have a Perl program named stdin.pl
>
> $my_var = <STDIN> ;
> print("Test Line\n") ;
> print($my_var) ;
>
> I run: stdin.pl <driver.txt & the output is:
>
> Test Line
>
> So, what happened to the file ???
>
> I should point out, running the program, and typing from the keyboard
> works fine as seen in this output
>
> Test Line
> I can type --- * note this line is entered directly from the keyboard
> I can type
>
> Thanks
------------------------------
Date: Thu, 24 Sep 1998 16:45:24 -0400
From: Greg Feingold <shellymargolis@erols.com>
Subject: Perl debugging in windows....
Message-Id: <360AAF64.665F5610@erols.com>
I am new to programming in Perl and am hoping someone can help me with a
problem...
When I create a Perl script (as a text file) and upload it to my ISP and
then run the program from my browser by putting in the URL, I either get
the output I desire or the infamous
"Internal Server Error" message....is there ANYWAY to get some sort of
debugging program, module, or code to give me the errors when the Perl
script compiles?
The problem is our ISP does not allow us to Telnet into their system so
I could just do a simple perl -d debugging execution.
I would really appreciate help asap.
Thanks,
Greg Feingold
------------------------------
Date: Fri, 25 Sep 1998 03:09:34 +0800
From: thief <marlboro9@hknet.com>
Subject: Perl GMTIME??
Message-Id: <360A98EE.718511C9@hknet.com>
I'm use matt's guestbook,How Can I put a script into the gbook.pl to get
the GMTime??
thief
------------------------------
Date: Thu, 24 Sep 1998 19:58:45 GMT
From: tharper@copperkey.com
Subject: Re: Problems running Perlshop on my NT
Message-Id: <6ue89o$vev$1@nnrp1.dejanews.com>
I set the following variables to 'no' in the configuration section of the
perlshop.cgi script, the script will no longer create the PageHits and
Searches files in the log directory.
$create_page_log = 'yes'; ### ("yes" or "no")
$create_search_log = 'yes';
- Roy
In article <3603d737.3787009@nntp.infoave.net>,
cthomas@haleys.net wrote:
> I'm running PerlShop on a UNIX box and have received the same message.
> Check your dir where the cgi is located. Look for a file called
> PageHits.lock, If it's there delete it. Every now and then this file
> appears on my system. When it's there the cgi won"t output. My ISP
> says he's not generating the file. I sent a message to PerlShops
> writers about what could cause this but didn't receive any info. Any
> help on this from you GURUs out there would be appreciated.
>
> On Sat, 19 Sep 1998 15:05:24 +0200, Eyal Moshe <eyal@infomall.co.il>
> wrote:
>
> >Hi all..
> >
> >I'm having problems running Perlshop, free shopping cart software, on my
> >
> >system. When I run it I get the message:
> >
> > "Invalid Transmission #3 received from: 209.88.180.2
> > If your connection was interrupted, you must Enter the shop from
> >the beginning again."
> >
> >209.88.180.2 is my IP.. I'm not sure if I've configured the perl script
> >and especially the paths well. If anyone works with Perlshop in NT and
> >can help me or maybe even send me his configuration file (actually the
> >perl script itself) I'll be VERY thankful.
> >
> >If you know some other free shopping cart for NT, I'd love to hear about
> >
> >it.
> >
> >Thanks in advance,
> >
> >Eyal Moshe
> >
>
>
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
------------------------------
Date: 24 Sep 1998 18:52:03 GMT
From: jcpaez@prairienet.org (Juan C. Paez)
Subject: Quick question about perl
Message-Id: <6ue4cj$h9u$1@wildfire.prairienet.org>
Hi !
I am not an expert, even a beginner in perl. However, I need
to modify a script written in perl. I would
like to know how get the date from script program
in perl
in order to write the date in a file.
I will appreciate any help.
Please answer to jpaezca@banrep.gov.co
Thanks in advance,
Juan
------------------------------
Date: Thu, 24 Sep 1998 12:10:27 -0700
From: Yogish Baliga <baliga@synopsys.com>
To: "Juan C. Paez" <jcpaez@prairienet.org>
Subject: Re: Quick question about perl
Message-Id: <360A9923.DC75E082@synopsys.com>
Hi,
You can use backquotes ( ` ) to execute a system command. If you are
working on any UNIX platform use,
$date_variable = `date`;
For more info about date command, see man page of date.
Baliga
Juan C. Paez wrote:
> Hi !
> I am not an expert, even a beginner in perl. However, I need
> to modify a script written in perl. I would
> like to know how get the date from script program
> in perl
> in order to write the date in a file.
> I will appreciate any help.
> Please answer to jpaezca@banrep.gov.co
>
> Thanks in advance,
> Juan
------------------------------
Date: Thu, 24 Sep 1998 15:25:31 -0400
From: user <user@cisco.com>
Subject: Sending filehandle to a client before closing socket
Message-Id: <360A9CAB.A4B4F957@cisco.com>
With a little help from "Effective Perl Programming" and Jay Rodger's
Net::Telnet, I have been able to create a perl script which creates a
socket on a specified port, connect to a router via Net::Telnet and then
send the information back to the user on a remote system. The remote
user can issue multiple commands but will not recieve information back
from the open socket until they issue an exit command from their
terminal. Is there a way for the filehandle (CLIENT) to return the data
after each command is entered? I am trying to avoid spawning a separate
process each time a command is entered because sometimes multiple
commands are needed to do certain tasks. Below is the code..any
feedback would be appreciated.
Thank you,
Bob
#!/usr/local/bin/perl
use strict;
use Socket;
use Net::Telnet ();
my $port = 2345;
my $proto = getprotobyname 'tcp';
# Create a socket with filehandle SERVER, family INTER, type STREAM,
protocol TCP.
socket SERVER, PF_INET, SOCK_STREAM, $proto or die "socket $!";
# Bind socket to port 2345, allowing connections to any interface
bind SERVER, sockaddr_in($port, INADDR_ANY) or die "bind: $!";
# Begin queueing connections.
listen SERVER, 1 or die "listen: $!";
print "$0 listenting to port $port running pid $$\n";
# Take a connection from the queue. It becomes the bidirectional
filehandle CLIENT.
for (;;){
accept CLIENT, SERVER;
# Send the output of your print command to the client
my ($conf, $t, $newCommand, $this);
$t = new Net::Telnet (Timeout => 8);
$t->dump_log("bob.txt");
$t->open("175.68.106.135");
$t->waitfor('/Password:.*$/');
$this = "password";
$t->print($this);
&moreTelnet;
sub moreTelnet{
$t->waitfor('/\>.*$|--More--|Password:.*$|\#.*$/');
$newCommand = <CLIENT>;
$t->print($newCommand);
($conf) = $t->waitfor('/\>.*$|--More--|Password:.*$|\#.*$/');
$conf =~s/\n/\r\n/g;
print CLIENT $conf;
&moreTelnet;
}
# Close down the client and get another one
close CLIENT;
exit;
}
------------------------------
Date: Thu, 24 Sep 1998 20:43:32 GMT
From: ptimmins@netserv.unmc.edu (Patrick Timmins)
Subject: Re: Where to put cgi-lib.pl
Message-Id: <6ueatk$2f6$1@nnrp1.dejanews.com>
In article <360b821d.20228822@news.ping.be>,
bart.mediamind@ping.be (Bart Lateur) wrote:
> Patrick Timmins wrote:
>
> >> I want to know where to put the cgi-lib.pl file ...
> >
> >Ohhhhhhhhh ... I don't know ...
> >
> >Please re-phrase that ... and probably in a cgi news group!
>
> Oh come on! I'm SURE this must qualify as a Perl question! The question
> is, rephrased: "where can I put it so that Perl can find it", and this
> has NOTHING to do with the CGI protocol.
>
> As for an answer, Robert: you can add an extra directory somewhere where
> YOU have access to, and add a reference to it (absolute or relative) to
> @INC in a BEGIN block. For example, if you add a "lib" folder in your
> cgi-bin directory, this works (using a relative path):
>
> BEGIN {
> unshift @INC, './lib';
> }
Oh go on! You STRANGE have a sure way of doing things!
Where does this 'BEGIN' block go? Oh, you mean in his *CGI* script, which he
has placed in the *CGI*-bin (or where ever the web server is configured to
look for *CGI* scripts)? I assumed he could put cgi-lib.pl in the same
place, since he has access to it for his *CGI* script. But, I guess you know
where you can put it!
Of course, this has NOTHING to do with Perl!
Patrick Timmins
$monger{Omaha}[0]
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
------------------------------
Date: 12 Jul 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Special: Digest Administrivia (Last modified: 12 Mar 98)
Message-Id: <null>
Administrivia:
Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.
If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu.
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.
The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V8 Issue 3816
**************************************