[6777] in Perl-Users-Digest
Perl-Users Digest, Issue: 402 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Apr 30 22:07:44 1997
Date: Wed, 30 Apr 97 19:00:25 -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 Wed, 30 Apr 1997 Volume: 8 Number: 402
Today's topics:
Re: Built in Perl func to expand env vars??? (Tad McClellan)
Re: Can i use Perl/Tk for my projekt ? <gordon.leslie.mcdorman@sap-ag.de>
Re: Deleting Files (Chipmunk)
Re: Die problem (Tad McClellan)
Re: File Copy (Chipmunk)
Re: file copy (Chipmunk)
Re: Genetic programming (revisited) <fawcett.SPAMFREE@nynexst.com>
Re: HELP: system call (Jeff Stampes)
Re: Input pipes and STDERR (Tad McClellan)
Line search through text file not functioning correctly (Kevin Posen)
Re: Line search through text file not functioning corre (Scott)
Re: Multi line matching problem. Should be simple?!? (Chipmunk)
Re: need help with simple perl CGI form (brian d foy)
Novice to Perl and CGI <zonycat@flash.net>
Re: Object IDs are good ( was: Object IDs are bad ) (Andrew Bromage)
Re: Object IDs are good ( was: Object IDs are bad ) (Henry Baker)
Re: Perl 5 under IRIX 6.2 <scotth@sgi.com>
Re: Perl auto-replier (Tad McClellan)
Re: Perl on Win95? (Stephen Frost)
Re: Portland open-enrollment "Intro to Perl" class jun (Tad McClellan)
Re: pre-RFD: comp.lang.perl.{data-structure,inter-proce (Chipmunk)
Re: pre-RFD: comp.lang.perl.{data-structure,inter-proce (Stephen Frost)
Re: program for perl? <gordon.leslie.mcdorman@sap-ag.de>
Re: question: how to trim a string passed via hard refe (Jeff Stampes)
Re:HELP: system call (Timothy Hall)
Re: References in foreach loop variable (David Alan Black)
Re: shtml extension from perl? <gordon.leslie.mcdorman@sap-ag.de>
Re: split returns erroneous value on a line beginning w (Jeff Stampes)
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 30 Apr 1997 18:02:00 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Built in Perl func to expand env vars???
Message-Id: <81j8k5.5n3.ln@localhost>
Eric Kischell (keesh@cs.cmu.edu) wrote:
: Hello,
Hi.
: I am currently learning Perl from the Camel book.
: Is there any built-in Perl functionality(non system calls) to expand
: environmental variables?
Yes. Didn't you find any when you word searched in the free documentation
that is included with the perl distribution before you posted?
You are expected to do that BEFORE posting you know...
: ex parsed from file.)
: CT header file: $(PATIENT_DIR)/ct/hdr.I20886_3.001
: $(PATIENT_DIR) would be expanded to what it is set to in the user's
: current environment.
Sixty seconds spent word searching for 'environment' in the perlfunc
man page finds all this:
-----
...
calls in the program. The following prints out your environment like
the printenv(1) program, only in a different order:
while (($key,$value) = each %ENV) {
print "$key=$value\n";
}
-----
...
the associative array has not been modified). Here is yet another way
to print your environment:
@keys = keys %ENV;
@values = values %ENV;
while ($#keys >= 0) {
print pop(@keys), '=', pop(@values), "\n";
}
or how about sorted by key:
foreach $key (sort(keys %ENV)) {
print $key, '=', $ENV{$key}, "\n";
}
-----
So, then you would do:
print "$ENV{PATIENT_DIR}\n";
: thx in adv
Uh huh.
--
Tad McClellan SGML Consulting
Tag And Document Consulting Perl programming
tadmc@flash.net
------------------------------
Date: Thu, 1 May 1997 01:04:11 GMT
From: Gordon McDorman <gordon.leslie.mcdorman@sap-ag.de>
Subject: Re: Can i use Perl/Tk for my projekt ?
Message-Id: <ulo60ypdg.fsf@sap-ag.de>
Michael Schmidt <mschmidt@hs-bremen.de> writes:
> 1. Can i use Perl5 under Windows95 and/or Win Nt and/or Win311 with
> all functions of Tk ?
Perl: yes, yes, yes (sort of).
Tk: no, no, no.
> 2. What module support the plot-functions and mouse-controll, like
> drag-and-drop, under Tk ?
> For example, i want to draw a line on screen and after then i
> want to move this line with the mouse.
> 3. It is generally efficent to use Perl5 for this projekt ?
See <URL:http://w4.lns.cornell.edu/~pvhp/ptk/ptkTOC.html>
--
--------------------------------------------------------------
The opinions expressed above are mine, not my employer's.
gordon.leslie.mcdorman@sap-ag.de
------------------------------
Date: 30 Apr 1997 22:35:27 GMT
From: Ronald.J.Kimball@dartmouth.edu (Chipmunk)
Subject: Re: Deleting Files
Message-Id: <5k8hff$18e$4@dartvax.dartmouth.edu>
In article <33655B4C.23D8@consotech.se>
Cristo <cristo@consotech.se> writes:
> A quick question. How do I delete a file in Perl?
Heh heh...
One of my coworkers last year didn't have much experience with Perl,
but he did have the Camel book (1st ed). He needed some code that
would allow him to iterate over all the files in his directory, and
perform some operation on them.
He found in the book a bit of code which did what he wanted to do.
However, the last statement in the iteration was unlink. He wasn't
sure what unlink did, but he figured he'd leave it in there.
When he ran the script, it deleted all the files in his directory, and
recursed on all the subdirectories. He wiped out everything.
Moral: This is a funny story.
Chipmunk
------------------------------
Date: Wed, 30 Apr 1997 17:41:53 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Die problem
Message-Id: <hrh8k5.nk3.ln@localhost>
Bill Blohm (bblohm@boi.hp.com) wrote:
: Bill Blohm (bblohm@boi.hp.com) wrote:
: : Thanks one and all, for all the help and pointers. My problem is
: : not only solved, I also understand what was going on much better.
: I meant to add in, in case anyone else could use this help, that
: the suggested line
: BEGIN {die "Usage: cradd <flename>\n" if @argv < 1;}
: did not give me the clean exit I'd hoped for. However, once I
: fully understood what was happening, I knew where I needed to
: work. The line above would put out the following:
: Usage: ./cradd <filename>
: BEGIN failed--compilation aborted at ./cradd line 28.
: which isn't exactly reassuring to the user. So, knowing where
: to work, and swiping the "unless" suggestion (as being more
: elegant than < 1), I wound up with the following:
: BEGIN { print "Usage: $0 <filename>\n\n" and exit 0 unless @ARGV; }
Let me offer yet one more refinement (a programmer's work is never done ;-)
If they have redirected the stdout for the command, then they won't
see the error message unless they examine the contents of the
redirected file.
I suggest printing the usage message to STDERR:
BEGIN { print STDERR "Usage: $0 <filename>\n\n" and exit 0 unless @ARGV; }
^^^^^^
: which provides only this output when a file name isn't provided:
: Usage: ./cradd <filename>
: which is what was wanted. Thanks to one and all for all the help
: and pointing me on the way.
Good of you for summarizing back to the newsgroup.
Thank you.
--
Tad McClellan SGML Consulting
Tag And Document Consulting Perl programming
tadmc@flash.net
------------------------------
Date: 30 Apr 1997 22:24:51 GMT
From: Ronald.J.Kimball@dartmouth.edu (Chipmunk)
Subject: Re: File Copy
Message-Id: <5k8grj$18e$2@dartvax.dartmouth.edu>
In article <4q63k5.p11.ln@localhost>
tadmc@flash.net (Tad McClellan) writes:
> Becky Schonfeld (rebecc60@pobox.upenn.edu) wrote:
>
> : Can anyone send me or recommend a very simple script to copy file1 to
> : file2 except for one line from file1? Any help is much appreciated.
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>
> Which line to you want to leave out?
>
> The first one?
>
> The last one?
>
> One from the middle?
>
> One that contains a certain string?
>
> The shortest one?
>
> The longest one?
How about a random one?
Chipmunk
------------------------------
Date: 30 Apr 1997 22:26:39 GMT
From: Ronald.J.Kimball@dartmouth.edu (Chipmunk)
Subject: Re: file copy
Message-Id: <5k8guv$18e$3@dartvax.dartmouth.edu>
In article <5k3dci$94d$1@neocad.com>
stampes@xilinx.com (Jeff Stampes) writes:
> Becky Schonfeld (rebecc60@pobox.upenn.edu) wrote:
> : I have used the following bit of perl to attempt to get file $A to be
> : copied to $B except for one line ($break of file $A). However it seems
> : to not skip line $break. Can anyone help?
>
> : $records=0;
> : open(IN, "$A") || die "cannot open $A for reading";
> : open(OUT, ">$B") || die "cannot create $B";
>
> These should read:
>
> open IN, $A or die "cannot open $A for reading";
>
> || has a higher precedence than a list operator like open, so you
> should always use 'or' instead of '||'
That's what the parentheses are for, silly.
TMTOWTDI!
Chipmunk
------------------------------
Date: 30 Apr 1997 20:20:49 -0400
From: Tom Fawcett <fawcett.SPAMFREE@nynexst.com>
Subject: Re: Genetic programming (revisited)
Message-Id: <8jhggohwke.fsf@nynexst.com>
zbrown@lynx.dac.neu.edu (Zachary Brown) writes:
> Well, I got some replies now. They basically say that perl is too slow
> for genetic programming, and that scheme would be better. That is a big
> disappointment.
If it makes you feel any better, scheme would probably be just as bad.
-Tom
------------------------------
Date: 30 Apr 1997 23:46:29 GMT
From: stampes@xilinx.com (Jeff Stampes)
Subject: Re: HELP: system call
Message-Id: <5k8lkl$fkv$1@neocad.com>
Aurangzeb Agha (aagha@cis.ohio-state.edu) wrote:
: I'm trying to take the output from a system call and put it into a variable.
: 1) $test = system("date");
: 2) print("*** test: $test\n");
: 1 -- executes the system call and sets $test to 0 to show successful execution
: 2 -- prints 0 for successful execution
: How can I make a system call to 'date', and direct the output to $test
: (preferably without output to STDIO)?
Have you read the manpages? The Camel? The FAQ?
Regardless....if you do, you'll find the difference between system
and using backticks.
As you found, $test = system("date") gives you the return value of the
system call. For the output, try:
$test = `date`
and you'll get what you want.
--
Jeff Stampes -- Xilinx, Inc. -- Boulder, CO -- jeff.stampes@xilinx.com
------------------------------
Date: Wed, 30 Apr 1997 17:52:07 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Input pipes and STDERR
Message-Id: <nei8k5.nk3.ln@localhost>
Reid Miller (reidm@shell4.ba.best.com) wrote:
: I am trying to use traceroute in an input pie but run into an interesting
: idiosyncracy of the traceroute command... The first lie of it's output is sent
: to STDERR and not to STDOUT. i.e.
: Instead of getting this output as the first line in my pipe, this gets
: dumped out to the terminal.
: traceroute to irc.netcom.com (206.217.29.1), 30 hops max, 40 byte packets
: I really don't care what happens to the line, I just don't want it coming out
: to the terminal. Is there a way to have both STDERR and STDIN come in the input
^^^^^^
: pipe? SHould this be done with shell redirection or something?
Would this be an accurate rephrasing of your question:
How can I capture STDERR from an external command?
If so, then I guess you missed it in the Perl FAQ part 8, where it
shows several different ways to do that...
: Thanks.
Uh huh.
--
Tad McClellan SGML Consulting
Tag And Document Consulting Perl programming
tadmc@flash.net
------------------------------
Date: Thu, 01 May 1997 00:38:23 GMT
From: posenj@lancet.co.za (Kevin Posen)
Subject: Line search through text file not functioning correctly
Message-Id: <3368e465.18720167@news.saix.net>
Hi.
I'm writing a script to search for a given city name in a data file and
return the time zone.
This is the structure of the datafile:
Catania +1 0
Chandigarh +5:30 0
Charleston (South Carolina) -5 0
Charleston (West Virginia) -5 0
Charlotte -5 0
Dar es Salaam +3 0
This is the search function:
open (FILE, $datafile) || die "Could not open $datafile";
while (<FILE>) {
if ($_ =~ /$city/i) {
$found_city = 1;
last;
}
}
close (FILE);
It works fine for all name (including those with spaces - eg. New York)
except for those containing brackets. For these it says that no match was
found in the data file. However, if I escape the characters ('( = %27)' and
') = %28)') it works perfectly.
Any suggestions?
Thanks,
Kevin Posen
------------------------------
Date: Thu, 1 May 1997 01:02:08 GMT
From: seligman@netcom.com (Scott)
Subject: Re: Line search through text file not functioning correctly
Message-Id: <seligmanE9H9JK.MIn@netcom.com>
In article <3368e465.18720167@news.saix.net>,
Kevin Posen <posenj@lancet.co.za> wrote:
> if ($_ =~ /$city/i) {
>
> It works fine for all name (including those with spaces - eg. New York)
> except for those containing brackets. For these it says that no match was
> found in the data file. However, if I escape the characters ('( = %27)' and
> ') = %28)') it works perfectly.
>
> Any suggestions?
if ($_ =~ /\Q$city/i) {
--
-- Scott Seligman will hack perl for food
-- email: seligman@netcom.com
------------------------------
Date: 30 Apr 1997 23:05:38 GMT
From: Ronald.J.Kimball@dartmouth.edu (Chipmunk)
Subject: Re: Multi line matching problem. Should be simple?!?
Message-Id: <5k8j82$18e$5@dartvax.dartmouth.edu>
In article <33665309.41A550C7@fox.cisti.nrc.ca>
Pascal Houde <houde@fox.cisti.nrc.ca> writes:
> Here's a small example of what I want to do:
>
> $var="some\nthing"
> $var =~ s/something/blablabla/;
> print $var; # which would print blablabla
>
> But this doesn't work even if I specify $*=1 and/or $/ =""
>
> I don't want to do something like:
> $var =~ s/some\nthing/blablabla/; or $var =~ s/so.*ing/blablabla/s;
> because I never know where the word is cut by a new line and
> I want an accurate search. (so forget about the "." trick and /s)
>
> I'm using Perl 5.003
I think you're missing the point of what $* and $/ do. Actually, I
believe they're deprecated in perl5 anyway... /m and /s are used
instead.
They're not intended to make the regexp *ignore* newlines. Instead, /m
(and $*) allows ^ and $ to match newlines in the middle of the string,
and /s (and $/) allows . to match newlines.
I suppose you could do something like this:
$var =~ s/s\n?o\n?m\n?e\n?t\n?h\n?i\n?n\n?g/blablabla/;
s, followed by an optional newline, followed by o, followed by an
optional newline, etc.
Or, you could do this:
$var =~ tr/\n//d;
$var =~ s/something/blablabla/;
if you don't mind losing all your newlines.
Chipmunk
------------------------------
Date: Wed, 30 Apr 1997 20:07:55 -0400
From: comdog@computerdog.com (brian d foy)
Subject: Re: need help with simple perl CGI form
Message-Id: <comdog-3004972007550001@nntp.netcruiser>
In article <862404027.16742@dejanews.com>, yourke@earthlink.net wrote:
> The HTML page displays, but input to it is not captured and processed. Why
> not? This is due for my class on Thursday 5/1, so a quick hint is
> appreciated!
> #!/usr/local/bin/perl
#missing that -w switch too!
use strict;
# such a nice module [1]. comes with examples and everything.
# and don't forget the faqs and guides [2]
use CGI;
$input = new CGI;
my $operand1 = $input->param('operand1');
my $operand2 = $input->param('operand2');
my $op = $input->param('operation');
[snip away some data checking]
> #perform selected operation on operands
> if ($input{'operation'} eq "add")
> {$input=$operand1+$operand2;}
> elsif ($input{'operation'} eq "subtract")
> {$result=$operand1-$operand2;}
> elsif ($input{'operation'} eq "multiply")
> {$result=$operand1*$operand2;}
> elsif ($input{'operation'} eq "divide" && ($operand2 ne 0))
> {$result=$operand1/$operand2;}
# well, if this is for a class, let's at least be impressive :)
# how about:
# you can skip the hash is you rename your form elements to the
# proper characters...
my %operation = ( 'add' => '+',
'subtract' => '-',
'multiply' => '*',
'divide' => '/'
);
my $result = eval("$operand1 $op $operand2"); #handles divide by 0!
[snip snip]
> #This subroutine was adapted from Troy Downing's book
he must like doing a lot of work, and half-assed at that. try
some real code like the CGI module, available at your
favorite CPAN [1].
> sub ParseSTDIN{
[snip]
> }
[1]
CPAN - Comprehensie Perl Archive Network. find one through
<URL:http://www.yahoo.com>
[2]
<URL:http://www.perl.com/perl/faq/perl-cgi-faq.html>
<URL:http://www.perl.com/perl/faq/idiots-guide.html>
<URL:http://www3.pair.com/webthing/docs/cgi/faqs/cgifaq.shtml>
--
brian d foy <URL:http://computerdog.com>
unsolicited commercial email is not appreciated
------------------------------
Date: Wed, 30 Apr 1997 10:50:13 -0700
From: zonycat <zonycat@flash.net>
Subject: Novice to Perl and CGI
Message-Id: <33678655.68DB@flash.net>
I do not want to waste people's time here but could you direct me to
some place that has lots of examples of scripts for use with Win32 Perl.
I am interested in building forms and getting data then building the
results html page.
Also interested in doing searchs then building a results page with html
links.
Thanks
------------------------------
Date: 1 May 1997 10:09:01 +1000
From: bromage@cs.mu.OZ.AU (Andrew Bromage)
Subject: Re: Object IDs are good ( was: Object IDs are bad )
Message-Id: <5k8mut$fj7@mulga.cs.mu.OZ.AU>
G'day all.
In article <5k67a4$nit@mulga.cs.mu.OZ.AU>,
Andrew Bromage <bromage@cs.mu.OZ.AU> wrote:
>>They may need to be distinguished for the purpose of compile-time
>>garbage collection. If you create two immutable identical objects,
>>it may be easier to discover when they become garbage because the
>>references to them are unique, than if they were one object with
>>a shared reference.
>>
>>Admittedly the programmer does not necessarily need to see this.
doylep@ecf.toronto.edu (Patrick Doyle) writes:
> Neither does the GC. It can simply throw away one of the objects
>immediately and use the other, can't it?
Not always.
In some languages (Clean and Mercury spring to mind immediately)
you can mark some objects as being "unique" or "linear" in either the
type system, or the mode system if it's a language which supports
multiple modes of procedures. Such objects are not mutable, but it
is possible for the compiler to know when all references to such an
object are dead and you can generate code to reuse or reclaim the
object, saving the overhead of reclaiming, and potentially the cost
of reallocating, the object.
Cheers,
Andrew Bromage
------------------------------
Date: Thu, 1 May 1997 01:30:23 GMT
From: hbaker@netcom.com (Henry Baker)
Subject: Re: Object IDs are good ( was: Object IDs are bad )
Message-Id: <hbaker-3004971730230001@10.0.2.1>
In article <E9GJ9z.Ety@ecf.toronto.edu>, doylep@ecf.toronto.edu (Patrick
Doyle) wrote:
> >> Can you give an example of two immutable objects, alike in every way,
> >>which need to be distinguished?
>
> Neither does the GC. It can simply throw away one of the objects
> immediately and use the other, can't it?
Indeed. One could do this trivially by means of a 'hash-consing' copying
GC. The idea is that when you 'copy' the node, you hash-cons it in the
new space. Since hash-consing uniquizes the object recursively, any 'like'
objects will find themselves EQ after the GC.
Your mileage will vary on circular immutable objects.
------------------------------
Date: 30 Apr 1997 18:49:36 -0700
From: Scott Henry <scotth@sgi.com>
Subject: Re: Perl 5 under IRIX 6.2
Message-Id: <yd8enbsm05r.fsf@hoshi.engr.sgi.com>
>>>>> "Z" == Zsolt Ferenczy <zsolt@crisis.atlanta.sgi.com> writes:
Z> In article <3367641F.446B@out.trw.com>,
Z> Robert M. Cothren, PhD <robert_cothren@out.trw.com> wrote:
>> I need to get Perl 5 running under IRIX 6.2. However, it seems to have a
>> bunch of configuration problems using the ./Configure script. Can anyone
>> tell me what magic things I need to do to get it to compile so I don't
>> have to rediscover everything myself?
>>
Z> You can get perl off the Freeware 2.0 CD.
Z> U fw_LWperl5.sw.perl [d] 212- Perl5 interpreter and std library
Z> There is also a version on the first IRIX 6.2 CD.
Z> S eoe.sw.gifts_perl [d] 4+ Perl Software
Since the Freeware CDs don't come out often enough, more recent
versions (ie: 5.003) of Freeware Perl5 are available from my Web
page:
http://reality.sgi.com/scotth/info/perl5.html
--
Scott Henry <scotth@sgi.com> / Help! My disclaimer is missing!
IRIX MTS, / GIGO *really* means: Garbage in, Gospel Out
Silicon Graphics, Inc / http://reality.sgi.com/scotth/
------------------------------
Date: Wed, 30 Apr 1997 17:35:29 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Perl auto-replier
Message-Id: <hfh8k5.nk3.ln@localhost>
I R A Aggie (fl_aggie@hotmail.com) wrote:
: In article <5k4tim$k7r$2@dartvax.dartmouth.edu>,
: Ronald.J.Kimball@dartmouth.edu (Chipmunk) wrote:
: + While it would be nice to stop the posting of questions that are best
: + answered by the documentation or in other newsgroups, doing so is an
: + impossible task. On the other hand, the rude responses are posted by a
: + handful of rational, intelligent people. Is it necessary or
: + appropriate for these repliers to discard netiquette in their responses
: + becausethe original poster is clueless or lazy? I'd just like them to
: + consider that.
: You're right.
: Next time I'm inclined to be snide, I'll just drop the post on the
: floor and ignore the question.
^^^^^^^^^^^^^^^^^^^
The recent threads have convinced me to do exactly that.
My active goal is to no longer appear in the statistics posting.
: And that gains us what, exactly? Especially if a question goes unanswered?
: Then the clueless poster may whine about how s/he posted here and didn't
: get an answer and that its the newsgroup (and the inhabitants thereof)
: RESPONSIBILITY to answer questions.
: Its better to be snide, or even rude, if the clueless *LEARN* something.
: Condescendsion is typically resented. Maybe the next time, they'll try
: to avoid it and ACTUALLY USE THE FINE MANUAL and LEARN SOMETHING ON THEIR
: OWN!
I was chided in email this week for being 'school marmish' in one of
my replies (by a third observer, not the original poster).
grepping for two words from the poster's question found over 50 places
in the free documentation that is included with the perl distribution
(aka the man pages).
Asking a question when the very *words in the question* lead to the
answer in a few seconds of word searching, is childish IMO.
So I responded as I would have to any child.
My hope was that the poster would be so embarrassed that he would
never again post without spending 1-2 minutes searching for the
answer first.
Some may have noticed my "Uh huh" response to the "Thanks in advance"
type of statements. If you observe them carefully, you will see that
I only do that when I have underlined words from the question that
lead to the answer.
I am not fooled into thinking that these folks are really thanking
me. They are just greasing the wheel so that I will read the docs
for them. Easy, quick answers are us. I begin to feel they are
making a fool of me.
I gotta stop doing that (reading the docs for them) ...
: + Perhaps when I've been on here for a significant amount of time, I'll
: + turn nasty too. I hope not, but if I do, I'll owe you all an apology.
: You will and you will. When you've answered the same damn question five
: times in one week -- because they don't read the newsgroup, you see,
: and just want an answer, so send it by email, and no, they don't know
: about DejaNews.
I get a ROTFL episode about once a week from someone *posting from
Dejanews* when there are dozens of answers to be found by *searching*
Dejanews...
--
Tad McClellan SGML Consulting
Tag And Document Consulting Perl programming
tadmc@flash.net
------------------------------
Date: 1 May 1997 01:41:08 GMT
From: frostbyt@shell02.ozemail.com.au (Stephen Frost)
Subject: Re: Perl on Win95?
Message-Id: <5k8sbk$r3v@proxy5.proxy.ozemail.net>
Grant Totten (grantt@nortel.ca) wrote:
: So, is it possible to use perl5 on a Windows 95 platform?
Yes: http://www.activeware.com
Cheers
Steve
------------------------------
Date: Wed, 30 Apr 1997 17:54:50 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Portland open-enrollment "Intro to Perl" class jun 9-11
Message-Id: <qji8k5.nk3.ln@localhost>
Randal Schwartz (merlyn@stonehenge.com) wrote:
: I've just been informed by my crack production team that there's still
^^^^^^^^^^^^^^^^^^^^^
I didn't know that there was much of a market for cracks...
(though I am supplying one here ;-)
--
Tad McClellan SGML Consulting
Tag And Document Consulting Perl programming
tadmc@flash.net
------------------------------
Date: 30 Apr 1997 22:17:04 GMT
From: Ronald.J.Kimball@dartmouth.edu (Chipmunk)
Subject: Re: pre-RFD: comp.lang.perl.{data-structure,inter-process, porters,regex}
Message-Id: <5k8gd0$18e$1@dartvax.dartmouth.edu>
In article <1997Apr28.161957.14036@schbbs.mot.com>
appleton@nospam.northbrook.aieg.mot.com (Brad Appleton) writes:
> I like them, but I think there should be a separate group expressly
> for newbie questions. So clueless perl newbies who havent the first
> idea which of the above groups to post to will plainly see where to
> send their hapless questions. Using c.l.p.misc as a catch-all is
> fine but I think this particular group of people will merit its own
> newsgroup (and make the rest of us much happier).
Assuming that clueless newbies will post to the correct newsgroup, no
matter how clearly named, seems foolish.
If there were a newsgroup for such questions, would anyone experienced
actually read it to answer the newbies' questions?
Chipmunk
------------------------------
Date: 1 May 1997 00:58:10 GMT
From: frostbyt@shell02.ozemail.com.au (Stephen Frost)
Subject: Re: pre-RFD: comp.lang.perl.{data-structure,inter-process,porters,regex}
Message-Id: <5k8pr2$r3v@proxy5.proxy.ozemail.net>
So ... create a web-based discussion group. To post to it you need
a userID/password. Change this monthly. Keep a list of people
who are authorised to post ... but let anybody read. For those
that want to post, they can fill out a form detailing their email
address. Those people can be sent a copy of the FAQ first, and a
userID/password to allow posting a day or two later.
If they're not prepared to advise their genuine email address, they
don't get the userID/password which would enable them to post ...
<Ducks and weaves, waiting for inevitable flaming>
I'd rather build a new bunker and sandbag the entrance than try
and throw people out of the old one.
Frosty
------------------------------
Date: Thu, 1 May 1997 00:54:36 GMT
From: Gordon McDorman <gordon.leslie.mcdorman@sap-ag.de>
Subject: Re: program for perl?
Message-Id: <un2qgyptf.fsf@sap-ag.de>
suzanne@intrepid.axess.com (Suzanne L.) writes:
> Is there a program that is needed to write in perl or can they be
> written in any text editor?
Not to be pedantic, but a text editor is a program. And to try to
provide a clear answer:
You need a text editor to write Perl programs.
You next stop should be:
<URL:http://www.perl.com/perl/faq/index.html>
or simply:
<URL:http://www.perl.com/>
--
--------------------------------------------------------------
The opinions expressed above are mine, not my employer's.
gordon.leslie.mcdorman@sap-ag.de
------------------------------
Date: 1 May 1997 00:19:43 GMT
From: stampes@xilinx.com (Jeff Stampes)
Subject: Re: question: how to trim a string passed via hard reference?
Message-Id: <5k8niv$g9b$2@neocad.com>
Terrence M. Brannon (brannon@bufo.usc.edu) wrote:
: sub trim {
: chomp($$_[0]);
: $$_[0] =~ s/^\s+//;
: $$_[0] =~ s/\s+$//;
: }
: trim(\$x)
: does not trim away leading and trailing whitespace. why?
because you aren't properly dereferencing the reference. You're
passing in a reference to a scalar. That reference is then in
@_[0]. This is the value you need to dereference:
sub trim {
chomp(${@_[0]});
${@_[0]} =~ s/^\s+//;
${@_[0]} =~ s/\s+$//;
}
--
Jeff Stampes -- Xilinx, Inc. -- Boulder, CO -- jeff.stampes@xilinx.com
------------------------------
Date: 1 May 1997 00:12:41 GMT
From: thall@lexis-nexis.com (Timothy Hall)
Subject: Re:HELP: system call
Message-Id: <5k8n5p$3hm@mailgate.lexis-nexis.com>
I'm not sure if this is in the FAQ, but it should be,
@REPLY = `DO_SOMETHING 2>&1`;
this redirects the system output back to your variable.
HTH - Happy Perling. -Tim
--Datum Nostra--
Our data, that is encoded,
Binary be thy name,
Thy digits come, zero or one,
On the network as it is on the host site .
Give us this day our Usenet feed
And spam us not, as we don't spam others,
Lead us not into a flame-war,
But deliver us from A-O-L.
For yours is the Network, the Router, and the Proxy,
Now and for Ether.
-E-Mail (err, I mean Amen)
Unsolicited Commercial E-mail is in violation of USC 47-5(II).
(Any such violation *may* be reported to the offender's ISP.)
------------------------------
Date: 1 May 1997 01:12:49 GMT
From: dblack@icarus.shu.edu (David Alan Black)
Subject: Re: References in foreach loop variable
Message-Id: <5k8qmh$oe8@pirate.shu.edu>
Hello -
As I said in my last post, see my yet other post for some more
reflections on this.... But also, here are a couple of
further comments in this thread.
Keith Arner <kraven@keystone.westminster.edu> writes:
>If we pull this out of the foreach:
>$$i = 2;
>Generates the error:
>Can't use an undefined value as a SCALAR reference at - line 1.
This appears to have been changed in 5.004beta or thereabouts:
candle:~/hacking/perl$ perl -w
$$i = 2;
print $$i;
^D
2
(5.003_95)
>> If $i contains neither nothing nor a plain string, but, instead, a
>> hard reference, then Perl checks to see whether it is the right type of
>> reference for the occasion. In the case of your second example, it
>> isn't - it's a scalar reference, where only a glob reference will do.
>Now that's the point that has me baffled. Why does it need to be a
>glob ref rather than a scalar ref? Consider the following two
>programs:
[ ... ]
>My gut seems to be telling me that the problem lies in the fact that
>perl does some sort of glbo assignment on the control variable (to
>allow assignment to the control variable to change the original
>value), but I can't quite put it into words.
Aliasing, I think. (See other post :-)
David Black
dblack@icarus.shu.edu
------------------------------
Date: Thu, 1 May 1997 00:36:31 GMT
From: Gordon McDorman <gordon.leslie.mcdorman@sap-ag.de>
Subject: Re: shtml extension from perl?
Message-Id: <uohawyqnk.fsf@sap-ag.de>
"Neil Sandow, Pharm.D." <rx@rxlist.com> writes:
> Eric Harley wrote:
> >
> > In article <3365A385.4C7@rxlist.com>, "Neil Sandow, Pharm.D."
> > <rx@rxlist.com> wrote:
> >
> > > I'm currently running a perl script on my website that searches
> > > the input (drugname) and outputs the results as an html file
> > > with a url which ends with ?drugname I'd like to modify the script
> > > to have the url end with ?drugname.shtml so I can run a server side
> > > script with the new html file. Is adding this .shtml extension easy to
> > > do? Can somebody point me in the right direction?
> >
> > $cgi_object->redirect($url);
>
> I thought a redirect would send somebody to an already existing
> html page. Here, the perl/cgi creates a new html document on the fly
> and is always different, depending on the input of the user. All I'm
> trying to do is have the name of the resulting url end in .shtml Is
> that what $cgi_object->redirect($url); will do?
> http://www.rxlist.com rx@rxlist.com
Umm... are you sure an HTML "file" is being created here? In a URL, a
"?" typically represents the beginning of parameter input to a CGI
script. Thus the URL in the above case points not to a file, but
indicates what CGI script was run, and with what parameters.
This means that no physical file is actually created on the server,
and therefore a Server Side Include (SSI) is useless.
However (getting back to Perl), I'm not aware of anything an SSI can
do that Perl cannot. Why do you not add whatever functions you require
to the Perl script itself????
--
--------------------------------------------------------------
The opinions expressed above are mine, not my employer's.
gordon.leslie.mcdorman@sap-ag.de
------------------------------
Date: 1 May 1997 00:10:13 GMT
From: stampes@xilinx.com (Jeff Stampes)
Subject: Re: split returns erroneous value on a line beginning with '#'
Message-Id: <5k8n16$g9b$1@neocad.com>
Terrence M. Brannon (brannon@bufo.usc.edu) wrote:
: while (<F>) {
: @els = split(/\s/);
: print $#els+1 . ": $_";
: }
: indicates that the first line of the file opened (listed below) has 1
: column, even though it obviously has 6
Interesting...actually, my test showed it had 47 columns...do
you really want to split is on every space? Maybe:
$bar = "#P 0.000007 0.000037 0.000047 0.000057 0.000067";
@foo = split /\s+/,$foo;
would do what you want?
--
Jeff Stampes -- Xilinx, Inc. -- Boulder, CO -- jeff.stampes@xilinx.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 402
*************************************