[6728] in Perl-Users-Digest
Perl-Users Digest, Issue: 353 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Apr 23 11:07:41 1997
Date: Wed, 23 Apr 97 08:00:26 -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, 23 Apr 1997 Volume: 8 Number: 353
Today's topics:
Re: "Dummies" book any good? <tom@eiscat.uit.no>
Re: [Help] converting numbers to formatted strings (Tad McClellan)
Re: [Sys::Syslog] Some problem when I use Sys::Syslog (Mik Firestone)
Re: Any graphic module available? (Clay Irving)
Re: CGI to call java app & exit <migliore+@andrew.cmu.edu>
Re: Get Chars up to first | without splitting (Tad McClellan)
Re: Get Chars up to first | without splitting (David Alan Black)
Re: Get Chars up to first | without splitting (Bob Wilkinson)
Re: Getting it back OUT again! (Andrew M. Langmead)
Re: HELP! Matching a multi line pattern and replacing i (David Alan Black)
Re: HELP! Matching a multi line pattern and replacing i <a.aitken@unl.ac.uk>
Re: help: find pattern, then go down 3 lines (David Alan Black)
Re: HELP? with loop test (Michael Constant)
Re: How the !@#$%^&* does this relate to comp.lang.java rickp@versant.com
Re: How the !@#$%^&* does this relate to comp.lang.java (John Carling)
Re: Kudos to Tom Christiansen and problems with OO (Jay Flaherty)
libwww-perl-5.08 and perl 5.003 socket lib problems? <rudy@hcl.com>
Re: Lisp is neither (was Re: Ousterhout and Tcl lost th <fellowsd.cs@man.ac.uk>
Re: Multiple Page Forms????? (Nathan V. Patwardhan)
Re: multiple STDOUT formats <Chris.King@swindon-fc.demon.co.uk.mars>
Re: Newbie Help - Format an Integer with Comma's <dorman@s3i.com.ANTI-SPAM>
Re: No GUI environment for Perl? (Nathan V. Patwardhan)
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 23 Apr 1997 15:47:55 +0200
From: Tom Grydeland <tom@eiscat.uit.no>
Subject: Re: "Dummies" book any good?
Message-Id: <trvi5d26lw.fsf@eiscat.uit.no>
Terry Michaels <74331.3261@CompuServe.COM> writes:
> I found the first edition of Programming Perl too difficult
> for a beginner in Perl. The David Till first edition of
> Teach Yourself Perl in 21 Days was very good I thought, and its
> explanation of the debugger was excellent. I think a beginner
> should begin using the debugger as soon as possible.
I didn't like TYPI21D, 1/e at all.
(Well, I consider myself a programmer, and a Unix programmer at that,
so for an introductory book for beginning programmers, I'm not the
best reviewer.)
The book was too long-winded, too long and it did everything twice as
difficult as necessary in order to fill every one of the 21 days with
something. I don't have the book in front of me[0], but I remember
(Correct me when my memory plays tricks on me)
* writing things like
if ($list[$i] != 0 || ($list[$i] == 0 && $list[$i-1] == -1 &&
$list[$i+1] == 1))
for determining whether he's reached the end of a list of contiguous
integers.
* Stating that there's no way to distinguish error returns (undefs)
from null strings and consistently saying 'null string' when it's
really an undefined value before grudgingly admitting that "yes,
there's a special undefined value that you can test with the defined
function and return with the undef function" somewhere around day 18.
* Consistently writing syntax diagrams that are misleading at best,
and just plain wrong most of the time. They usually look like
$retval = func(@args);
so it would seem you need an array variable to supply the arguments,
and you need to assign the return value to a scalar variable. Oh, and
you need to put parentheses around the argument array. I don't mind
recommending parentheses around arguments, but writing as if they're
mandatory and saying thinks like "sometimes you can drop the
parentheses around the arguments" is *wrong*.
* Not even mentioning $_ before day 19!
I guess you could learn how to *write* perl, sort of, using this
book. However, the perl taught there is so far from the idiomatic
style you'll see in _PP_ (or _LP_) or any of the modules I've seen
that I think you'll have a hard time *reading* any perl with that book
as your only source.
I won't ramble on about this book. I ment to write a review of it
once, but it has come in a second edition by now, and Tom Christiansen
seems to like it, mostly, so I never bothered. I wouldn't recommend
it to anyone though.
Now for what I think *could* be a good book for a beginner with not
too much programming experience:
_Cross-platform Perl_ by Eric F. Johnson
OK, so it won't dwell too much on "what's a variable" and sequential
execution, but since it's ment for people of different backgrounds
than Unix, it'll explain some of the Unix-related quirks in more
detail than I've seen elsewhere. And the windows parts of it will
certainly be more useful than the windows-related hints in the Camel
book :-)
This book has the great advantage of only 340 pages against the more
than 800 pages of TYPI21D. And the noise level is a lot more
comfortable. I managed to read it through in one afternoon without
getting my blood pressure up.
It even has chapters introducing perl/Tk and CGI.pm.
And it keeps refering the reader to the online documentation for
in-depth information. If all books did that ...
Of course it's not without flaws or typos, but it's a lot better than
many books I've seen.
Tom Christiansen has a favourable review of this book as well. Look
at the http://www.perl.com/perl page(s).
___________________________
[0] It's gone back to the library with my recommendation to expunge it
from the shelves forever
--
//Tom dot Grydeland at phys dot uit dot no
The case of Randal Schwartz - http://www.lightlink.com/fors/
------------------------------
Date: Wed, 23 Apr 1997 07:43:01 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: [Help] converting numbers to formatted strings
Message-Id: <l40lj5.da1.ln@localhost>
Christian Aust (christian.aust@post.rwth-aachen.de) wrote:
: Hi!
: I have to write some Perl code that converts a floating point currency
: into a string that looks like 12.223,30. That means: a comma used
: instead of the decimal dot, a dot to seperate each group of thousands
: and always 2-digit precision.
: Can anyone *PLEASE* help me?
-------------------------------------
#! /usr/bin/perl -w
$_ = 12223.3;
print dotify($_), "\n";
# the Perl FAQ, part 5 has this question:
# How can I output my numbers with commas added?
#
# which gives a "sub commify()" example
# I modified commify() into a "sub dotify()"...
sub dotify {
local ($_, $fraction) = split /\./, shift; # separate on the dot
1 while s/^(-?\d+)(\d{3})/$1.$2/; # I changed comma to dot
# in replacement text
$fraction .= '0' if $fraction < 10; # ensure hundreths are shown
return "$_,$fraction";
}
-------------------------------------
--
Tad McClellan SGML Consulting
Tag And Document Consulting Perl programming
tadmc@flash.net
------------------------------
Date: 23 Apr 1997 12:45:52 GMT
From: mfiresto@vnet.ibm.com (Mik Firestone)
Subject: Re: [Sys::Syslog] Some problem when I use Sys::Syslog
Message-Id: <5jl0a0$hik$1@mail.lexington.ibm.com>
In article <xllenc3qzgi.fsf@rantanplan.dr.gdf.fr>,
DUTKA-MALEN Ivan <dutka@rantanplan.dr.gdf.fr> wrote:
>$ ./my_syslog_example.pl
>Undefined subroutine &Sys::Syslog::hostname called at
>/usr/local/lib/perl5/Sys/Syslog.pm line 92.
>BEGIN failed--compilation aborted at ./my_syslog_example.pl line 2.
>
Comment out line 92 in Syslog.pm. No, really.
Has this question made its way into the FAQ yet?
Mik
-----
Mik Firestone mfiresto@mindspring.com
Evil Overlord Rule #47: I will not grow a goatee. In the old days they
made you look diabolic. Now they just make you look like a disaffected
member of Generation X.
------------------------------
Date: 23 Apr 1997 10:43:00 -0400
From: clay@panix.com (Clay Irving)
Subject: Re: Any graphic module available?
Message-Id: <5jl75k$qrm@panix.com>
In <5jkeov$fmr@news.cis.nctu.edu.tw> gis84514@cis.nctu.edu.tw (fish) writes:
>I use perl to write CGI programs, it will process some data and then
>draw a graph and send back to the browser..
>Is there any module that can handle this?
Sure. Check the Graphic/Image Manipulation section of Perl Reference,
http://www.panix.com/~clay/perl/query.cgi?graphics+index
--
Clay Irving See the happy moron,
clay@panix.com He doesn't give a damn,
http://www.panix.com/~clay I wish I were a moron,
My God! Perhaps I am!
------------------------------
Date: Wed, 23 Apr 1997 09:07:41 -0400
From: Robert J Migliore <migliore+@andrew.cmu.edu>
Subject: Re: CGI to call java app & exit
Message-Id: <EnLUaRe00WB=0AJI00@andrew.cmu.edu>
Excerpts from netnews.comp.lang.perl.misc: 22-Apr-97 Re: CGI to call
java app & .. by Kyzer@sysa.abdn.ac.uk
> Robert J Migliore of migliore+@andrew.cmu.edu wrote in comp.lang.perl.misc:
> : Can someone suggest a way to call `java JavaServer` and return
control to the
> : browser?
>
> `java JavaServer &`; # :o)
..i wish :)
------------------------------
Date: Wed, 23 Apr 1997 06:26:47 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Get Chars up to first | without splitting
Message-Id: <nlrkj5.rn.ln@localhost>
Alastair Aitken (a.aitken@unl.ac.uk) wrote:
: christop@ozinter.co.jp wrote:
:
: > 001|something|something else|and some more
: > Can I extract the characters up to the first occurrence of | ?
: > Currently I'm splitting the whole line into $FirstBit and the rest into
: > $junk1,$junk2 etc but this seems a long way round perhaps ? There could
: > be any number of characters before the |.
: open(IN,"test.dat");
: while ( <IN> ) {
: $FirstBit = substr($_,0,index($_,"|"));
: }
OR
$FirstBit = $1 if /^([^|]+)/; # match everything up to the first |
OR
$FirstBit = (split /\|/)[0]; # just get the first field...
--
Tad McClellan SGML Consulting
Tag And Document Consulting Perl programming
tadmc@flash.net
------------------------------
Date: 23 Apr 1997 13:06:30 GMT
From: dblack@icarus.shu.edu (David Alan Black)
Subject: Re: Get Chars up to first | without splitting
Message-Id: <5jl1gm$fa6@pirate.shu.edu>
Hello -
"christop@ozinter.co.jp" <christop@ozinter.co.jp> writes:
>Hi Hi again..
>We're getting further... this is one that strikes me is probably very
>nicely done with perl but I can't find an example anywhere to learn from
>or pinch.
>I've got a text file that contains this -
>001|something|something else|and some more
>- reading into $line a line at a time and I want to just put the 001 bit
>into $FirstBit.
>Question:
>Can I extract the characters up to the first occurrence of | ?
Fer sher, dude.
($FirstBit) = $line =~ /^([^|]*)/;
Meaning:
anchor to beginning of string
match (and save to $1): zero or more consecutive characters-other-than-|
David Black
dblack@icarus.shu.edu
------------------------------
Date: Wed, 23 Apr 1997 15:19:32 +0100
From: b.wilkinson@NOSPAM.pindar.co.uk (Bob Wilkinson)
Subject: Re: Get Chars up to first | without splitting
Message-Id: <b.wilkinson-2304971519320001@ip57-york.pindar.co.uk>
In article <335DD1B8.26E2@unl.ac.uk>, a.aitken@unl.ac.uk wrote:
> christop@ozinter.co.jp wrote:
>
> > 001|something|something else|and some more
> > Can I extract the characters up to the first occurrence of | ?
> > Currently I'm splitting the whole line into $FirstBit and the rest into
> > $junk1,$junk2 etc but this seems a long way round perhaps ? There could
> > be any number of characters before the |.
>
> open(IN,"test.dat");
> while ( <IN> ) {
> $FirstBit = substr($_,0,index($_,"|"));
> }
>
> Alastair.
or
#!/usr/bin/perl -w
use strict;
while (<DATA>) {
if (/\|/) {
my ($first_bit) = /^([^|]*)/;
print STDERR "First Bit is $first_bit\n";
} else {
print STDERR "No match $_";
}
}
__END__
Text1|text2|text3
no pipes here
||null
1s||fdgs
-----------
Bob
--
I have become death, destroyer of the worlds.
------------------------------
Date: Wed, 23 Apr 1997 14:35:15 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: Getting it back OUT again!
Message-Id: <E93Hur.D1w@world.std.com>
ted@faroc.com.au (R.O. (Ted) Russ) writes:
>I made what I THINK is a HoH by doing this:
>dbmopen (%hoh, "/filename");
>for $name (@listofnames)
>{
> $hoh{$name, "Value1"} = "first";
> .....
> $hoh{$name, "Value10} = "tenth";
>}
>dbmclose (%hoh);
The $hash{key1,key2} is older perl's "multidimentional array
emulation" feature. (Similar to the way awk handles multidimentional
arrays.) And it is key1, concatinated to an intentionally odd
character and key2. If you knew all of the possible values of key1 and
key2, you could iterate through them.
for $name (@listofnames) {
for $key2 (1..10) {
print "$hash{$key1,"Value$key2"}\n";
}
}
Now, in perl 5, there are true multimentional arrays.
for $key1 (keys %hash) {
for $key2 (keys %{$hash{$key}}) {
print "$hash{$key1}{$key2}\n";
}
}
But unfortunately, you can't store a multidimentional data structure
in a dbm file. Which is why the FAQ has this entry:
> How can I store a multidimensional array in a DBM file?
>
> Either stringify the structure yourself (no fun), or else
> get the MLDBM (which uses Data::Dumper) module from CPAN and
> layer it on top of either DB_File or GDBM_File.
but actually, stringifying and unstringifying may not be too bad for
your instance, since the second dimension is fixed and you are storing
all the values at the same time.
for $name (@listofnames) {
$hash{$name} = join "\0", "first", @someothervalues, "tenth";
}
and later:
for $name (keys %hash) {
@values = split /\0/, $hash{$name};
}
--
Andrew Langmead
------------------------------
Date: 23 Apr 1997 13:30:09 GMT
From: dblack@icarus.shu.edu (David Alan Black)
Subject: Re: HELP! Matching a multi line pattern and replacing it
Message-Id: <5jl2t1$ho8@pirate.shu.edu>
Alastair Aitken <a.aitken@unl.ac.uk> writes:
>David Millier wrote:
>>
>> I need to match somthing that looks like this:
>> New files in F:\ozzy_data\buckeye
>>
>> 04/03/97 05:35p 59,525 Backup of index.wbk
>> 04/04/97 01:42p 59,591 index.htm
>> 03/26/97 11:26a 2,179 Whats_New.txt
>>
>> New files in F:\ozzy_data\buckeye\OEM_DOCUMENTS
>>
>>
>> New files in F:\ozzy_data\buckeye\OEM_DOCUMENTS\CUSTOMER_NOTIFICATION
>>
>> Need to remove the "New files in ........." followed by two blank lines.
>> This takes out the listings of new files in directorys that have none. I am
>> simply having trouble matching a multi-line string(cant use foreach)
>> recursivly. Thanks in advance for any help. PS. Reply here, i have no email
>> currently.
>#! /usr/local/bin/perl -w
>require 5.003;
>use strict;
>my ($/);
Didn't your code fail with: Can't use global $/ in "my"
when you tested it?
>$/ = "New files in ";
>open (IN, "new_files.txt");
>open (OUT, "> new_files.out");
>while ( <IN> ) {
> if (!/\n\n/) {
> print OUT; # this already has blank lines to separate directories
> }
>}
>close (IN);
>close (OUT);
>exit 0;
OK, now:
candle:~/hacking/perl$ cat new_files.out
New files in candle:~/hacking/perl$
Did you get different results when you ran your code, using David's sample
input?
David Black
dblack@icarus.shu.edu
------------------------------
Date: Wed, 23 Apr 1997 15:41:56 +0100
From: Alastair Aitken <a.aitken@unl.ac.uk>
Subject: Re: HELP! Matching a multi line pattern and replacing it
Message-Id: <335E1FB4.6E5D@unl.ac.uk>
David Alan Black wrote:
>
> Alastair Aitken <a.aitken@unl.ac.uk> writes:
> Didn't your code fail with: Can't use global $/ in "my"
> when you tested it?
I don't always test my posts - I should have done this one.
> >while ( <IN> ) {
> > if (!/\n\n/) {
> > print OUT; # this already has blank lines to separate directories
> > }
> >}
As David points out - that is nonsense, apologies to David Millier.
while ( <IN> ) {
$_ =~ s!$/!!g;
print OUT $_ if (/\d\d:\d\d[ap]/); # searches for a time stamp on
the create files
}
This is tested and does work.
Thanks to David Black for pointing this out.
ALastair.
------------------------------
Date: 23 Apr 1997 13:01:31 GMT
From: dblack@icarus.shu.edu (David Alan Black)
Subject: Re: help: find pattern, then go down 3 lines
Message-Id: <5jl17b$et4@pirate.shu.edu>
Hello -
Alastair Aitken <a.aitken@unl.ac.uk> writes:
>David Alan Black wrote:
>>
>> Hello -
>>
>> Alastair Aitken <a.aitken@unl.ac.uk> writes:
>>
>> >Set up a count when you find the pattern and just count through the
>> >three lines:
>>
>> >$count = 0;
>> >$test = 0;
>> >while ( <> ) {
>> > $count++;
>> > if ($test == ($count + 3)) {
>>
>> I think you mean: if ($count == ($test + 3)) {...}
>I thought i also wrote:
> if ($test == ($count + 3)) {
> &do_this;
> }
> if (/$pattern/) {
> $test = count + 3;
> }
You didn't. That second "+ 3" is new.
>That way test is valued as the end point of the search as soon as the
>start point is reached. $count++
>then reaches $test three lines later. If $test is set to $count at the
>start then your method works.
None of this is actually my method (see other posting). As I said before,
even if "fixed", it reports a false match if the pattern is not matched
in the first three lines.
>I can't really remember exactly what I did now but I think that's
>slightly clearer.
Well, but it doesn't work. Have you tried it on sample data? Do you have
some tested code and output?
Why, I happen to have some right here :-) This is your code,
with a diagnostic print statement added.
#!/usr/local/bin/perl -w
my $pattern = "PAT";
my $count = 0;
my $test = 0;
while ( <DATA> ) {
$count++;
print "\$test: $test\t\$count: $count\n";
if ($test == ($count + 3)) {
&process_line;
}
if (/$pattern/) {
$test = $count + 3;
}
}
sub process_line { print "Processing: $_" }
__DATA__
This line does not contain it.
This line PAT does contain it.
which means
that
THIS line should get processed
(because it's three lines later)
Output:
$test: 0 $count: 1
$test: 0 $count: 2
$test: 5 $count: 3
$test: 5 $count: 4
$test: 5 $count: 5
$test: 5 $count: 6
Note that, with or without "+ 3", the first if will always fail.
Here, unlike your first version, there is actually a chance that
$test will == $count+3. But not for long, because as soon as
the loop is reentered, $count++....
David Black
dblack@icarus.shu.edu
------------------------------
Date: 23 Apr 1997 06:22:28 -0700
From: mconst@soda.CSUA.Berkeley.EDU (Michael Constant)
Subject: Re: HELP? with loop test
Message-Id: <5jl2ek$s88@soda.CSUA.Berkeley.EDU>
Nick Weavers <weav@apollo.havant.ibm.com> wrote:
>Is there someway I can treat ($name, $value) as a scalar
>so that it reflects the number of elements in the list ?
>
>while ((($name,$value) = nextitem($parm_str)) > 0)
It's easier than that -- in scalar context, a list assignment returns
the length of the right-hand list. So if you arrange for nextitem to
return an empty list when it's done, you can do this:
while (($name, $value) = nextitem($parm_str))
See perldata(1) for more information.
Note that having nextitem return an empty list is not the same as having
it return (undef, undef) -- the latter is a list of two elements, and so
the = operator would still return 2 when you want it to return 0.
--
Michael Constant (mconst@soda.csua.berkeley.edu)
------------------------------
Date: Wed, 23 Apr 1997 12:50:05 GMT
From: rickp@versant.com
Subject: Re: How the !@#$%^&* does this relate to comp.lang.java.advocacy was Who will win? Borland or Microsoft or Programmers?
Message-Id: <335e04b9.814626@news.earthlink.net>
On Tue, 22 Apr 1997 06:47:18 -0600, Tom Crosman <wcrosman@tecoinc.com>
wrote:
>M A wrote:
>>
>> Hi,
>> My company is planning to start a project. We have a big question
>> about our investments. We don't know if we should use Microsoft
>> compiler or Borland. Some myth we heard over the net.
>>
>> 1) 90% of the programmer uses Microsoft Compiler.
>> 2) Borland will vanish in 2 years (NASDAQ:BORL)
>> 3) Borland has better compiler
>> 4) 99% of the College in US have/use Borland Compiler.
>>
>> Some one show us the way?
>>
>> I myself use Borland Compiler and haven't thought about Microsoft yet!
>How about not cross posting to groups that are not related.
I second the motion. I have seen postings for Sybase, Oracle and
other relational databases that were spammed into
comp.databases.object. Look at the newsgroups list here. I see only
one C++ group.
Rick Price
------------------------------
Date: Wed, 23 Apr 1997 08:45:47 GMT
From: jcarling@mindspring.com (John Carling)
Subject: Re: How the !@#$%^&* does this relate to comp.lang.java.advocacy was Who will win? Borland or Microsoft or Programmers?
Message-Id: <335fcc2e.4469186@news.jax.mindspring.com>
rickp@versant.com wrote:
>On Tue, 22 Apr 1997 06:47:18 -0600, Tom Crosman <wcrosman@tecoinc.com>
>wrote:
>
>>M A wrote:
>>>
>>> Hi,
>>> My company is planning to start a project. We have a big question
>>> about our investments. We don't know if we should use Microsoft
>>> compiler or Borland. Some myth we heard over the net.
>>>
>>> 1) 90% of the programmer uses Microsoft Compiler.
>>> 2) Borland will vanish in 2 years (NASDAQ:BORL)
>>> 3) Borland has better compiler
>>> 4) 99% of the College in US have/use Borland Compiler.
>>>
>>> Some one show us the way?
>>>
>>> I myself use Borland Compiler and haven't thought about Microsoft yet!
>>How about not cross posting to groups that are not related.
>
>I second the motion. I have seen postings for Sybase, Oracle and
>other relational databases that were spammed into
>comp.databases.object. Look at the newsgroups list here. I see only
>one C++ group.
>
>Rick Price
>
>
I AGREE.
------------------------------
Date: 23 Apr 1997 13:11:35 GMT
From: fty@hickory.engr.utk.edu (Jay Flaherty)
Subject: Re: Kudos to Tom Christiansen and problems with OO
Message-Id: <5jl1q7$k7p$1@gaia.ns.utk.edu>
Alessandro Forghieri (alf@orion.it) wrote:
: And about giving (and taking) free time: isn' that just about the point
: of usenet?
Yes, that is the point of usenet. But, the original poster said it was
an "obligation" of the usenet community to give thier free time when its
not. When you post a question you should not expect an "obligated" reply.
You should always be pleasently surprised and grateful.
Jay
--
**********************************************
Jay Flaherty fty@hickory.engr.utk.edu
------visualize whirled peas------
**********************************************
------------------------------
Date: Wed, 23 Apr 1997 08:09:38 -0400
From: "Rudy Amid" <rudy@hcl.com>
Subject: libwww-perl-5.08 and perl 5.003 socket lib problems?
Message-Id: <5jkua4$ink$2@news.hcl.com>
I'm attempting to install PopPass 1.5 and as I read the documentation, it
advised me to first install libwww and CGI.pm from the CPAN site. As I
proceeded to install the two packages, I ran across this problem on making
libwww:
Checking for IO::Socket. failed
Can't locate IO/Socket.pm in @INC at Makefile.PL line 30.
The CGI.pm package installed without a glitch.
So I thought perhaps I should download both the IO module (1.15) and Socket
module (1.5) off the CPAN site, installed both (I think). The same error
still occurs. I'm sure I'm missing something, can anyone suggest how I
should proceed? I have the whole mess in BSD/OS 2.1 running Perl 5.003
downloaded from CPAN.
Thanks in advance,
--
Rudy Amid (rudy@hcl.com), Systems "I'm IT!" Administrator NB: IMHO!
>/` Hummingbird Communications, Ltd. 1 Sparks Ave. Toronto, Ont.
" Canada. M2H 2W1. 416-496-2200 Fax 496-2207 [URL] http://www.hcl.com
PGP key fingerprint is on my home page at http://www.warped.com/~radix
------------------------------
Date: 23 Apr 1997 13:57:30 GMT
From: Donal K. Fellows <fellowsd.cs@man.ac.uk>
Subject: Re: Lisp is neither (was Re: Ousterhout and Tcl lost the plot)
Message-Id: <5jl4ga$cr7@m1.cs.man.ac.uk>
In article <3070479482046228@naggum.no>, Erik Naggum <erik@naggum.no> wrote:
> * John Ousterhout
>> The reason for this is the difference in typing, as I explained in the
>> white paper. A given language embodies a particular style of typing,
>> which can range from very strongly typed to totally untyped.
>
> I get the impression that John Ousterhout does not understand what "dynamic
> typing" means. "untyped" is recurring in his articles and his paper.
> apparently, the concept that an object has type information, not the
> variable that holds it, is hard to grasp for many programmers in the C
> tradition. yet, unions with type tags are common. now, of course, a C
> programmer would shudder at the very idea of using a union with a type tag,
> so let's just say that this is well optimized in Lisp implementations,
> often with support from the hardware. (yes, CPU's _do_ have instructions
> that C compilers don't use.)
I take it you don't work in computer hardware design, and haven't even
looked at the field for at least 10 or 15 years, since that last
statement is plain wrong. Maybe Vaxes had a "Reverse Bit Shift, Cast
to Type and Catch Fire if the Programmer is Stupid" instruction (with
mnemonic RBSCTCFPS :^) but technology is substantially advanced since
then. RISC CPU's have only the instructions that are measured as
being needed in practice, and virtually all new designs are RISC (with
the notable distiction of the ix86 line of processors). In future, try
to check your facts, and especially those that have been contradicted
by people (with good reason) for loads of years...
Donal.
--
Donal K. Fellows http://r8h.cs.man.ac.uk:8000/ (SAY NO TO COMMERCIAL SPAMS!)
(work) fellowsd@cs.man.ac.uk Dept. Comp. Sci, Univ. Manchester, U.K.
| donal@ugglan.demon.co.uk 6,Randall Place, Heaton, Bradford, U.K. (home)
+-> ++44-161-275-6137 Send correspondence to my office ++44-1274-401017 <-+
------------------------------
Date: 23 Apr 1997 14:03:54 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: Multiple Page Forms?????
Message-Id: <5jl4sa$bp9@fridge-nf0.shore.net>
jp (jp@here.com) wrote:
: You know what mistake you made. If he thought he could do it another
: way he would not ask about perl, unless he needed to know about perl.
Aw, c'mon now. Most CGI questions don't belong here; if you'd been
reading the tone of the group for the last x months/year(s), you'd
recognize that the majority of the people in this newsgroup won't /
don't answer CGI-related questions.
: You were just unfriendly. The spirit of the Internet is to help.
Are you saying that this is the internet, tex?
: And now you want to embarress me in public ? no fool you ?
There'd be no embarassment (or inflammation of tempers) if you just
kept quiet and let things pass; I don't see any reason why you got
upset in the first place.
: If you don't like it, do something to change the name to
: comp.modules.perl (if you know what that means)
There's already a comp.lang.perl.modules.
--
Nathan V. Patwardhan
nvp@shore.net
------------------------------
Date: Wed, 23 Apr 1997 13:29:12 +0100
From: Chris King <Chris.King@swindon-fc.demon.co.uk.mars>
Subject: Re: multiple STDOUT formats
Message-Id: <P99tnSAYCgXzEwPQ@swindon-fc.demon.co.uk>
In article <335D556A.41C6@Camelot.acf-lab.alaska.edu>, "Richard S. Guse"
<fxrsg@Camelot.acf-lab.alaska.edu> writes
>How do I juggle multiple stdout formats? If there are more than 1, they
>seem to eclipse each other. Also, how do I envoke them? THANKS, ->R
Define the first one you're going to do as normal, eg
format STDIN=
@> @<<<<< @<<<
$a,$b,$c
.
Call it as normal, ie
($a,$b,$c)=("Hi","Mum",":-)");
write;
When you want another format, you have to use eval:
eval "format STDIN=
@>>>>> @<< @>>> @<<<<<<
\$d,\$e,\$f,\$g
.
";
Then call that as normal:
($d,$e,$f,$g)=("Norman","Has","No","Friends");
write;
If you want to go back to the first one again, you have to redefine it
using eval, like the 2nd one.
HTH,
Chris.
--
Chris King
The similarity of any fact mentioned within this post and
any in reality, living or dead, is purely coincidental.
Remove 'mars' from address when replying. I hate spam.
I like corned beef though.
------------------------------
Date: 23 Apr 1997 09:41:25 -0400
From: Clark Dorman <dorman@s3i.com.ANTI-SPAM>
Subject: Re: Newbie Help - Format an Integer with Comma's
Message-Id: <drag1ambe.fsf@s3i.com>
Deepak Thadani <deepak@pcsltd.com> writes:
> I'm sorry to ask such a question, but I can't really
> figure this out. Is there some kind of format command in perl
> which places commas in between numbers for me? Say I had a
> variable $VALUE with a value of 1024000. Is there a function
> or something I could use to get $VALSTR to be "1,024,000" ?
> Something more ledgible, something with commas. How?
One of the things I liked about the first edition of "Programming Perl" was
the "Common Tasks with Perl" section. Personally, I learn a language best
when I have understandable code examples to work with. In the section, on
p. 237, is "Putting Commas into Integers". The thing you want is the sub
commas. I format the output `cuz I was playing with that at the time too.
sub commas {
local( $_) = @_;
1 while s/(.*\d)(\d\d\d)/$1,$2/;
$_;
}
for ($i=1; $i<= 1e15; $i *= 7) {
$result = &commas( $i );
printf " %30s \n", $result;
}
--
Clark Dorman "Evolution is cleverer than you are."
http://cns-web.bu.edu/pub/dorman/D.html -Francis Crick
------------------------------
Date: 23 Apr 1997 13:52:43 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: No GUI environment for Perl?
Message-Id: <5jl47b$bp9@fridge-nf0.shore.net>
Alessandro Forghieri (alf@orion.it) wrote:
: Lots of people write what amount to 'Hello world' prgs in a graphic IDE
: just because ithat makes things easier. Which sounds like a pretty good
: reason to me ..
Aww, graphical-shmaphical. Resourceful programmers use the tools they
have at hand; those who don't like the existing tools will find a way to
design those which suit them.
--
Nathan V. Patwardhan
nvp@shore.net
------------------------------
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 353
*************************************