[7690] in Perl-Users-Digest
Perl-Users Digest, Issue: 1316 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Nov 14 02:07:16 1997
Date: Thu, 13 Nov 97 23:00:22 -0800
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, 13 Nov 1997 Volume: 8 Number: 1316
Today's topics:
Re: !Best HW/SW config for Perl (Martien Verbruggen)
[Newbie Q] A simple Remailer problem. (Grey Cloak)
Re: [Q]: Arbitrary sort on field names (Martien Verbruggen)
Re: Adding SYSWRITE method to TIEHANDLE. (Lloyd Zusman)
Can't fetch from Altavista with "url_get" (by Jack Lund <s941046@ccs.sogang.ac.kr>
Clever way to strip empties from an list? (Erik Y. Adams)
Re: Clever way to strip empties from an list? <cs@zip.com.au>
Re: Clever way to strip empties from an list? (Tad McClellan)
Re: CPAN confusion (William R. Ward)
Re: CPAN confusion (William R. Ward)
Re: CPAN confusion (Martien Verbruggen)
Delaying and e-mail send? (Burt Lewis)
Re: Delaying and e-mail send? (Martien Verbruggen)
Getting HTML page bounce@pair.com
Re: Getting HTML page (Martien Verbruggen)
Re: GUI for perl? (John Moreno)
Re: how do you execute external programs with perl (Martien Verbruggen)
Re: how to learn perl (Martien Verbruggen)
Re: Perl.exe (Martien Verbruggen)
Re: precedence question (Martien Verbruggen)
Standard PERL dist under Win95? (sysadmin)
Re: vertical bars in the substitute operator - how? (Martien Verbruggen)
Re: What data is being returned from a form? (Martien Verbruggen)
What is going on here? gnewton@cch.com.au
Re: What is going on here? (Tad McClellan)
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 14 Nov 1997 02:48:12 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: !Best HW/SW config for Perl
Message-Id: <64ge5c$j84$3@comdyn.comdyn.com.au>
In article <eOD59uD88GA.305@nih2naab.prod2.compuserve.com>,
Terry Michaels <74331.3261@CompuServe.COM> writes:
> Greetings!
>
^
What's that stuff?
> I am interested in hearing people's thoughts on what is the
> best hardware/software configuration for using perl and
> internet. Tell me what works for you.
The best hardware and software hasn't been invented yet. it would be
infinitely fast, and have an infinite amount of storage space and
memory. it would also do everything I want without me lifting a
finger.
Hmmm.. that would be a bit boring..
Anyway, That question doesn't make much sense without you giving some
limitations on what sort of money you want to spend. The machine I
described above would be infinitely expensive.
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | Little girls, like butterflies, need no
Commercial Dynamics Pty. Ltd. | excuse - Lazarus Long
NSW, Australia |
------------------------------
Date: 14 Nov 1997 04:25:39 GMT
From: spamtrap@greycloak.access.one.net (Grey Cloak)
Subject: [Newbie Q] A simple Remailer problem.
Message-Id: <slrn66nhvk.7mf.spamtrap@greycloak.access.one.net>
My correct Email is grycloak (at) grycloak.access.one.net
I trying to create a simple Remailer to a fixed address. What I want it
to do is change the subject line send the email and add a footer.
Would like to remove From: line also, but before I attemp that I want to
get it to remove the rest of the headers.
What it does instead is just forward the email unmodified.
This the version of perl I am running:
-------------------------------------------
This is perl, version 5.003 with EMBED
Locally applied patches:
SUIDBUF - Buffer overflow fixes for suidperl security
built under linux at Apr 22 1997 10:04:46
+ two suidperl security patches
---------------------------------------------
I running it on a Linux system.
Now the script:
---------------cut here----------------------
#!/bin/perl -w
#
# -- Mail ban entery to list
#
# Created by GreyCloak for DemonFIRE ban documentation
$MailFile="/home/grycloak/banmail";
$To="grycloak\@greycloak.access.one.net";
$From="temp\@greycloak.access.one.net";
open (OUT, "|/usr/lib/sendmail -oi -t");
print OUT "X-Mailer: Grey Cloak perl Remailer\n";
print OUT "To: $mailaddress\n";
print OUT "From: $From\n";
s/[\012\015]|^ *//g;
if (s/^Subject: //) {
$Subject="Subject: FORWARD: $_";
print OUT "$Subject\n\n";
}
while (<STDIN>) {
print OUT $_;
}
print OUT "----- Remailer Note -------\n";
print OUT "This is a forward message from a temp out through a remailer. \n";
print OUT "Any reply to the message will not reach the sender. \n";
close OUT;
#Now log the results
---------------end cut----------------------
Grey Cloak
---------------------------------------------
.###########. To email change spamtrap to grycloak for faster answer
##'___ ___`## Mailbot Auto sends
## * > < * ## wizardfaq: wizardfaq@greycloak.access.one.net
### ) | | ( ### Docslist: Docslist@greycloak.access.one.net
###\_-===-_/### The above two addresses is a mailbot and will
# ~!!!~ # always send you a file. Don't use it to email me.
http://www.geocities.com/Area51/7614
http://w3.one.net/~grycloak/dreams/dream.htm
------------------------------
Date: 14 Nov 1997 02:45:29 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: [Q]: Arbitrary sort on field names
Message-Id: <64ge09$j84$2@comdyn.comdyn.com.au>
In article <346B12F5.A2470F6B@itis.com>,
Prince Mystery <mystery@itis.com> writes:
> @fieldnames = ("name", "address1", "address2", "city", "state");
>
> If I give the user the option to list a variable amount of field names,
> and end up with an array similar (but smaller) to the one above, how do
> I sort so that they will always appear in some semblance to the order
> implied by the @fieldnames array? (i.e. an array of ("city","name")
> would be sorted to ("name", "city")).
Euhmm.. Why would you need to sort afterwards? If you walk through the
array @fieldnames, adding the selected fields to an array, they should
be sorted in the same way.
my @fieldnames = qw( name address1 address2 city state );
my @selected = ();
foreach my $fn (@fieldnames)
{
pop @selected $fn if (_is_selected($fn));
}
# define _is_selected() here
This should give you an array @selected with the elements in the same
order as they appear in @fieldnames, eliminating the need to sort.
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | I'm just very selective about what I
Commercial Dynamics Pty. Ltd. | accept as reality - Calvin
NSW, Australia |
------------------------------
Date: 14 Nov 1997 03:54:10 GMT
From: ljz@asfast.com (Lloyd Zusman)
Subject: Re: Adding SYSWRITE method to TIEHANDLE.
Message-Id: <slrn66nil6.buu.ljz@ljz.asfast.net>
On Tue, 11 Nov 1997 13:45:20 +0100, Gary Howland <ghowland@hotlava.com> wrote:
> Lloyd Zusman wrote:
> >
> > I chose "SYSWRITE" instead of "WRITE" for the name of this method
> > because this leaves the possibility open for a "WRITE" method to be
> > created some time in the future to be used with the 'write' command
> > during TIEHANDLE processing. Of course, I'm perfectly happy if we use
> > "WRITE" instead of "SYSWRITE" for the name of the method I added if
> > there are no plans for the eventual TIEHANDLE-ing of 'write'.
>
> The 'write' command doesn't do what I think you think it does - it is
> instead used for writing out a formatted record. I think you are
> looking for 'print', not write. and 'PRINT' is already available for use
> with tied filehandles.
You're correct that I was mistaken about 'write', but what I said
about 'syswrite' still stands. It's not possible to use the PRINT
method of TIEHANDLE to intercept calls to 'syswrite', and therefore,
I believe that we need a SYSWRITE method in TIEHANDLE to serve
this purpose.
Perhaps I should clarify ...
Suppose that I'm using a Perl module from CPAN that uses 'print' to
write to a file handle that I specify in my calling program. With the
current (5.004_04) implementation of TIEHANDLE, I could associate my
own PRINT method with the file handle in question and intercept these
calls.
However, suppose I'm using a Perl module that uses 'syswrite' to write
to a file handle that I specify in my calling program (the 'get'
method of Net::FTP is one such example). Given today's TIEHANDLE
implementation, I cannot intercept these 'syswrite' calls in the same
way that I can intercept the 'print' calls I mentioned above.
The intent of the patch I submitted is to add this SYSWRITE capability
to TIEHANDLE.
Keep in mind that there is a READ and a READLINE method in TIEHANDLE.
READLINE is invoked when the <> operator is used, and READ is invoked
when 'read' or 'sysread' is used. My proposed SYSWRITE method would
be symmetrical to the currently-existing READ method, and it would
fill the gap in TIEHANDLE that I mentioned above.
--
Lloyd Zusman
ljz@asfast.com
------------------------------
Date: Fri, 14 Nov 1997 12:14:24 +0900
From: K MIN <s941046@ccs.sogang.ac.kr>
Subject: Can't fetch from Altavista with "url_get" (by Jack Lund)?
Message-Id: <Pine.SGI.3.96.971114120550.9471A-100000@ccs.sogang.ac.kr>
I found a problem with running "url_get" to the search engines,
i.e. Infoseek and Altavista. In the program, "URL.pl", it seems that
URL.pl can parse the query to the search engines, but when the queries are
submitted, "url_get" couldn't work.
For example, when I submit the query("Jack Lund") like below,
url_pl http://www.infoseek.com/Titles?qt=Jack+Lund&col=WW&sv=IS&lk=noframes&nh=10
Then I get the error messages like below:
[1] 13436
http://www.infoseek.com/: No such file or directory
[2] 13437
col=WW: Command not found
sv=IS: Command not found
[3] 13438
lk=noframes: Command not found
[4] 13439
nh=10: Command not found
[4] + Exit 1 lk=noframes
[3] + Exit 1 sv=IS
[2] + Exit 1 col=WW
[1] + Exit 1 url_get http://www.infoseek.com/Titles?qt=Jack+Lund
Similarly, the query "http://www.infoseek.com/Titles?" does not work with
the error message "http://www.infoseek.com/: No such file or directory".
However, the query "http://www.infoseek.com/Titles" DOES work
successfully...so in my opinion, the program "URL.pl" cannot parse
properly with the question mark(?). (The comment which is included in the
URL.pl file, it seems it may work with the search query: "# URL of type:
http://host[:port]/path[?search-string]")
~~~~~~~~~~~~~~
This time, I am completely novice to the Perl language. So if I
misunderstood something, please point out without hesitate.
Thanks in advance,
Koo Min
A senior student, CS Dept., Sogang Univ.(S.J.), Seoul, Korea.
s941046@ccs.sogang.ac.kr
P.S. "URL.pl"'s version is 1.9 by Jack Lund (which I've tested).
And Jack Lund's e-mail address and homepage are not valid
now...Anyone knows?
------------------------------
Date: Thu, 13 Nov 1997 21:08:46 -0800
From: erik@earthlink.net (Erik Y. Adams)
Subject: Clever way to strip empties from an list?
Message-Id: <erik-1311972108460001@pool049-max5.pasadena-ca-us.dialup.earthlink.net>
I've got a perl script that gets passed a list. I join the list elements
together into a scalar and write it to a file. The problem I have is some
of the list's elements are empty, and I'm winding up with some junk.
Here's a snippet that demonstrates the problem:
@list = ("this", "that", "", "", "", "", "");
$string = join ':', @list; # $string is now "this:that:::::";
What I want is is $string to equal "this:that".
I could add another line:
$string =~ s/:*$//g;
But I keep thinking that there's some function I could run against @list
that would automagically eliminate the null values.
I know there's always another way to do something, I'd just like to see
some examples.
Erik
--
----------------------------------------------------------
Erik Y. Adams erik@earthlink.net
Information Systems Consultant 626/795-2701
Internet and Intranet Specialist
------------------------------
Date: 14 Nov 1997 05:16:52 GMT
From: Cameron Simpson <cs@zip.com.au>
To: erik@earthlink.net (Erik Y. Adams)
Subject: Re: Clever way to strip empties from an list?
Message-Id: <19971114171229-cameron-1-05447@sid.research.canon.com.au>
erik@earthlink.net (Erik Y. Adams) writes:
| I've got a perl script that gets passed a list. I join the list elements
| together into a scalar and write it to a file. The problem I have is some
| of the list's elements are empty, and I'm winding up with some junk.
| Here's a snippet that demonstrates the problem:
|
| @list = ("this", "that", "", "", "", "", "");
| $string = join ':', @list; # $string is now "this:that:::::";
|
| What I want is is $string to equal "this:that".
@list=grep(length,@list)
Cheers,
--
Cameron Simpson, DoD#743 cs@zip.com.au http://www.zip.com.au/~cs/
We _like_ the starter! Wouldn't have it any other way. If it doesn't grind,
take it back to the dealer and make them fix it!
- Jon N. Steiger, DoD#1038, <stei0302@mary.cs.fredonia.edu>
------------------------------
Date: Thu, 13 Nov 1997 23:56:51 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Clever way to strip empties from an list?
Message-Id: <37pg46.ij2.ln@localhost>
Erik Y. Adams (erik@earthlink.net) wrote:
: I've got a perl script that gets passed a list. I join the list elements
: together into a scalar and write it to a file. The problem I have is some
: of the list's elements are empty, and I'm winding up with some junk.
: Here's a snippet that demonstrates the problem:
: @list = ("this", "that", "", "", "", "", "");
: $string = join ':', @list; # $string is now "this:that:::::";
: What I want is is $string to equal "this:that".
$string = join ':', grep /./, @list;
--
Tad McClellan SGML Consulting
tadmc@flash.net Perl programming
Fort Worth, Texas
------------------------------
Date: 13 Nov 1997 19:12:41 -0800
From: hermit@cats.ucsc.edu (William R. Ward)
Subject: Re: CPAN confusion
Message-Id: <waa67pw1846.fsf@ese.UCSC.EDU>
mgjv@comdyn.com.au (Martien Verbruggen) writes:
> In article <34671E07.39AB0120@ticnet.com>,
> Kermit Tensmeyer <kermit@ticnet.com> writes:
> > and the assumption is that perl can connect to the CPAN site all on
> > it lonesome.. not a good assumption.
> > At work I sit behind a firewall. I can browse the CPAN site all I want
> > with a browser, but the CPAN module can not connect unless the perl
> > is socksified.
>
> I am behind a firewall, and just use our proxy cache server to
> connect.
>
> perl -MCPAN -e shell
> o conf
>
> That will list options 'http_proxy' 'ftp_proxy' and 'no_proxy'. Just
> set those, and it will work.
What version of Perl is that? I get "Can't locate CPAN.pm in @INC."
when I try that.
Also, does that work through SOCKS or do you have to use a
protocol-specific proxy?
--Bill.
--
William R Ward Bay View Consulting http://www.bayview.com/~hermit/
hermit@bayview.com 1803 Mission St. #339 voicemail +1 408/479-4072
hermit@cats.ucsc.edu Santa Cruz CA 95060 USA pager +1 408/458-8862
------------------------------
Date: 13 Nov 1997 19:17:15 -0800
From: hermit@cats.ucsc.edu (William R. Ward)
Subject: Re: CPAN confusion
Message-Id: <waa4t5g17wk.fsf@ese.UCSC.EDU>
mgjv@comdyn.com.au (Martien Verbruggen) writes:
> In article <64acnr$7q42@holly.colostate.edu>,
> Andrea Beam <abeam@holly.ColoState.EDU> writes:
> > Martien Verbruggen <mgjv@comdyn.com.au> wrote:
> >: No one is forcing you to use CPAN. You could always just write all the
> >: modules yourself.
> >
> > He didn't complain about the quality of the modules. He complained
> > about the layout of CPAN. How would writing all the modules himself
> > solve that?
>
> He wouldn't have to look them up. My point was that if he finds
> looking up modules too hard, he can always write them himself.
>
> As a comparison, before the CPAN days, you had to actually almost know
> where to go to to find code that you could reuse. A script to do this
> could be found at that ftp server, a script to do that at that other
> one. CPAN just was meant to get all of the reusable code in one place,
> neatly organised. Before CPAN, a lot of people DID end up rewriting
> code, because they simply didn't know it already existed. Now it takes
> about five minutes to find out if it has already been done.
True, but I still find the web interface to CPAN confusing (I was the
one who started this thread with the antagonistic message). I have
since come to understand that the web interface to CPAN is not the
primary way one is supposed to go about accessing it, but just the
same I would like to suggest one little change that would go a LONG
way:
Make the module names in the "long module list" be links to
the directories where those modules are found.
Currently, if one is browsing the module list, one can click on the
author code, which takes you to the list of authors, and then from
there you can click again to get to the directory where their stuff
can be found. When I'm looking at the module list I want to get
software, not the 'credits'... that one link would make a huge
difference. It would also help make it more obvious which packages
are actually released and which aren't: the ones that are on the list
as "placeholders" but aren't actually implemented or available
wouldn't have the links.
Who maintains the scripts that generate the HTML module list files?
Perhaps we can persuade this person to add this feature.
--Bill.
--
William R Ward Bay View Consulting http://www.bayview.com/~hermit/
hermit@bayview.com 1803 Mission St. #339 voicemail +1 408/479-4072
hermit@cats.ucsc.edu Santa Cruz CA 95060 USA pager +1 408/458-8862
------------------------------
Date: 14 Nov 1997 05:55:44 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: CPAN confusion
Message-Id: <64gp50$k67$1@comdyn.comdyn.com.au>
In article <waa67pw1846.fsf@ese.ucsc.edu>,
hermit@cats.ucsc.edu (William R. Ward) writes:
> mgjv@comdyn.com.au (Martien Verbruggen) writes:
>> I am behind a firewall, and just use our proxy cache server to
>> connect.
>>
>> perl -MCPAN -e shell
>> o conf
>>
>> That will list options 'http_proxy' 'ftp_proxy' and 'no_proxy'. Just
>> set those, and it will work.
>
> What version of Perl is that? I get "Can't locate CPAN.pm in @INC."
> when I try that.
perl 5.004_04 of course :)
CPAN should be included with recent versions of perl. I would install
the newest if I were you, or if that is not possible, download CPAN.pm,
from CPAN :)
> Also, does that work through SOCKS or do you have to use a
> protocol-specific proxy?
As far as I know, it uses LWP to connect, meaning (AFAIK) that it's
standard HTTP proxy forwarding (or FTP proxy forwarding). No Socks
connections needed.
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | That's not a lie, it's a terminological
Commercial Dynamics Pty. Ltd. | inexactitude.
NSW, Australia |
------------------------------
Date: 14 Nov 1997 03:12:48 GMT
From: burt@ici.net (Burt Lewis)
Subject: Delaying and e-mail send?
Message-Id: <64gfjg$ns9$1@bashir.ici.net>
Hi,
I need to add a 2 hour delay when sending this e-mail.
I would appreciate any help or ideas on doing so.
The operating system is: SunOS Release 4.1.3_U1
I think I need to use the "AT" Unix command but not sure how to put it together.
Thnaks!
Burt Lewis
burt@ici.net
$mailprog = '/bin/mail';
$youmail = 'heyo@lop.net';
open (MAIL, "|$mailprog $youmail");
print MAIL ("From: $FORM{'USERNAME'}\n");
print MAIL ("Subject: Hello there\n\n");
print MAIL ("Good morning\n");
close (MAIL);
------------------------------
Date: 14 Nov 1997 04:32:49 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Delaying and e-mail send?
Message-Id: <64gk9h$jpk$1@comdyn.comdyn.com.au>
In article <64gfjg$ns9$1@bashir.ici.net>,
burt@ici.net (Burt Lewis) writes:
> I need to add a 2 hour delay when sending this e-mail.
Too late. You already sent it :)
> I think I need to use the "AT" Unix command but not sure how to put it together.
That is a possibility.
man at
will tell you all about it.
> $mailprog = '/bin/mail';
> $youmail = 'heyo@lop.net';
You could also use a sleep() command here, and put the program to sleep
for a while. If the system goes down in the meantime, that means the
mail never gets sent. if you use 'at' it will.
> open (MAIL, "|$mailprog $youmail");
Martien
--
Martien Verbruggen | My friend has a baby. I'm writing down
Webmaster www.tradingpost.com.au | all the noises the baby makes so later
Commercial Dynamics Pty. Ltd. | I can ask him what he meant - Steven
NSW, Australia | Wright
------------------------------
Date: Fri, 14 Nov 1997 03:55:51 GMT
From: bounce@pair.com
Subject: Getting HTML page
Message-Id: <346bca8e.21599196@news.mindspring.com>
Does anyone know how to get a web page using a perl CGI
script? The system I am programming on is a unix box..
What I want to do is to get a page and parse it for certain
links and do certain operations based upon what it finds.
If you can help me.. can you also respond via email cause
my news host aint too good bout keeping up with the groups..
thanks
Robert Towster
towster@technologist.com
------------------------------
Date: 14 Nov 1997 06:02:06 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Getting HTML page
Message-Id: <64gpgu$k67$2@comdyn.comdyn.com.au>
In article <346bca8e.21599196@news.mindspring.com>,
bounce@pair.com writes:
> Does anyone know how to get a web page using a perl CGI
> script? The system I am programming on is a unix box..
use
CGI.pm for the CGI stuff
LWP to get web pages from remote servers
HTML::Parser to parse the html in the document
Get them from CPAN if your perl doesn't have them already.
> If you can help me.. can you also respond via email cause
> my news host aint too good bout keeping up with the groups..
I would have done that, if you had set up your news reader to put your
address in the From or Reply-To field, instead of 'bounce@pair.com'. I
don't feel like typing it by hand. Sorry.
> thanks
Sure.
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | In a world without fences, who needs
Commercial Dynamics Pty. Ltd. | Gates?
NSW, Australia |
------------------------------
Date: Thu, 13 Nov 1997 23:53:44 -0500
From: phenix@interpath.com (John Moreno)
Subject: Re: GUI for perl?
Message-Id: <1997111321144619426870N@roxboro-180.interpath.net>
Johannes Amtin <qhsjoam@aom.ericsson.se> wrote:
] I was wondering if anyone has tried to make a GUI for generating perl
] code (or code in a similar language). Just curious.
Nissus have reportedly done a good job creating a gui for regex for use
in their word processor WriteNow - that's not to far off, but I don't
know of anything that gets passed the regex, no loop control, no file
management, etc.
--
John Moreno
------------------------------
Date: 14 Nov 1997 02:51:04 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: how do you execute external programs with perl
Message-Id: <64geao$j84$5@comdyn.comdyn.com.au>
In article <346B1876.7B07@swansea.ac.uk>,
Dean Parratt <eeparrad@swansea.ac.uk> writes:
> I am trying to execute a program or command which has arguments from a
> loop within a perl program so that the command will execute over and
> over again. I have tried exec and system but I can't make them execute
> my command. Can anybody tell me how to do this?
Please, post the code you have tried, so we can tell you where you
possibly went wrong.
> Please email me at
nope, post here, read here.
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | If at first you don't succeed, try
Commercial Dynamics Pty. Ltd. | again. Then quit; there's no use being
NSW, Australia | a damn fool about it.
------------------------------
Date: 14 Nov 1997 02:53:55 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: how to learn perl
Message-Id: <64geg3$j84$7@comdyn.comdyn.com.au>
In article <64fhpi$cd9$2@orudios.magnet.at>,
"Mosl Roland" <founder@pege.org> writes:
> What books would You recommend me?
Go to http://language.perl.com/info/documentation.html
It has a list of excellent books.
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | You can't have everything, where would
Commercial Dynamics Pty. Ltd. | you put it?
NSW, Australia |
------------------------------
Date: 14 Nov 1997 02:49:42 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Perl.exe
Message-Id: <64ge86$j84$4@comdyn.comdyn.com.au>
In article <DqgVSDABcxa0EwrP@kemo1.demon.co.uk>,
Douglas Willock <douglas@kemo.com> writes:
> I have Microsoft Internet Server running on NT server. And I would like
> to be able to execute perl files on the machine, can I just load a
> perl.exe program on to the NT server and associate files with a PL
> extension with the perl.exe program.
Not a perl question. read the documentaition of the server.
> Where can I get this file? (Perl Version 5 would be handy.)
www.ActiveState.com
> Thanks,
sure
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | For heaven's sake, don't TRY to be
Commercial Dynamics Pty. Ltd. | cynical. It's perfectly easy to be
NSW, Australia | cynical.
------------------------------
Date: 14 Nov 1997 02:55:55 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: precedence question
Message-Id: <64gejr$j84$8@comdyn.comdyn.com.au>
In article <01bcf068$8aa40000$3e03b480@mm>,
"Phil R Lawrence" <prl2@lehigh.edu> writes:
> The following causes the help routine to execute no matter what:
>
> &help if ( $arg{uname} =~ /^?|-?$/ );
>
> Why?
because your regular expression doesn't mean much. What are you trying
to match there? And why are you using the question marks at all? Are
you aware that almost all the characters you have in your regular
expression are special?
Martien
--
Martien Verbruggen | My friend has a baby. I'm writing down
Webmaster www.tradingpost.com.au | all the noises the baby makes so later
Commercial Dynamics Pty. Ltd. | I can ask him what he meant - Steven
NSW, Australia | Wright
------------------------------
Date: 14 Nov 1997 05:04:17 GMT
From: nobody@nowhere.com (sysadmin)
Subject: Standard PERL dist under Win95?
Message-Id: <64gm4h$cc6@newsserver.trl.OZ.AU>
I, too, have wondered about this. While I am currently happy running the
MKS 5.004.03 version of PERL on Win95 and the standard release on the HPUX
boxes at work, I'd like to get the standard release which is supposed to
compile with VC++ as well as UNIX. Unfortunately, I cannot even extract
the files from the tar.gz file as they have UNIX case-sensitive files
(specifically '[Cc]onfigure*') which Win95 tries to overwrite with each
other - it has a brain-dead case-insensitive file system.
I do NOT want binaries from ActiveState, etc as the greatest aspect of PERL
is its ability to remove my reliance on third-party suppliers. Give me
the source anyday.
C'est La Vie,
AllanC.
>>>I would like to create and test scripts on my home PC under win95. Small
>>>utility scripts will just be intended to run in the win95 environment...
>>>But I also want to do a little scripting that will work in www sites
>>>with UNIX servers. Assuming I don't get too fancy, should scripts I
>>>create and test at home on win95 run on the unix servers? Just simple
>>>stuff like grocery cart scripts for online ordering...
>>>
>>>Please let me know more about what version of Perl (i.e. 5.004_04, or
>>>???) I should be getting. Should I stick to older versions like 4.0 to
>>>be sure my ISP can support the Perl calls? Is all I need the binaries?
>>>What the heck do I need to do to download and unzip the *.tar.gz files?
>>>
>>>Thanx....
>>>Dan Baker
>>>
------------------------------
Date: 14 Nov 1997 02:59:03 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: vertical bars in the substitute operator - how?
Message-Id: <64gepn$j84$9@comdyn.comdyn.com.au>
In article <879454276.8611@dejanews.com>,
jimndi@sgi.net writes:
> I am trying to replace the vertical bars in an input file with brackets
> using the substitute operator (s/|/]/), but instead I am getting the
*ouch*
read the perlre man pages (perldoc perlre).
| is a special character. You can find it's meaning on the above
mentioned pages.
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | In a world without fences, who needs
Commercial Dynamics Pty. Ltd. | Gates?
NSW, Australia |
------------------------------
Date: 14 Nov 1997 02:52:12 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: What data is being returned from a form?
Message-Id: <64gecs$j84$6@comdyn.comdyn.com.au>
In article <3469D48D.96E7DAF6@achilles.net>,
Gerrard Leach <grleach@achilles.net> writes:
> How do I see the exact stream of data which is coming into the Perl
> script. I have managed to print out the buffer which includes all the
> fields, however, I would like to see all the header information as
> well. Does anyone have any brilliant ideas?
This is not a perl question. This is a CGI question. You might want to
read some more about CGI (never a bad idea). www.cgi-resources.com has
most pointers to useful info.
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | For heaven's sake, don't TRY to be
Commercial Dynamics Pty. Ltd. | cynical. It's perfectly easy to be
NSW, Australia | cynical.
------------------------------
Date: Thu, 13 Nov 1997 21:22:02 -0600
From: gnewton@cch.com.au
Subject: What is going on here?
Message-Id: <879470294.29075@dejanews.com>
I posted the message below via my local news feed, however I got no
replies and it never made it to deja news, so I am trying again this time
from deja news. Sorry if you have already seen it.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
I am having a problem that is beyond my limited perl experience.
Summary: I have a program where I can't open a file after using
require. I also have another program where I apparantly
sucessfully do both of these things.
Playing arround I came up with the following short program where
my problem occurs.
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
print "Roadkill\n\n";
#require "config.pl";
#require "treehouse.pl";
#eval `cat treehouse.pl`;
#use "treehouse.pl";
# do some stuff here and see if it makes any difference
#print "twiddling thumbs\n";
#while ($i < 100){
# print "$i.";
# $i++;
#}
#print "\n";
#$dog = "d:/inetpub/dbscript/configs/dog.txt";
#$dog = "d:/inetpub/dbscript/configs/lastfile.txt";
$dog = "truck.txt";
print "Our dog is called: $dog\n";
print "Is the dog there?: ";
if ( -e $dog ) {
print "yes\n";
} else {
print "no\n";
}
#print "\"", `cat $dog`, "\"\n";
print "Did car open dog?: ";
open car, "$dog";
if ($!) {
print "No\n";
} else {
print "Yes\n";
}
close car;
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
This produces the following output when run.
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
>>> dantuine [perltest]>perl -w temp.pl
Unquoted string "car" may clash with future reserved word at temp.pl
line 32.
Unquoted string "car" may clash with future reserved word at temp.pl
line 39.
Roadkill
Our dog is called: truck.txt
Is the dog there?: yes
Did car open dog?: Yes
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
All well and good. However if I uncomment the line that 'requires
"treehouse.pl"' I get:
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
Unquoted string "car" may clash with future reserved word at temp.pl
line 32.
Unquoted string "car" may clash with future reserved word at temp.pl
line 39.
Roadkill
TREE HOUSE
Our dog is called: truck.txt
Is the dog there?: yes
Did car open dog?: No
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
where treehouse.pl contains
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
print "TREE HOUSE\n";
1;
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
The same thing happens if I uncomment the line that requires
config.pl or the line with "eval `cat treehouse.pl`;" or the line
with "#print "\"", `cat $dog`, "\"\n";"
I have absolutly no idea what is going on. I've looked in
"Programming Perl" 2e and at lots of stuff online.
My initial instinct is that I am doing something incredibly stupid
but I can't for the life of me work out what. My second instinct is
that this is a bug, however if it was it would such an incredibly
huge one that I'm sure I would have seen something about it and it
would not have remained between version 5.002 and 5.003.
This occurs under perl 5.003_07 for win32 and perl 5.002 under solaris.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Greg Newton gnewton@cch.com.au Ph +612 98571660
CCH Australia PO Box 230, North Ryde 2113 fax +612 98571605
-------------------==== Posted via Deja News ====-----------------------
http://www.dejanews.com/ Search, Read, Post to Usenet
------------------------------
Date: Fri, 14 Nov 1997 00:11:32 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: What is going on here?
Message-Id: <k2qg46.1m2.ln@localhost>
gnewton@cch.com.au wrote:
: I am having a problem that is beyond my limited perl experience.
Perl experience galore is available for free in the form of the
documentation that is shipped with every proper perl distribution.
It won't help you if you don't look at it though...
: Summary: I have a program where I can't open a file after using
: require. I also have another program where I apparantly
: sucessfully do both of these things.
: Playing arround I came up with the following short program where
: my problem occurs.
[snip]
: print "Did car open dog?: ";
: open car, "$dog";
: if ($!) {
: print "No\n";
: } else {
: print "Yes\n";
: }
: This produces the following output when run.
: """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
: >>> dantuine [perltest]>perl -w temp.pl
: Unquoted string "car" may clash with future reserved word at temp.pl
: line 32.
: Unquoted string "car" may clash with future reserved word at temp.pl
: line 39.
You should fix that. Else you will have a bunch of code to go fix
when perl introduces a new keyword that collides with your choice
of filehandle name.
Use UPPER CASE for filehandles, then you won't have to worry about it.
: All well and good. However if I uncomment the line that 'requires
If there are -w warnings, then all is not well, nor good.
: Did car open dog?: No
[snip]
: The same thing happens if I uncomment the line that requires
: config.pl or the line with "eval `cat treehouse.pl`;" or the line
: with "#print "\"", `cat $dog`, "\"\n";"
Because all of those effect $!
: I have absolutly no idea what is going on. I've looked in
: "Programming Perl" 2e and at lots of stuff online.
Oh. I guess you missed this part from 'perlvar' then:
-----------
=item $!
If used in a numeric context, yields the current value of errno, with
all the usual caveats. (This means that you shouldn't depend on the
value of "C<$!>" to be anything in particular unless you've gotten a
specific error return indicating a system error.) If used in a string
-----------
You have not gotten a specific error return indicating a system error.
You might have gotten one, but you are ignoring it.
: My initial instinct is that I am doing something incredibly stupid
Your initial instinct is correct ;-)
: but I can't for the life of me work out what. My second instinct is
: that this is a bug, however if it was it would such an incredibly
: huge one that I'm sure I would have seen something about it and it
: would not have remained between version 5.002 and 5.003.
The usual idiom for checking the success of an open() call is:
open CAR, $dog || die "could not open '$dog' $!";
# $! may have stuff from the earlier failure of some other command.
# check the return value from the function itself rather than checking
# to see if there is anything in $!
Or, to force it into something close to what you had:
if (open CAR, $dog) {
print "Yes\n";
close(CAR);
} else {
print "No $!\n";
}
--
Tad McClellan SGML Consulting
tadmc@flash.net Perl programming
Fort Worth, Texas
------------------------------
Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 8 Mar 97)
Message-Id: <null>
Administrivia:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.
The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V8 Issue 1316
**************************************