[12255] in Perl-Users-Digest
Perl-Users Digest, Issue: 5855 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Jun 1 22:37:23 1999
Date: Tue, 1 Jun 99 18:00:17 -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 Tue, 1 Jun 1999 Volume: 8 Number: 5855
Today's topics:
Re: bareface ratio <jeromeo@atrieva.com>
beginner <eblatham@unity.ncsu.edu>
Re: cont'd (Kai Henningsen)
Re: Downloading files to users browser. <upsetter@ziplink.net>
Re: Downloading files to users browser. <jeromeo@atrieva.com>
Re: FAQ 4.16: Does Perl have a year 2000 problem? Is Pe (David H. Adler)
Re: FAQ 4.68: How do I handle binary data correctly? (Kai Henningsen)
Re: FAQ 4.68: How do I handle binary data correctly? (Kai Henningsen)
Re: FAQ 4.68: How do I handle binary data correctly? <tchrist@mox.perl.com>
Re: formatting number output <cassell@mail.cor.epa.gov>
Re: Perl Unicode/Multibyte Support (Kai Henningsen)
Re: Slow, or looping? (Abigail)
string comparison - exact matching... <pumpkin@nowhere.com>
Re: string comparison - exact matching... (Sam Holden)
test <pumpkin@nowhere.com>
Testing for flock (was Re: $^O and all types?) <jeff@vpervices.com>
Re: Use binmode for binary files (Kai Henningsen)
Re: Use binmode for binary files (Kai Henningsen)
Re: Use binmode for binary files (Kai Henningsen)
Using Perl to call DLL functions <Nicholas.A.Robarge@Rose-Hulman.edu>
Re: Y2K infected Perl code (Abigail)
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 01 Jun 1999 16:35:02 -0700
From: Jerome O'Neil <jeromeo@atrieva.com>
To: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: bareface ratio
Message-Id: <37546E26.223140AD@atrieva.com>
David Cassell wrote:
> Especially if you add one teeny, tiny error that is
> more-or-less irrelevant to the original point of
> the thread.
I have derived a new unit of measurement for measuring usenet threads
called the 'pedant.' A long thread's length is guaranteed to be at least
two pedants long.
O'Neil's corollary to Goodwin's Law: "The length of a thread needed to
prove Goodwin's Law is inversely proportional to it's pedant measure."
--
Jerome O'Neil, Operations and Information Services
Atrieva Corporation, 600 University St., Ste. 911, Seattle, WA 98101
jeromeo@atrieva.com - Voice:206/749-2947
The Atrieva Service: Safe and Easy Online Backup http://www.atrieva.com
------------------------------
Date: Tue, 01 Jun 1999 19:46:45 -0400
From: Emily Brock Latham <eblatham@unity.ncsu.edu>
Subject: beginner
Message-Id: <375470E5.6B01A4B9@unity.ncsu.edu>
I have just been getting my feet wet with perl. And I am writing a
script that is executing the following line:
exec 'more','avail.dat';
and another line:
exec ("grep $username all.dat");
but each of these clears the screen before outputting the data. Is
there any way to keep it from doing this?
--
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Time's fun when you're having flies!
@..@ eblatham@eos.ncsu.edu
(----) CHECK OUT THE LILY PAD at....
( >__< ) http://www.csc.ncsu.edu/eos/users/e/eblatham/www/home.html
^^ ~~ ^^
------------------------------
Date: 01 Jun 1999 22:31:00 +0200
From: kaih=7I2cMu-mw-B@khms.westfalen.de (Kai Henningsen)
Subject: Re: cont'd
Message-Id: <7I2cMu-mw-B@khms.westfalen.de>
rjk@linguist.dartmouth.edu (Ronald J Kimball) wrote on 30.05.99 in <1dsmynn.1kohkt0lj41r1N@p67.block1.tc5.state.ma.tiac.net>:
> Kai Henningsen <kaih=7Hpl0whmw-B@khms.westfalen.de> wrote:
>
> > Well, I'm not so sure I understood it, but mostly that is because what I
> > *think* he(?) wants doesn't make very much sense. Sorry, let me rephrase
> > that: it doesn't make any sense at all. It looks like a pretty pointless
> > exercise - a little like "given a potato and red paint, can I make it look
> > like a cherry?" Sure, you can - but why on earth would you want to?
>
> You seem to be asking why on earth one would want to print newlines...
Huh? Where on earth did you get that idea?
> I think the original post makes more sense than the above!
Well, you make none. He certainly can't have asked how to print newlines,
given that he explained exactly how to do it.
Or maybe I should take that back. Given his other behaviour, he might well
have been asking even for something he already knew. It doesn't make
sense, but then neither did much else he wrote ...
Kai
--
http://www.westfalen.de/private/khms/
"... by God I *KNOW* what this network is for, and you can't have it."
- Russ Allbery (rra@stanford.edu)
------------------------------
Date: Tue, 01 Jun 1999 23:05:12 GMT
From: Scratchie <upsetter@ziplink.net>
Subject: Re: Downloading files to users browser.
Message-Id: <IGZ43.1524$nn.462668@news.shore.net>
ihatzi@asus.net wrote:
: i.e.. The user clicks on a link, my script verifies users permissions, if
: user is allowed access to the file my script should then initiate the upload
: to the user. If the upload fails the script should make a not of this in a
: log file.
: How does the upload part work, and what tells the script that a failure
: occurred? The rest I have working already. It is just
: the upload part I am stuck on.
Usually, that's called a "download" (from a file server to the user's
computer). Just FYI. After you verify the user's credentials, return a
"Location:" header that points to the correct file (the one to be
downloaded) and it should either appear in the user's web browser or they
will get a "save as" dialog box (or something; depending on how your web
server is configured and how badly broken their browser software is).
--Art
--
--------------------------------------------------------------------------
National Ska & Reggae Calendar
http://www.agitators.com/calendar/
--------------------------------------------------------------------------
------------------------------
Date: Tue, 01 Jun 1999 16:22:51 -0700
From: Jerome O'Neil <jeromeo@atrieva.com>
Subject: Re: Downloading files to users browser.
Message-Id: <37546B4B.94A5D28B@atrieva.com>
ihatzi@asus.net wrote:
> i.e.. The user clicks on a link, my script verifies users permissions, if
> user is allowed access to the file my script should then initiate the upload
> to the user. If the upload fails the script should make a not of this in a
> log file.
There is free software to do just this. Check out www.apache.org, and
read the documents associated with ACL, AccessConfig, Authority and
other permission things, usually found in the core and mod_auth
modules. There is similar un-free software available at
www.netscape.com, www.microsoft.com, and www.oreilly.com, just to name a
few. I understand the cafenated beverage server has been discontinued.
Appropriate Perl content:
mod_perl rawks!
--
Jerome O'Neil, Operations and Information Services
Atrieva Corporation, 600 University St., Ste. 911, Seattle, WA 98101
jeromeo@atrieva.com - Voice:206/749-2947
The Atrieva Service: Safe and Easy Online Backup http://www.atrieva.com
------------------------------
Date: 1 Jun 1999 20:48:26 -0400
From: dha@panix.com (David H. Adler)
Subject: Re: FAQ 4.16: Does Perl have a year 2000 problem? Is Perl Y2K compliant?
Message-Id: <slrn7l8vqm.k8j.dha@panix.com>
On Fri, 28 May 1999 15:56:33 GMT, Sitaram Chamarty <sitaram@diac.com> wrote:
>On Fri, 28 May 1999 09:44:50 GMT, Eric Bohlman
><ebohlman@netcom.com> wrote:
>
>>There is a view, frequently and sometimes unfairly attributed to
>>Microsoft, that a computer program, language, etc. should be designed so
>>that a newbie can make full use of it *while remaining a newbie*; that no
>>learning should be required. This is *not* part of the Perl philosophy,
>>which holds that learning the language increases one's power.
>
>And increasing one's power (should) always imply increasing one's
>responsibility, too.
And I believe that's exactly the point. If you want to increase your
power by learning a language that will imbue you with said power, it
is *your* responsibility to learn to use it correctly.
Or did I miss something here? :-/
--
David H. Adler - <dha@panix.com> - http://www.panix.com/~dha/
"We're dumber than squirrels. We hear voices and do what they
command. I have broccoli in my socks." - Dilbert's boss
------------------------------
Date: 01 Jun 1999 23:13:00 +0200
From: kaih=7I2cN6K1w-B@khms.westfalen.de (Kai Henningsen)
Subject: Re: FAQ 4.68: How do I handle binary data correctly?
Message-Id: <7I2cN6K1w-B@khms.westfalen.de>
lr@hpl.hp.com (Larry Rosler) wrote on 19.05.99 in <MPG.11ac9d6636cc2eb0989aab@nntp.hpl.hp.com>:
> In article <7hur5t$o12$1@fcnews.fc.hp.com> on 19 May 1999 17:08:13 GMT,
> Andrew Allen <ada@fc.hp.com> says...
> > Larry Rosler (lr@hpl.hp.com) wrote:
> ...
> > : The ANSI/ISO C Standard says to use modes "rb" "wb" or "ab" when opening
> > : a binary file, without ascribing pejorative characteristics such as
> > : 'legacy systems' (whatever that means) to those implementations that
> > : require it. So this Perl FAQ never gets asked about C -- there is no
> > : question; that is The Way To Do It.
> >
> > So maybe we should make this the Perl Way To Do It:
> >
> > open("*>binaryfile");
> > open("*<binaryfile");
> >
> > (the character "*" meaning binary, open to suggestions). 'binmode'
> > always seemed like a hack. Course, we should still keep it around
> > for those 'legacy' apps ;)
>
> I'm concerned more about treating all Perl implementations as first-
> class citizens than about the syntax. As your approach doesn't add
> semantics that I can perceive, I'd be very happy to stick with the
> existing 'binmode' hack (as you put it).
That's a strange interpretation of "first-class citizen". As in, needing
to use an ugly construct like binmode on some OSes certainly doesn't look
like first-class citizen status to me.
Come on, C can do it in the open statement, why not Perl? Is C really more
high-level than Perl, here?
Kai
--
http://www.westfalen.de/private/khms/
"... by God I *KNOW* what this network is for, and you can't have it."
- Russ Allbery (rra@stanford.edu)
------------------------------
Date: 01 Jun 1999 23:16:00 +0200
From: kaih=7I2cNMy1w-B@khms.westfalen.de (Kai Henningsen)
Subject: Re: FAQ 4.68: How do I handle binary data correctly?
Message-Id: <7I2cNMy1w-B@khms.westfalen.de>
perlfaq-suggestions@perl.com (Tom Christiansen) wrote on 19.05.99 in <3742da5c@cs.colorado.edu>:
> On some legacy systems, however, you have to play tedious games
> with "text" versus "binary" files. See the section on "binmode" in
> the perlfunc manpage, or the upcoming the perlopentut manpage
> manpage.
Hmm. Someone was upset enough here to lose his language skills - or maybe
only his proofreading skills.
"... the upcoming the perlopentut manpage manpage"?
*** *******
Kai
--
http://www.westfalen.de/private/khms/
"... by God I *KNOW* what this network is for, and you can't have it."
- Russ Allbery (rra@stanford.edu)
------------------------------
Date: 1 Jun 1999 18:01:02 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: FAQ 4.68: How do I handle binary data correctly?
Message-Id: <3754743e@cs.colorado.edu>
[courtesy cc of this posting mailed to cited author]
In comp.lang.perl.misc,
kaih=7I2cN6K1w-B@khms.westfalen.de (Kai Henningsen) writes:
:Come on, C can do it in the open statement, why not Perl? Is C really more
:high-level than Perl, here?
If you want a C open, use sysopen().
If you want a shell open, use open().
If you want to learn Far More Than Everything You Ever Wanted To Know about
opening files, check out the new perlopentut manpage, or go to
http://language.perl.com/admin/whats_new.html to get just that
page or the complete current docset.
--tom "strongly typed files suck" christiansen
--
"A pithy saying is worth its weight in gold." --Larry Wall
------------------------------
Date: Tue, 01 Jun 1999 16:00:32 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
To: mistral@zetnet.co.uk
Subject: Re: formatting number output
Message-Id: <37546610.9B3C148F@mail.cor.epa.gov>
[courtesy cc sent to poster]
James Stevenson wrote:
>
> Hi
>
> so where are the FAQS??
Well, they're on your machine along with the Perl install..
unless you installed from the "Perl for Dummies" book;
or your copy of Perl is on your ISP's machine and he won't
let you look at the docs; or your sysadmin installed Perl
and botched the job. The solution in all cases is to go to
www.perl.org and get your own personal copy of the docs.
If you have ActiveState Perl on your system, you also have
an HTML tree of docs with a shortcut for it on your Start
menu.
Once you find|install the docs, then you can read all the
FAQs, as well as tons of great documentation on all aspects
of Perl programming. Well, *almost* all aspects. You may
also want to venture to:
http://www.perlmonth.com/articles//rtfm.html
to read about how to use the tools to get more out of the
docs.
BTW, the answer Andrew was steering you toward has to do
with the fact that all computers have roundoff error
issues related to how people see the number vs how the
computer *stores* the number. 1/3 is easy for you to
deal with, but a computer has to store an approximation
of the number. So Perl gives you functions to work with
the number to the number of decimal places you want.
sprintf and printf are pointed to in the FAQ, but you'll
want to read more about them there before going to the
perlfunc pages to read the details.
HTH,
David
--
David Cassell, OAO cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician
------------------------------
Date: 02 Jun 1999 00:27:00 +0200
From: kaih=7I6cNovHw-B@khms.westfalen.de (Kai Henningsen)
Subject: Re: Perl Unicode/Multibyte Support
Message-Id: <7I6cNovHw-B@khms.westfalen.de>
ilya@math.ohio-state.edu (Ilya Zakharevich) wrote on 21.05.99 in <7i2qlj$6hk$1@mathserv.mps.ohio-state.edu>:
> [A complimentary Cc of this posting was sent to Larry Rosler
> <lr@hpl.hp.com>],
> who wrote in article <MPG.11ae3594aa131aaf989ad4@nntp.hpl.hp.com>:
> > > There is no conversion of any kind. Perl strings are just sequences
> > > of small integers. Without `use utf8' small means 0..255. With `use
> > > utf8' small means 0..2**36-1. This is the only difference (forgetting
> > > about speed and bugs).
> >
> > 0..2**32-1 I hope.
>
> Why would this make you happier?
0..2^31-1 is really all UTF-8 is defined for (that is, the ISO 10646
range).
Given that UTF-8 represents
bits in bytes
7 1 (ASCII)
11 2
16 3 (UCS-2, Unicode w/o surrogates)
21 4 (UTF-16, Unicode w/ surrogates, max planned range)
26 5
31 6 (UCS-4, ISO 10646)
this comes out just fine. Yes, you *can* extend that to 36/7, but those
values are (I think) explicitely defined as "don't happen".
/[\xfe\xff]/ and die "this ain't UTF-8!";
Kai
--
http://www.westfalen.de/private/khms/
"... by God I *KNOW* what this network is for, and you can't have it."
- Russ Allbery (rra@stanford.edu)
------------------------------
Date: 1 Jun 1999 18:10:14 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Slow, or looping?
Message-Id: <slrn7l8qfv.grs.abigail@alexandra.delanet.com>
Ilya Zakharevich (ilya@math.ohio-state.edu) wrote on MMC September
MCMXCIII in <URL:news:7j02sn$jl$1@mathserv.mps.ohio-state.edu>:
:: [A complimentary Cc of this posting was sent to Abigail
:: <abigail@delanet.com>],
:: who wrote in article <slrn7l5ruv.fvi.abigail@alexandra.delanet.com>:
:: > If something is not Omega (n), how can it be Omega (n^e) for e > 1 ?
:: >
:: > What kind of definition of Omega are you using???
::
:: Hmm, I was meaning "equivalent up to a bounded factor". Indeed, Omega
:: is not used for this (even if we forget that this post of mine was a
:: complete nonsense ;-().
You wanted Theta().
Abigail
--
perl -MTime::JulianDay -lwe'@r=reverse(M=>(0)x99=>CM=>(0)x399=>D=>(0)x99=>CD=>(
0)x299=>C=>(0)x9=>XC=>(0)x39=>L=>(0)x9=>XL=>(0)x29=>X=>IX=>0=>0=>0=>V=>IV=>0=>0
=>I=>$r=-2449231+gm_julian_day+time);do{until($r<$#r){$_.=$r[$#r];$r-=$#r}for(;
!$r[--$#r];){}}while$r;$,="\x20";print+$_=>September=>MCMXCIII=>()'
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: Tue, 1 Jun 1999 17:08:30 -0700
From: "Mr. Pumpkin" <pumpkin@nowhere.com>
Subject: string comparison - exact matching...
Message-Id: <VH_43.3812$%65.8687@tor-nn1.netcom.ca>
in the following statement:
if (X eq Y)
{
allowed
}
else
{
disallow
}
How would you get it to return true ONLY if the two strings (x and y) are
exactly the same. The way it is now doesn't work - if x is "waf" and y is
"w", right now it is evaluating as true. Any ideas? (for passwords)
Thanks,
Forest Johns
fdjohns@home.com
------------------------------
Date: 2 Jun 1999 00:59:40 GMT
From: sholden@pgrad.cs.usyd.edu.au (Sam Holden)
Subject: Re: string comparison - exact matching...
Message-Id: <slrn7l90fs.6do.sholden@pgrad.cs.usyd.edu.au>
On Tue, 1 Jun 1999 17:08:30 -0700, Mr. Pumpkin <pumpkin@nowhere.com> wrote:
>in the following statement:
>
>if (X eq Y)
> {
> allowed
> }
>else
> {
> disallow
> }
>
>How would you get it to return true ONLY if the two strings (x and y) are
>exactly the same. The way it is now doesn't work - if x is "waf" and y is
>"w", right now it is evaluating as true. Any ideas? (for passwords)
No it doesn't...
if ("waf" eq "w")
{
print "allowed\n";
}
else
{
print "disallowed\n";
}
Gives the output : disallowed
--
Sam
Every human culture has good and bad points. Every computer program has
Eveone more bug. Even Perl.
--Larry Wall
------------------------------
Date: Tue, 1 Jun 1999 17:08:48 -0700
From: "Mr. Pumpkin" <pumpkin@nowhere.com>
Subject: test
Message-Id: <cI_43.3813$%65.8672@tor-nn1.netcom.ca>
stestes
------------------------------
Date: 1 Jun 1999 22:26:25 GMT
From: Jeff Zucker <jeff@vpervices.com>
Subject: Testing for flock (was Re: $^O and all types?)
Message-Id: <37545D84.8360F0A4@vpervices.com>
"M.J.T. Guy" wrote:
>
> eval { flock STDOUT, 0 };
> if ($@ =~ /not implemented/) {
> ... do something else ...
> };
>
> Though there was another thread here a little while back reporting that
> this technique doesn't always work.
>
> Mike Guy
Mike, I think you are referring to a thread you and I had about flock on
win95. In that thread, you proposed
use constant HAS_FLOCK => eval { flock 0, 0; 1 };
Which gives a false positive on win95. But this time around you used
"STDOUT" instead of 0 as the filehandle, and guess, what - it works, at
least with activeState build 509. (with the exception that the $@
contains "unimplemented", not "not implemented" as you have it).
This seems the cleanest solution that works - (returns a 0 on win95 and
a 1 on solaris):
use constant HAS_FLOCK => eval { flock STDOUT, 0; 1 };
--
Jeff Zucker
------------------------------
Date: 01 Jun 1999 22:07:00 +0200
From: kaih=7I2cM3W1w-B@khms.westfalen.de (Kai Henningsen)
Subject: Re: Use binmode for binary files
Message-Id: <7I2cM3W1w-B@khms.westfalen.de>
lr@hpl.hp.com (Larry Rosler) wrote on 30.05.99 in <MPG.11bbae2f2057382a989b38@nntp.hpl.hp.com>:
> In article <7HtllOkHw-B@khms.westfalen.de> on 31 May 1999 01:09:00
> +0200, Kai Henningsen <kaih=7HtllOkHw-B@khms.westfalen.de> says...
> > lr@hpl.hp.com (Larry Rosler) wrote on 28.05.99 in
> > <MPG.11b8a90199eb5ca7989b28@nntp.hpl.hp.com>:
> ...
> > > My point is -- why bother to skip it? The documentation and the books
> > > and the teachers should say that This Is THE Way To Do It. Where it is
> > > not needed, it costs NOTHING (modulo the time to read and parse one Perl
> > > statement during compilation). Where it is needed, it is essential.
> >
> > Because it may not be clear to you if, were you to port your program to a
> > binmode-challenged system (which you have no intention to do), the file
> > you're working with would need binmode, because that would depend on
> > system properties you don't know about?
> >
> > Or, to put it another way, sometimes the programmer is in the exact same
> > situation the perl binary is in.
>
> Sorry, no. That is not possible. The programmer *always* knows.
Nonsense. Been there, done that, and as long as you don't actually port it
to a system where it does make a difference, it may well be unclear.
Hell, I've had cases where it was written *on* a system where it makes a
difference, and it wasn't clear if it would be better handling the file as
text or as binary!
> Whether a file is 'text' or 'binary' depends on the program that writes
> the file, not on system properties.
And why do you assume "the program that writes the file" cannot be a part
of "system properties"? Because that's exactly the way I meant this.
> A 'text' file has an internal
> logical structure of records terminated by newlines (however represented
> in external storage by the particular implementation); a 'binary' file
> does not. The programmer knows this. All the time. And should use
> 'binmode' for binary files. All the time.
Well, if you use that definition for text files, then I'm sorry to say
that this *does not* tell you if you should or should not use binmode on a
"text file".
You may want to re-read what I wrote. I didn't say that this was *never*
obvious, I said it was *sometimes* non-obvious. Of course you should use
binmode when you handle, say, an a.out type executable, or a GIF file.
That's not the case that gives you trouble.
The case that may give you trouble could, for example, be handling mail.
On a CRLF system, will mail be stored with CRLF delimiters (no binmode may
be right) or with LF delimiters so as to be compatible with some Unix
software (binmode is probably necessary)? How do you know, without
actually looking at the system? You don't.
Kai
--
http://www.westfalen.de/private/khms/
"... by God I *KNOW* what this network is for, and you can't have it."
- Russ Allbery (rra@stanford.edu)
------------------------------
Date: 01 Jun 1999 22:15:00 +0200
From: kaih=7I2cMMpmw-B@khms.westfalen.de (Kai Henningsen)
Subject: Re: Use binmode for binary files
Message-Id: <7I2cMMpmw-B@khms.westfalen.de>
lr@hpl.hp.com (Larry Rosler) wrote on 31.05.99 in <MPG.11bc6449d053dbfb989b3b@nntp.hpl.hp.com>:
> 1. Tom Phoenix reminded me that where I said 'Nothing more, nothing
> less." I overlooked that unless binmode() is used, a Control-Z character
> is interpreted as input end-of-file on Windows/DOS systems.
Umm. That's not a particularly good idea. It's a carry-over from CP/M
which had no byte-granularity file lengths; people learned they didn't
need it under DOS a *long* time ago.
If you do it at all, limit it to the very last byte of a file. Don't make
a ^Z in the third line drop all the other 1347893 lines. People won't
thank you.
> 2. On some legacy systems, records ('lines') are defined by structures
> imposed by the file system, rather than by embedded characters in a byte
> stream. On such systems, the binmode() distinctions become critical.
And even on those systems, you might want to read text files with binmode
(or the C equivalent). Been there, done that (on CMS).
> 3. I have seen discussion (in p5p) about making the error message that
> currently reports file position in 'chunks' report 'lines' if the value
> of $/ is the default "\n". Good. Now also let it report 'records'
> instead of 'chunks' in the other case. $/ is $INPUT_RECORD_SEPARATOR,
> not $INPUT_CHUNK_SEPARATOR.
Now that is probably a good idea.
Kai
--
http://www.westfalen.de/private/khms/
"... by God I *KNOW* what this network is for, and you can't have it."
- Russ Allbery (rra@stanford.edu)
------------------------------
Date: 01 Jun 1999 22:18:00 +0200
From: kaih=7I2cMcW1w-B@khms.westfalen.de (Kai Henningsen)
Subject: Re: Use binmode for binary files
Message-Id: <7I2cMcW1w-B@khms.westfalen.de>
flavell@mail.cern.ch (Alan J. Flavell) wrote on 31.05.99 in <Pine.HPP.3.95a.990531201458.6823H-100000@hpplus01.cern.ch>:
> Having spent some years with IBM mainframes, where the record terminator
> wasn't even a data character at all, I feel this problem particularly
> acutely.
Sometimes. And sometimes X'15' was a nice, functional EBCDIC carriage
return - often enough that I still remember it after more than seven years
of not touching the stuff. (And now I may have to teach it to an AS/400
programmer ...)
Kai
--
http://www.westfalen.de/private/khms/
"... by God I *KNOW* what this network is for, and you can't have it."
- Russ Allbery (rra@stanford.edu)
------------------------------
Date: Tue, 01 Jun 1999 16:51:22 -0400
From: "Nicholas A. Robarge" <Nicholas.A.Robarge@Rose-Hulman.edu>
Subject: Using Perl to call DLL functions
Message-Id: <375447CA.2BB0618B@Rose-Hulman.edu>
Hello!
Does anyone know of a way to have a perl program load a dynamic link
library (DLL, on a Windows machine) and call its functions? The
functions were written in C and C++. Also, similar functionality is
needed for UNIX libraries as well.
Thank you in advance. If you have or could point me to example code, I
would greatly appreciate it!
Nick
------------------------------
Date: 1 Jun 1999 19:06:33 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Y2K infected Perl code
Message-Id: <slrn7l8tph.grs.abigail@alexandra.delanet.com>
Eric Bohlman (ebohlman@netcom.com) wrote on MMC September MCMXCIII in
<URL:news:ebohlmanFCo3xF.5HI@netcom.com>:
??
?? Theorem: for every language L and any correct program P in L which takes N
?? lines of code, there exists an incorrect program PP in L which takes NN
?? lines of code, NN<=N, and NN<N for N>1.
??
?? Proof: Let P be a correct N-line program in L accomplishing some task T, and
?? assume WLOG that N is the minimum number of lines in which such a program
?? can be encoded. Transform P to PP by the following rules:
??
?? 1) If N>1, delete an arbitrarily-chosen line from P.
?? 2) If N=1, delete an arbitrarily-chosen syntactically-significant
?? character from P.
??
?? By the assumption, PP cannot be a correct program.
You're assuming empty programs aren't correct. That's incorrect for some
languages L.
Abigail
--
%0=map{reverse+chop,$_}ABC,ACB,BAC,BCA,CAB,CBA;$_=shift().AC;1while+s/(\d+)((.)
(.))/($0=$1-1)?"$0$3$0{$2}1$2$0$0{$2}$4":"$3 => $4\n"/xeg;print#Towers of Hanoi
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: 12 Dec 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Special: Digest Administrivia (Last modified: 12 Dec 98)
Message-Id: <null>
Administrivia:
Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing.
]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body. Majordomo will then send you instructions on how to confirm your
]subscription. This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.
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 5855
**************************************