[7472] in Perl-Users-Digest
Perl-Users Digest, Issue: 1097 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Sep 29 16:07:20 1997
Date: Mon, 29 Sep 97 10:00:22 -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 Mon, 29 Sep 1997 Volume: 8 Number: 1097
Today's topics:
re: Advanced Perl Programming <sriram@weblogic.com>
Re: Anyone ever written to a GIF file from perl <Thomas.Parsli@nrk.no>
Can I use Perl for this? (David Lam)
Re: Change /etc/passwd <jstrick@mindspring.com>
Re: Die and the Web <mooneer@earthlink.net>
Re: Die and the Web (brian d foy)
How do I change group (GID) in perl <mirror@scruznet.com>
Re: I have an error with my script (Billy Chambless)
Re: Let Perl load a HTML page <ptimmins@netserv.unmc.edu>
Re: logic question . . . (Andrew M. Langmead)
Re: Many CGI/PERL forms don't work with Lynx? lvirden@cas.org
Re: newbie: convert string to number (Billy Chambless)
Re: ORA-01002 "fetch out of sequence" error with ORAPER (Dean Dashwood)
Re: Perl4 is *not* Y2K (was Re: Y2K) <merlyn@stonehenge.com>
Re: Problem of Perl in FrontPage <Jari.Vanha-Eskola@helsinki.fi>
Problem with Perl & sfio (Ken Williams)
syntax <kistler@inf.ethz.ch>
Re: syntax (brian d foy)
Typeglob - Temporary Aliases <sriram@weblogic.com>
Re: week-of-the-year calculation <gilles@tls-cats.sps.mot.com>
write question ? <simondr@cig.mot.com>
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 29 Sep 1997 07:51:40 -0700
From: Sriram Srinivasan <sriram@weblogic.com>
Subject: re: Advanced Perl Programming
Message-Id: <342FC07C.C81E9E6B@weblogic.com>
<< Woody Jin wrote:
It is not just that example. I hope that the authors *TRY* the
programs first and ensure that they work correctly, before they
simply put them in the text. I am amazed by the fact that
they fail to do this simple thing.
For example, there is a client perl program which uses IO::Socket.
At first, I trusted the source program and was wondering why it won't
work. After wasting lots of time, I found that it was not PeerHost
as printed in the book, but that it was PeerPort (or PeerAddr).
>>
I'm surprised. The examples have been tested on Solaris and NT. Can you
please point out the page number where the error is supposed to be?
<<
Before you say the above kind of judgement, see the example.tar.gz
which you can get from ora site. Many example are not in there.
This means that they simply didn't type and test it. If they actually
typed in, ran, and tested, there is no reason why the examples are
not in that file. The file is not big either.
>>
While you are right that snippets of code remain practically
untouched by production staff (except for tabs), the fact that
an example is missing from the tar file doesn't mean much.
Every assertion in the book has been tested with at least one
code snippet (including those that don't have anything to do with
code ... when I say Perl is faster than Python for a number of
text processing tasks, I have at least 10 programs to prove that).
Re. the tar file, I've only included those code pieces that I felt
were useful in their entirety.
- Sriram
________________________________________________________________________
Principal Engineer WebLogic, San Francisco www.weblogic.com
"Advanced Perl Programming" : http://www.ora.com/catalog/advperl/
------------------------------
Date: 29 Sep 1997 17:12:15 +0200
From: Thomas Parsli <Thomas.Parsli@nrk.no>
Subject: Re: Anyone ever written to a GIF file from perl
Message-Id: <uiuvk9msw.fsf@nrk.no>
ab6rah@bath.ac.uk (R A Hart) writes:
>
> I was wondering if anybody has any example code to write a GIF file (or
> something that most browsers can read) from say a 2-d array of colourvalues.
>
> It needn't be too complex (i.e. I'll only want to do single images,
> 256-colours, and only the control blocks necessary to get the image onto
> the screen.)
>
GD.
Read the docs.
Thomas
------------------------------
Date: 29 Sep 1997 11:23:56 GMT
From: dlam@aardvark.apana.org.au (David Lam)
Subject: Can I use Perl for this?
Message-Id: <60o34c$3ol$1@llama.teragen.com.au>
Hi there, at work I use a terminal emulator under win95 to run a lot of the
same kind of reports. The keystrokes involved in keying in parameters for
these reports are predictable.
Is Perl able to help buy sending keys
to this terminal emulator (basically an application window not unlike
that of HyperTerminal, say.) Are there functions Perl can call which also
read what text (such as a receipt number, not predictable) is on the
screen at specific positions? Are there functions which it can call to
simulate mouseclicks at specific positions?
If it is possible are you able to give an idea as to what modules should
be included and a rough outline of how to call such functions mentioned?
Thanks heaps. This would literally save me days of manual work.
Or would this particular task be more suited to VB in Excel or something?
David.
------------------------------------------------------------------------------
------------------------------
Date: Mon, 29 Sep 1997 10:35:00 -0400
From: John Strickler <jstrick@mindspring.com>
Subject: Re: Change /etc/passwd
Message-Id: <342FBC94.ED001BD7@mindspring.com>
Juan Carlos del Rio wrote:
> Jeremy D. Zawodny wrote:
> > >> >Is there any perl function or routine that can send the password
> > >> >parameters (user, old password, new password) to the passwd command?
> > >>
> > >> The simplest way to do this from a language perspective is to use expect
> > >> see http://expect.nist.gov.
> > >
> > You're suggesting that one use the HTTPD module to change Unix system
> > passwords? I must have missed something...
>
> Yes that is correct. I am trying to work with expect, as J Gloudon
> suggested. It seems like working in other environments, though I was not
> able yet to make it work on HP-UX 10.20 and running the /etc/passwd
> command. I think it can be useful for an Intranet and for changing a
> password in a system people never access by telnet.
Another approach is not to call the external 'passwd' command and operate it via
expect, but to simply edit the password file with perl. I will assume you are OK with
text file I/O, or see copious included docs for that. The important concept is that
with crypt(), you can create an encrypted password suitable for inclusion in the
password file. I don't have an example in front of me, but I just did this
2 weeks ago on an SCO machine where we needed to automate adding users with
specific, extenally-determined passwords.
The syntax is
$encrypted_password = crypt($plaintext_password,$salt);
[a-zA-Z0-9./]
Salt is any two random characters in the set [a-zA-Z0-9./], and is used to tweak the
algorithm so two users with the same password get a different encrypted version.
I used rand() to get my random characters, you could use time() or somethine different
if you like.
The first two characters of the encrypted password are the salt, BTW.
BIG WARNING:
Different versions of UNIX have different password schemes. Most now use
/etc/shadow or /etc/security/passwd to store the actual encrypted passwords,
not /etc/passwd, so 'man passwd' on your local machine.
HTH
------------------------------
Date: Mon, 29 Sep 1997 08:50:16 -0700
From: Mooneer Salem <mooneer@earthlink.net>
To: Jon Hedley <jhedley@REMOVEmustangpcs.com>
Subject: Re: Die and the Web
Message-Id: <342FCE38.948DFD16@earthlink.net>
Put this at the beginning of any program you made and see if it works:
open(STDERR, "> /tmp/$$.txt");
Right before you execute the sub, put this:
close(STDERR);
Put this in your sub instead of your original code for your sub:
open(ERR, "/tmp/$$.txt");
while(<ERR>) {
print;
}
close(ERR);
unlink("/tmp/$$.txt");
die;
This should help.
Jon Hedley wrote:
>
> Greetings
>
> All of the programming I do in Perl is for output to Web Browsers. I
> cannot access error logs for my server. Therefore, die is of little
> help, and I have been getting around this by making my own sub for
> each program that prints the contents of $! and shuts down the
> program. Is there a way that I can set die to output to STDOUT rather
> than the error log?
>
> Thanks,
> Jon.
>
> ,-,_|\ Jon Hedley - Mustang Computer Services
> / \ Email: jhedley@REMOVEmustangpcs.com
> \_,--\_/ WWW: http://www.mustangpcs.com
> v Ask the Oracle: http://mustangpcs.com/oracle
--
Mooneer Salem
President, Global Kids Club (http://jump.to/globalkids)
No Administration eMail Domains (http://www.arrowweb.com/sumar/namd/)
GKC List Administrator
------------------------------
Date: Mon, 29 Sep 1997 12:57:30 -0400
From: comdog@computerdog.com (brian d foy)
Subject: Re: Die and the Web
Message-Id: <comdog-ya02408000R2909971257300001@news.panix.com>
In article <342faa8a.3392555@news.magna.com.au>, jhedley@REMOVEmustangpcs.com (Jon Hedley) wrote:
>All of the programming I do in Perl is for output to Web Browsers. I
>cannot access error logs for my server. Therefore, die is of little
>help, and I have been getting around this by making my own sub for
>each program that prints the contents of $! and shuts down the
>program. Is there a way that I can set die to output to STDOUT rather
>than the error log?
there is a couple of ways to do this, but not all ways were created
equal (i think your current approach is best :) ). anyway:
1. REDIRECTING STDERR TO STDOUT
demo: <URL:http://computerdog.com/Cgi/demo/dup_stderr.cgi>
you can follow the example in "How do I capture STDERR from an
external command" in the Perl FAQ [1], but it gets a bit tricky
since you have to print things in a certain order for the web
server not to give you an error:
#!/usr/bin/perl
# select(STDERR); $| = 1;
select(STDOUT); $| = 1;
open STDERR, ">&STDOUT";
BEGIN { print STDOUT "Content-type: text/plain\n\n";}
print STDOUT "This is from STDOUT\n";
print STDERR "This is from STDERR\n";
die 'This is from die';
__END__
notice that i set STDOUT to autoflush. if i don't do that (YMMV),
the STDERR handle flushes first and i get a "malformed header from
script", even though i supposedly output the HTTP header in a
BEGIN block.
2. FIDDLING WITH DIE
demo: <URL:http://computerdog.com/Cgi/demo/change_die.cgi>
you can also change what die() does by fidling with $SIG{__DIE__} -
the signal that is sent when die() is invoked. in this case, i
use an anonymous subroutine to print die()'s message to SDTOUT:
#!/usr/bin/perl
# use an anonymous subroutine to replace die()'s default behaviour
$SIG{__DIE__} = sub
{
my $message = shift;
print STDOUT
"The following message is brought to you anonymously:\n";
print STDOUT "$message\n";
};
print STDOUT "Content-type: text/plain\n\n";
print STDOUT "This is from STDOUT\n";
#well, at least my system doesn't have this file :)
open FILE, '/etc/password' or die "This is from die: $!\n";
__END__
3. ROLLING YOUR OWN
i think this is by far the best solution. instead of using die(),
i have my own routine: cgi_error(). this allows me to do various
clean up sorts of things as well as making sure that i get an
intelligent message in the browser if something went wrong. it
doesn't look much different than fiddling with die(), but i've
found it to be more maintainable since other people might not
realize what you did to die().
**********
[1] this question happens to be on
<URL:http://www.perl.com/CPAN-local/doc/manual/html/pod/perlfaq8.html>
--
brian d foy <comdog@computerdog.com>
NY.pm - New York Perl M((o|u)ngers|aniacs)* <URL:http://ny.pm.org/>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
------------------------------
Date: Mon, 29 Sep 1997 09:36:41 -0700
From: Chuck Stein <mirror@scruznet.com>
Subject: How do I change group (GID) in perl
Message-Id: <342FD919.940F462@scruznet.com>
Greetings,
How can I change the group ID (GID) inside a perl
script such that I can delete files of the new group
that are writeable? Assume I am changing to a group
that the calling user is part of (but not their
default group).
Chuck Stein
Mirror Imaging
mirror@scruznet.com
------------------------------
Date: 29 Sep 1997 16:38:53 GMT
From: billy@cast.msstate.edu (Billy Chambless)
Subject: Re: I have an error with my script
Message-Id: <60olit$fku$2@NNTP.MsState.Edu>
In article <01bc2256$4eecb9c0$ec3729cf@main>, "Jason Buckley" <jbuckley@webvermont.com> writes:
|> I think that my perl script is fine, but I may not have it configured
|> correctly. For some reason I keep getting a 500 error from my server? It
|> also gives me the information that I have a "permature end of script? The
|> script is small and I`ll post it at the bottom of this post. The purpose
|> of the script is to ad a persons link to my link page by filling out a
|> form. Here to is
|> $freelocation = "http://www.webvermont.com/linksub.htm";
There's your problem: this should be
$freelocation =
"http://www.perl.org/CPAN/doc/FAQs/cgi/idiots-guide.html";
Hope this helps!
--
slender@juice4u.net CyberMarketing@csi.com slender@JUICE4U.NET
personal@SUPERLINK.NET recruit@lostvegas.com
------------------------------
Date: Mon, 29 Sep 1997 08:55:39 -0500
From: Patrick Timmins <ptimmins@netserv.unmc.edu>
Subject: Re: Let Perl load a HTML page
Message-Id: <342FB35B.404C@netserv.unmc.edu>
b. boertjes wrote:
>
> In the script I would like Perl to load a new page (normal HTMLpage)
> at the end of the script.
> So not how to generate a page by the script, I know that already,
> but I cannot find the command to simple load a .html file after my script
> has done its job.
>
> Bram Boertjes
> The Netherlands
Include the following bit of code at the end of your script:
print "Content-type: text/html","\n\n";
open (FILEDUMP,'/www/root/bram/yourpage.html') ||
die print "Content-type: text/html\n\nPage Does not Exist\n";
while (<FILEDUMP>) {
print;
}
close FILEDUMP;
Make sure that the path in the 'open' statement is the absolute path
to the html file that you want the script to send to your user (not
relative to the server root directory).
Hope this helps,
Patrick Timmins
U. Nebraska Medical Center
------------------------------
Date: Mon, 29 Sep 1997 14:34:59 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: logic question . . .
Message-Id: <EH9xuC.Gyx@world.std.com>
Guy Matz <gmatz@spacelab.net> writes:
>anyone have have a slick perl way to do this:
>if expression = this or that
>then . . .
>without having to say:
>if expression = this or expression = that
>then . . .
Well, you can use grep:
if(grep { $_ == $expression } $this, $that) {
# do something.
}
which might fit the bill depending on your definition of
slick. However, my criteria value "readable" and "efficient" above
"slick", and I dont' think of it as either of those.
You could also make it look "slicker" if you changed the grep for a
foreach loop and wrapped it up in a sub. This may be mildly more
efficient for very large lists since the subroutine can return after
the first true value. For lists of under a few thousand elements, the
efficiency of grep will overcome anyway, unless the comparison is
really complicated.
sub atleastone(&@);
if(atleastone { $_ == $expression } $this,$that) {
}
#atleastone -- compares a list of data against an expression.
# takes a reference to a subroutine ref or code block as the first argument,
# and a list of data. Each element of the list is aliased to the $_ variable
# and then the code reference is evaluated. If the code evaluates to true
# for a certain element, a true value is returned. Otherwise if the entire
# list is used up, and no iteration evaluates to a true value, a false value
# is returned.
sub atleastone(&@) {
my $compare = shift;
foreach(@_) {
return 1 if &$compare;
}
return;
}
In all likelyhood,
if($this == $expression or
$that == $expression) {
}
is the best your going to do.
--
Andrew Langmead
------------------------------
Date: 29 Sep 1997 14:49:34 GMT
From: lvirden@cas.org
Subject: Re: Many CGI/PERL forms don't work with Lynx?
Message-Id: <60of5u$p0m$1@srv38s4u.cas.org>
According to Patrick Kellum <patrick@syix.com>:
:Could Lynx be sending the form data back wrong? I know the copy of Lynx
I suggest you check out http://lynx.browser.org/ and send a request for
help to the lynx development group. They can let you know whether
the problem is an old version of lynx (which perhaps had not yet been
modified to support some common, but broken, practice_, a bug in lynx,
or just an incorrect form.
In my experience, the most common problems I have had with lynx is
incorrectly written forms which happen to work okay with MS IE or Netscape.
--
Larry W. Virden INET: lvirden@cas.org
<URL:http://www.teraform.com/%7Elvirden/> <*> O- "We are all Kosh."
Unless explicitly stated to the contrary, nothing in this posting should
be construed as representing my employer's opinions.
------------------------------
Date: 29 Sep 1997 16:28:17 GMT
From: billy@cast.msstate.edu (Billy Chambless)
Subject: Re: newbie: convert string to number
Message-Id: <60okv1$fku$1@NNTP.MsState.Edu>
In article <342DB261.76DE@cs.berkeley.edu>, Cathy Huang <cathyh@cs.berkeley.edu> writes:
|> I'm using sort @array to sort an array of strings. How would I convert
|> those strings into numbers so the array gets sorted numerically?
Well, they already are numbers. ;)
|> Right now it's sorting them as strings:
|> 5969
|> 679
|> 679
|> 7291
The best answer to this is: read the perlfunc manpage description of
sort().
The faster answer is:
#!/usr/local/bin/perl -w
@foo = ("7291", "5959","679", "671");
foreach(@foo){ print "$_\n"; }
print "\n";
@foo = sort @foo;
foreach(@foo){ print "$_\n"; }
print "\n";
@foo = sort { $a > $b} @foo;
foreach(@foo){ print "$_\n"; }
--
* daniel@HKSTAR.COM and account@HKSTAR.COM both love spam
* nemo@HKNET.COM mok@HKNET.COM rimen@HKSTAR.COM
* mraction@c-corp.net
------------------------------
Date: Mon, 29 Sep 1997 11:36:14 -0600
From: dd@langley.softwright.co.uk (Dean Dashwood)
Subject: Re: ORA-01002 "fetch out of sequence" error with ORAPERL
Message-Id: <875550352.27674@dejanews.com>
Here's a couple of possibilites you might like to consider, although it's
difficult to say for sure without seeing your code:
First of all, I'm a bit worried about your error handling. I know that
you've only given pseudo-code here, and the code itself may be correct,
but the error handling for a fetch should look something like this:
FETCH
Check for errors
While (no errors and data returned)
{
process rows
FETCH
Check for errors
}
This applies to both the inner and the outer loop. If you don't have a
mechanism like this in place, you will quite possibly be getting the
error reported against the wrong statement (i.e. your error is actually
somewhere else.)
Once you've done this, try putting in counter variables for each of the
loops, so that you can actually see numbers for how far it's getting
(rather than saying things like it *seems* to run better at night). My
money says that once you do this you'll find that it dies in exactly the
same place each time, possible on the first time through the inner loop,
the second time through the outer loop. If it's falling over in a
different place each time, there's some very strange stuff going on, and
it may be best to speak to Oracle tech support.
One last thing to consider - I've had problems in the past nesting SQL
commands (including cursors) inside cursors in Pro*C. Although I've
never used ORAPERL, I suspect that there are similar pitfalls there. The
problems come when using structures such as sqlca. I was doing something
like this (very simplified):
loop
{
if (sqlca.sqlcode != 1403)
{
FETCH
do processing
INSERT
}
}
The problem is that by the time the if statement executes during the
second time round the loop, sqlca contains data from the INSERT
statement, not from the FETCH - therefore, it doesn't tell me if there is
more data, which is what I want to know.
The answer is that after every SQL statement, copy anything from sqlca
which you're going to need into a local variable, and then use the
variable from then on. This problem can catch you out in all kinds of
ways, and I've taken to putting sqlca values into local variables almost
all the time now.
Hope that something in here helps.
Dean
--------------
In article <EH90H9.4Eo@drnews.dr.lucent.com>,
haertig@lucent.com () wrote:
>
> Does anyone know what a "fetch out of sequence" (ORA-01002) error
> from Oracle means? The "oerr ora 1002" says it's caused by something
> like trying to fetch from a closed cursor - or something similar. It
> also says something about a PL/SQL "cursor loop" possibly causing
> this error. I don't think we're doing any of these things. Here's
> what we're doing when the error occurs.
>
> This is an ORAPERL application (version 4 of PERL, version 7.1.4 of Oracle,
> NCR hardware, UNIX System V). Here's generally how it works (in pseudo-code):
>
> Login to Oracle
> Open "outer" cursor (has a where clause, but no bind variables)
> Check for Oracle errors opening "outer" cursor
> Open "inner" cursor (has a where clause, uses bind variables)
> Check for Oracle errors opening "inner" cursor
> while (fetch from outer cursor) {
> Do various counting, summarizing, etc
> bind data from the outer fetch to the inner cursor variables
> Check for Oracle errors binding "inner" cursor
> while (fetch from inner cursor) {
> Do more counting, summarizing, etc
> }
> Check for Oracle errors fetching from "inner" cursor
> }
> Check for Oracle errors fetching from "outer" cursor <<<< FAILURE >>>>
> Close inner cursor
> Close outer cursor
> Logoff Oracle
> Print Results
> Exit
>
> We sometimes see "fetch out of sequence" errors (ORA-01002) when we
> check for fetch errors from the "outer" cursor. How far the program gets
> before a "fetch out of sequence" varies - sometimes it dies early,
> sometimes it runs for quite a while before dying, sometimes it runs
> to completion without error. We can't really put a finger on what
> causes the variance - things *seem* to run better at night, when there
> are less users hitting the database. But we can't say this is really
> the case with high certainty. While we fail more often during the day,
> we also fail at nights sometimes too.
>
> The "outer" cursor is working thru a table of about 2 million rows. The
> "inner" cursor is hitting an even larger table - about 12 million rows.
> The where clauses we use on both "inner" and "outer" cursors allow us
> to use indices instead of full table scans. We do have a plan to
> divide up our tables to get them down to manageable size. But for
> now, we're stuck with these large and inefficient tables.
>
> We have tried using open-fetch-close on the "inner" cursor instead
> of the suppossedly more efficient bind-fetch operation. This doesn't
> make much difference, except the program *seems* to get farther before
> a "fetch out of sequence" error occurs. Maybe it only coincidentally
> seems to get farther.
>
> We've also tried making "fetch out of sequence" non-fatal. We continued
> to try fetching after this error. Didn't work. Once you see this
> error, all subsequent fetches exhibit the same error. As expected,
> but we were getting pretty desperate to try this approach.
>
> This is kindof an urgent problem (to say the least!) for our database.
> Any help or pointers would be greatly appreciated!
>
> --
> Dave Haertig
> haertig@lucent.com
> --
> Dave Haertig
> haertig@lucent.com
-------------------==== Posted via Deja News ====-----------------------
http://www.dejanews.com/ Search, Read, Post to Usenet
------------------------------
Date: 29 Sep 1997 07:35:10 -0700
From: Randal Schwartz <merlyn@stonehenge.com>
To: keradwc@mustang.via.net (Kevin Connery)
Subject: Re: Perl4 is *not* Y2K (was Re: Y2K)
Message-Id: <8c7mc06vdt.fsf@gadget.cscaper.com>
>>>>> "Kevin" == Kevin Connery <keradwc@mustang.via.net> writes:
Kevin> In article <8c3emp8swu.fsf_-_@gadget.cscaper.com>,
Kevin> Randal Schwartz <merlyn@stonehenge.com> wrote:
>> Just remember, friends don't let friends use Perl4.
>>
>> Perl4 is dead dead DEAD!
Kevin> Randal, I'm surprised at you!
Kevin> Dead means doesn't work any more, and 4.036 is no less reliable than it
Kevin> was 3 years ago, when it was the latest release.
Dead means that there's a CERT warning out on *all* versions of Perl
prior to 5.004. If you have *any* Perl code that runs on behalf of
others (such as CGI), you *are* vulnerable on all prior releases, and
ready-to-run automated breakin toolkits are already being circulated
amongst the youngsters that would love to hijack your web site.
That's what dead means. *All* versions of Perl prior to 5.004. Two
words: "buffer overflow" -- the break-in expert's dream. It's what
made the Internet Worm possible, and now it's a known problem with
all perl $] < 5.004.
And because it's known and published, would you like to defend
yourself in court when the lawsuit comes along because your website
was taken down, and they said "wasn't this a well-known bug in
Perl..."? I wouldn't.
Just say "require 5.004"!
print "Just another Perl hacker," # but not what the media calls "hacker!" :-)
## legal fund: $20,990.69 collected, $186,159.85 spent; just 337 more days
## before I go to *prison* for 90 days; email fund@stonehenge.com for details
--
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@ora.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me
------------------------------
Date: Mon, 29 Sep 1997 15:59:30 +0200
From: Jari Vanha-Eskola <Jari.Vanha-Eskola@helsinki.fi>
Subject: Re: Problem of Perl in FrontPage
Message-Id: <342FB442.E29ADD4E@helsinki.fi>
Jeremy D. Zawodny wrote:
> Once you have a web server installed (or one on the network which you
> can use), the file associate for .pl -> perl.exe needs to be setup. If
> you're using ActiveState's Perl for Win32, this happened automatically
> when you installed it (assuming you answered yes to that question).
If only it was so simple...
I have Win95 with FrontPage Personal Web Server, and I just can't find *any* way to
associate .pl files to perl.exe so that they'd work over the Web. Instead I have to
use URL's like
http://server/cgi-bin/perl.exe?script.pl
to run them. I've tried everything I know to get the associations to work, but to
no avail. Has anybody managed to get them to work with Win95&FP PWS? Please let me
know, if so!
Jari
------------------------------
Date: Mon, 29 Sep 1997 12:27:59 -0400
From: ken@forum.swarthmore.edu (Ken Williams)
Subject: Problem with Perl & sfio
Message-Id: <ken-2909971227590001@news.swarthmore.edu>
Hi-
I'm having trouble building Perl with sfio. I've run Configure as instructed:
% ./Configure -Duseperlio -Dusesfio
And fed it the paths to my sfio libraries, but the executable that gets
built still says this:
12:22pm% ./perl -V:usesfio
usesfio='false';
What else do I need to do in order to build Perl with sfio? I've tried
editing config.sh manually, changing the usesfio='false' to usesfio='true'
(and then running Configure -S) and recompiling, but that didn't work
either.
The only instructions I've seen on doing this are out of date (I think),
and contain things like
Perl5 can now use alternate file IO mechanisms to ANSI stdio. However these
are experimental and may cause problems with some extension modules. Use
stdio as with previous versions? [y]
You should answer no.
I never got asked this question.
Thanks in advance for your help - I know other people out there are
struggling with this problem too.
-Ken Williams
The Math Forum
ken@forum.swarthmore.edu
------------------------------
Date: Mon, 29 Sep 1997 17:27:18 -0700
From: Per Kistler <kistler@inf.ethz.ch>
Subject: syntax
Message-Id: <34304766.D02FEE34@inf.ethz.ch>
Hi All
Where does the unless go:
$a = 'foo' unless $b;
when I write it like:
$a = <<EOF;
foo
EOF
?
Thanks, Per.
--
Per Kistler, Unix Systems Administrator, kistler@inf.ethz.ch
http://www.cs.inf.ethz.ch/~kistler/
Swiss Federal Institute of Technology, Zuerich, Switzerland
---------------------------------------------------------------------
------------------------------
Date: Mon, 29 Sep 1997 11:50:34 -0400
From: comdog@computerdog.com (brian d foy)
Subject: Re: syntax
Message-Id: <comdog-ya02408000R2909971150340001@news.panix.com>
In article <34304766.D02FEE34@inf.ethz.ch>, Per Kistler <kistler@inf.ethz.ch> wrote:
>Where does the unless go:
>$a = 'foo' unless $b;
>when I write it like:
>$a = <<EOF;
$a = <<'EOF' unless $b;
foo
EOF
gppd luck :)
--
brian d foy <comdog@computerdog.com>
NY.pm - New York Perl M((o|u)ngers|aniacs)* <URL:http://ny.pm.org/>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
------------------------------
Date: Mon, 29 Sep 1997 08:02:48 -0700
From: Sriram Srinivasan <sriram@weblogic.com>
Subject: Typeglob - Temporary Aliases
Message-Id: <342FC318.453FA7C7@weblogic.com>
<<Kevin Bass wrote:
On page 43 of Advanced Perl Programming (O'Reilly & associates, Inc.)
the answer to the problem below is $a = 20 and $b = 10. In solving
this problem, I got the result of $a = 20 and $b = 20. Please explain
why $b = 10.
1 $b = 10;
2 {
3 local *b;
4 *b = *a;
5 $b = 20;
6 }
7 print $a;
8 print $b;
>>
When you say, "I got the result ...", I'm presuming that you didn't
try running the snippet, because it does print "20" and "10"
respectively.
Assuming you want an explanation for why it does that ...
$b starts off with the value 10. When it is localized (line 3),
its old value is saved, and its new value is undef. In line 4,
it is made to share its glob value with that of "a". Now, whatever
changes you make to anything named "a" or "b" will get reflected
on the other. Since in #5, $b is set to 20, $a is also set to 20.
At #6, the scope ends, so b gets its entire old glob value back,
but a continues to retain the glob value (we never said "local *a".
So $a remains with the last value assigned to it (or to its alias, $b),
but $b gets its old value back at the end of the block.
Hope this helps.
- Sriram
________________________________________________________________________
Principal Engineer WebLogic, San Francisco www.weblogic.com
"Advanced Perl Programming" : http://www.ora.com/catalog/advperl/
------------------------------
Date: Mon, 29 Sep 1997 15:56:33 +0200
From: "Fridiric GILLES" <gilles@tls-cats.sps.mot.com>
To: sb@en.muc.de
Subject: Re: week-of-the-year calculation
Message-Id: <342FB390.7A337AEA@tls-cats.sps.mot.com>
Steffen Beyer wrote:
> Week number calculations according to ISO/R 2015-1971 and DIN 1355
> standards
> are included in the module "Date::DateCalc", which is available from
> any
> CPAN ftp site, i.e.:
>
> http://www.perl.com/CPAN/modules/by-module/DateCalc-3.2.tar.gz
>
> or from my web site at
>
> http://www.engelschall.com/u/sb/download/
>
> where you can also find more details about these norms (if you
> understand
> a text in german).
Thank you very much! I'm going to use your module.
But is it Year2000 compliant? Can you provide some tests to prove the
compliance?
And where can I find ISO/R 2015-1971 and DIN 1355 standards?
Regards,
Fred
____
------------------------------
Date: Mon, 29 Sep 1997 11:15:07 -0500
From: Doug Simon <simondr@cig.mot.com>
Subject: write question ?
Message-Id: <342FD40A.41C67EA6@cig.mot.com>
I am trying to capture the output of :
write;
Into a variable.
I have been successful by redirecting STDOUT to a file,
and then reading the file into a variable.
open(STDOUT,">$foo");
write;
However, my problem is that I can not get STDOUT back to normal!!!
I have tried almost everything.
1) How can I get STDOUT back
or
2) Is there an easier way to get the output of write into a variable?
Thanks,
-Doug
---------
Doug Simon
simondr@cig.mot.com
------------------------------
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 1097
**************************************