[9983] in Perl-Users-Digest
Perl-Users Digest, Issue: 3576 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Aug 28 14:03:56 1998
Date: Fri, 28 Aug 98 11: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 Fri, 28 Aug 1998 Volume: 8 Number: 3576
Today's topics:
Re: Bit of humor (John Stanley)
Re: Bit of humor (John Moreno)
Re: CGI Form Refresh <daedalus@sol.EBay.Sun.COM>
Re: comp.lang.perl.windows.misc <danboo@negia.net>
Re: Determining strlen (brian d foy)
Re: even or odd (Abigail)
Function Prototypes and Missing Arguments <dwc3q@mamba.cs.virginia.edu>
Help with date script' <sstout@holly.ColoState.EDU>
Hexdigit <julius@clara.net>
Re: How do I take out tags? <hendrik.woerdehoff@sdm.de>
Re: How do I take out tags? (I R A Aggie)
Re: How to convince others using perl instead bourne sc (Lupe Christoph)
Re: How to match anything but some characters (reg-exp) <aqumsieh@tigre.matrox.com>
Re: How to match anything but some characters (reg-exp) (brian d foy)
Re: Max value in an array <jdporter@min.net>
Re: Perl compiler <jon@floorboard.com>
Re: Perl compiler (Abigail)
Re: Perl compiler (Abigail)
Re: Perl Cookbook, does anyone have it? scott@softbase.com
Re: Perl Cookbook, does anyone have it? <aidan@salvador.blackstar.co.uk>
Re: Perl Cookbook, does anyone have it? (Michael J Gebis)
Re: Perl Cookbook, does anyone have it? <Scott.Boss@bridge.bellsouth.com>
problem with substr function bolesbr1@memorialmed.com
Reading a line from a file (fred)
removing ^M when writing to file (Antti-Jussi Korjonen)
session id <lakesoft@skypoint.com>
Re: session id (Maurice Aubrey)
Re: Trouble with getc()... <psmith01@mindspring.com>
Re: typeglobs and references... (re: Prog Perl, p 117) <jdporter@min.net>
Re: use vars and my, have I got it right? <jdporter@min.net>
Web Site Devoted Scripting Under Win32 <cwashing@ix.netcom.com>
Re: Why do these two differ? (brian d foy)
Re: Why do these two differ? <jdporter@min.net>
Re: why no true/false keywords? (Peter Scott)
Windows95, Perl, PWS (IIS) (Angel Leyva)
Re: Y2K Date Support (Abigail)
Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 28 Aug 1998 16:47:17 GMT
From: stanley@skyking.OCE.ORST.EDU (John Stanley)
Subject: Re: Bit of humor
Message-Id: <6s6mul$bd1$1@news.NERO.NET>
In article <1degtga.1txehjo1fzgdq4N@roxboro0-009.dyn.interpath.net>,
John Moreno <phenix@interpath.com> wrote:
>nobody <ac1@fspc.netsys.itg.telecom.com.au> wrote:
>
>> Thought you bods might appreciate this bit of humor I found in
>> one of our code reviews - the link to Perl is tenuous at best,
>> but the reviewing crowd got a laugh out of it.
>>
>> # Get the current date/time and pid from the system. Note the sneaky
>> # trick to decide which century we are in. If you're reading this
>> # in 2069, my apologies: you think we would have learned from the
>> # Y2K crisis - now you know better. If you're looking at this code
>> # to ensure it passes the 32-bit-UNIX 2038 bug, please fix this as
>> # well; we're far too busy on Y2K at the moment :-).
>>
>> ($Sec,$Min,$Hr,$MDay,$Mon,$Yr,$Junk,$Junk,$Junk) = localtime( time );
>> $Yr += ($Yr < 70) ? 2000 : 1900;
>
>but that doesn't work!
Ahhh, but it does. Since it is now 1998, the current year will never be
less than 98, thus it can never be less than 70, thus you will always
add 1900 -- which is The Perl Way.
And it has the side benefit of showing to PHM that they have, indeed,
caught one of those awful Y2K bugs before it cost the company lots of
money, and thus they are heros!
------------------------------
Date: Fri, 28 Aug 1998 13:11:04 -0400
From: phenix@interpath.com (John Moreno)
Subject: Re: Bit of humor
Message-Id: <1deh1ph.b07cqz19d7k9bN@roxboro0-009.dyn.interpath.net>
Maurice Aubrey <maurice@hevanet.com> wrote:
> John Moreno <phenix@interpath.com> wrote:
>
> >but that doesn't work!
> >
> >You need to contact them immediately and have that replaced with:
> >($Sec,$Min,$Hr,$MDay,$Mon,$Yr,$Junk,$Junk,$Junk) = localtime( time );
> >$Yr =$1 if $Yr =~ /(..)$/; # strip year down to 2 digits
> >$Yr += ($Yr < 70) ? 2000 : 1900;
>
> But which should be written in the standard way:
>
> ($Sec,$Min,$Hr,$MDay,$Mon,$Yr,$Junk,$Junk,$Junk) = localtime;
> $Yr += 1900;
I believe that the original post was a attempt at humor (by way of
introducing a year 2070 bug). The code as originally posted, although
redundant, would function just fine (localtime will never return a year
less than 70 [at least not if the clock is set correctly] so 1900 is
always added to it, giving the correct result]).
So I "fixed" the code so that there IS a year 2070 bug (if you use my
code from above then in 2070 the year will be reported as 1970 (and then
of course in 2100, the year will be 2000 - two bugs for the price of
one).
As for anybody who might be mislead by this - any causal reading of the
docs for localtime will prevent that from happening, as will simply
reading the newsgroup for a month (some fool is always asking about the
Y2k problem and localtime - I'm not sure how this happens, as if they
can read well enough to see that 1900 is being added to the year they
should be able to read well enough to see that doing is 100% right).
--
John Moreno
------------------------------
Date: Fri, 28 Aug 1998 08:54:54 -0700
From: MICHAEL JONES <daedalus@sol.EBay.Sun.COM>
Subject: Re: CGI Form Refresh
Message-Id: <35E6D2CE.FDB25C83@sol.EBay.Sun.COM>
Ashley Latham wrote:
<snip>
> On some browsers when I hit the browser back button I can see the form with
> all the information I have entered as it was just before I hit the submit
> button. This is good in that if an error has been made with the data entry
> the entire form doesn't need to be re-entered, only the fields that are
> wrong. On other browsers when the browser back button the form is refreshed
> and reset to the initial empty fields.
>
> Can someone tell me if there is anyway to control this, or at least which
> browsers reset the form and which don't and why?
<snip>
I suspect what your seeing is the result of a cache setting in the
browser. When you hit the Back button on Netscape or IE, the browser
will ALWAYS point to the cached page. Even if that page has expired.
I believe IE has a setting that will disallow caching of non-static
pages, which would mean that the browser will refresh the page since
it has no cached version to work from. This is not something you can
control, only the client can control it.
_______________________________________________________________________
"Brought low by an ending so cliche it could have oozed from the
powerbook of the laziest Hollywood hack!" - Sideshow Bob
szaijan@ternea.com daedalus@sol.ebay.sun.com
_______________________________________________________________________
------------------------------
Date: Fri, 28 Aug 1998 13:34:32 -0400
From: Dan Boorstein <danboo@negia.net>
Subject: Re: comp.lang.perl.windows.misc
Message-Id: <35E6EA28.4686CFAD@negia.net>
Greg Bacon wrote:
>
> In article <35E47639.9BF271E6@negia.net>,
> Dan Boorstein <danboo@negia.net> writes:
> : Greg Bacon wrote:
> : > Please provide evidence for the claim that people who post from the
> : > .edu TLD are rude and clueless.
> :
> : hmm, this sounds awfully familiar greg.
> :
> : s/the\n\.edu TLD/win32/
> :
> : i believe you've received this challenge previously and failed to
> : produce any evidence except personal observation. considering the
> : seriousness of the claim i find this unacceptable (as i do bob's claim).
> : why is bob required to do that which you are not?
>
> While I would love to clean your magnificent stables in one day, I
> don't know of a river to redirect through them. Come on, Dan. Every
> article carried by Usenet is required to contain a From: header.
> This is not the case for X-Newsreader:.
the point is not that one is easier to gather evidence about than
the other. it is that you expect someone else to provide evidence,
while you just sit back and repeat the same old personal findings.
don't you see the contradiction here? you don't believe him because
no evidence was provided. i don't believe you because no evidence
was provided. sure, you've got your personal observations that
satisfy your needs of proof. but why do you expect that to satisfy
me?
are you saying that you have proffered a hypothesis for which
you can find no evidence (at least not suitable for public consumption),
pro or con? if so, then as a card-carrying skeptic, i see this as a big
flashing neon sign telling me not to believe you.
it's as if you think your argument is safe and acceptable since
evidence is difficult or impossible to gather. and this wouldn't
bother me if you kept it to yourself, but as long as i see you
(or others) repeating it without evidence i'm going to continue
challenging it.
cheers,
--
Dan Boorstein home: danboo@negia.net work: danboo@y-dna.com
"THERE IS AS YET INSUFFICIENT DATA FOR A MEANINGFUL ANSWER."
- Cosmic AC
------------------------------
Date: Fri, 28 Aug 1998 12:17:32 -0400
From: comdog@computerdog.com (brian d foy)
Subject: Re: Determining strlen
Message-Id: <comdog-ya02408000R2808981217320001@news.panix.com>
Keywords: from just another new york perl hacker
In article <x3yd89l9n5d.fsf@tigre.matrox.com>, Ala Qumsieh <aqumsieh@tigre.matrox.com> posted:
>/<A HREF=http:.*>/i
>
>But notice that this is a naive approach. Asterisks are greedy
>matchers by default .. so you might end up matching something like:
>
><A HREF="http://www.bla.com/>Click <bold>here</bold>
so why not go on to mention the ? modifier which will make the
match non-greedy?
/<a href=.*?>/i;
--
brian d foy <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
Comprehensive Perl Archive Network (CPAN) <URL:http://www.perl.com>
Perl Mongers needs volunteers! <URL:http://www.pm.org/to-do.html>
------------------------------
Date: 28 Aug 1998 17:37:13 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: even or odd
Message-Id: <6s6ps9$2g1$3@client3.news.psi.net>
Andy Lee (andylee@prodigy.net) wrote on MDCCCXXIII September MCMXCIII in
<URL: news:6s4thf$7nng$1@newssvr04-int.news.prodigy.com>:
++ Hi,
++
++ I need some help to write a script to print out the even number.
++ This is what I am trying to do. Read a file and print out only the even
++ number
++ records. I don't know how to test the number for even or odd. Thanks..
++
++ #!/usr/bin/perl
++ open (file,"phone.dat")
++ while (<file>)
++ {
++ #Test for even number
++ #print only the even number record
++ }
++ close (file)
sub is_odd ($);
sub is_even ($);
sub is_odd ($) {
my $num = shift;
$num < 0 ? is_odd - $num : $num ? is_even -- $num : 0;
}
sub is_even ($) {
my $num = shift;
$num < 0 ? is_even - $num : $num ? is_odd -- $num : 1;
}
Abigail
--
perl5.004 -wMMath::BigInt -e'$^V=new Math::BigInt+qq;$^F$^W783$[$%9889$^F47$|88768$^W596577669$%$^W5$^F3364$[$^W$^F$|838747$[8889739$%$|$^F673$%$^W98$^F76777$=56;;$^U=substr($]=>$|=>5)*(q.25..($^W=@^V))=>do{print+chr$^V%$^U;$^V/=$^U}while$^V!=$^W'
------------------------------
Date: Fri, 28 Aug 1998 13:01:08 -0400
From: David Coppit <dwc3q@mamba.cs.virginia.edu>
Subject: Function Prototypes and Missing Arguments
Message-Id: <Pine.SOL.3.96.980828125326.24319A-100000@mamba.cs.virginia.edu>
I have a function that looks like this:
sub foo($\%\@)
{
# Make a local copy of the hash and array referred to by @_
my $var = shift @_;
my %hash = %{(shift @_)};
my @array = @{(shift @_)};
...
}
The idea is that a person can call the function like so:
foo($a,%b,@c);
Trouble is, what happens if %b is empty, and @c is an array of arrays?
Then the second argument to foo becomes an array reference! Ug. I'd like
to be able to test whether the second argument is defined from within foo,
but I guess I can't do this because of Perl's collapsing the args into one
list, right?
I should also say that it's possible that both the hash and the array are
empty, and I'd like to handle that case from within the function also.
It seems like the only way out is to force the user to use references in
the function call like so:
foo ($a,\%b,\@c)
Any suggestions?
Thanks,
David
_________________________________________________________________________
David Coppit - Graduate Student coppit@cs.virginia.edu
The University of Virginia http://www.cs.virginia.edu/~dwc3q
"For I am a Bear of Very Little Brain,
and long words Bother me" - Winnie the Pooh
------------------------------
Date: 28 Aug 1998 10:53:47 -0600
From: Shane Stout <sstout@holly.ColoState.EDU>
Subject: Help with date script'
Message-Id: <6s6nar$23a8@holly.ColoState.EDU>
I have to write a script that determines the date and then calculates the next
days date in the form Month dayofmonth, year. I am using the conversion
function localtime, but if I do I have to also script a solution to trap the
ends of each month. I was just wondering if anyone knew of someone who had
already solved this problem or of a module that does. I don't really want to
reinvent the wheel if someone already has done so. Thanks in advance.
Shane M. Stout
sstout@colostate.edu
------------------------------
Date: Fri, 28 Aug 1998 16:09:54 +0100
From: "Jules" <julius@clara.net>
Subject: Hexdigit
Message-Id: <6s6o0t$ikl$1@eros.clara.net>
Dear all, I'm a complete newbie to perl and am reading this O'Reilly camel
book of Programming Perl. It's got an example (page 48) which has a single
line:
$hexdigit = ('a','b','c','d','e','f') [$digit-10];
and it claims that its a hex digit finder.
I tried that with $digit=265 so hexdigit hopefully will become FF or 255
or, in perl, 0xfff and of course a print STDOUT "$digit is $hexdigit"; But
it didn't work, I only get the output 256 is (null output for
$hexdigit that is). So is it me or the book?
Please tell.
Thanx,
Jules
***There is not enough darkness in the whole world to extinguish the light
of a small candle***
------------------------------
Date: Fri, 28 Aug 1998 18:45:27 +0200
From: Hendrik Woerdehoff <hendrik.woerdehoff@sdm.de>
Subject: Re: How do I take out tags?
Message-Id: <35E6DEA7.2C88@sdm.de>
Chocolate wrote:
>
> How do I remove tags from a file? I want to remove all html tags from a
> html doc that I have. How would I do this?
Load the file into Winword and save it as *.doc or *.txt.
> Also, is there a program out
> that will convert word docs to html?
Yes. Try "Save as HTML..." in Winword :-)
Hendrik
--
Hendrik W"ordehoff |s |d &|m | software design & management
| | | | GmbH & Co. KG :
woerdehoff@sdm.de | | | | Thomas-Dehler-Str. 27 >B)
Tel/Fax (089) 63812-337/515 81737 M"unchen :
Nach Paragraph 28 Abs. 3 des Bundesdatenschutzgesetz widerspreche ich
der Nutzung oder Uebermittlung meiner Daten fuer Zwecke der Werbung
oder der Markt- oder Meinungsforschung.
------------------------------
Date: Fri, 28 Aug 1998 13:13:57 -0500
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: How do I take out tags?
Message-Id: <fl_aggie-2808981313570001@aggie.coaps.fsu.edu>
In article <Pine.BSF.4.02A.9808280941300.16874-100000@schultz.io.com>,
Chocolate <poohba@io.com> wrote:
+ How do I remove tags from a file? I want to remove all html tags from a
+ html doc that I have. How would I do this?
You mean:
NAME
HTML::Parser - SGML parser class
SYNOPSIS
require HTML::Parser;
$p = HTML::Parser->new; # should really a be subclass
$p->parse($chunk1);
$p->parse($chunk2);
#...
$p->eof; # signal end of document
+ Also, is there a program out that will convert word docs to html?
Yes. Word.
James
------------------------------
Date: 28 Aug 1998 12:07:28 +0200
From: lupe@alanya.m.isar.de (Lupe Christoph)
Subject: Re: How to convince others using perl instead bourne scripts
Message-Id: <6s5vh0$f6l$1@alanya.m.isar.de>
Dennis Chang <dchang@transarc.com> writes:
>My friend keeps saying bourne script and C is more efficient than perl.
That's a strange argument. Given the many process creations
and other convolutions you have to go through with shell scripts,
Perl is much more efficient because it all runs in one process,
with one variable context.
C is more efficient than perl, but only in execution time.
Perl is more effective than C in programmer time. So if you
have something that's time-critical, or must run on an already
overloaded machine, use C. If you have to have it running ASAP,
or tyhe environment is less critical, use Perl.
>Where can I find the advantages and disadvantage among perl, bourne
>scripts and C?
I challenge your friend to write an application suite for message
switching, a server that can accept thousands of connections, a
client that displays the messages and a client that allows you
to compose them (with the recipents selectable as groups, locations,
or individually by real name), with the clients running on Unix
and Win32, in three manweeks. Look-and-feel Motif or Win32,
depending on platform.
Of course, he has to use the WinNT cmd.exe for the part he does
in Bourne shell on Unix...
(The shell is originally written by Stephen Bourne, so it deserves
capitalization, just like the Korn shell.)
--
| lupe@alanya.m.isar.de (private) | lupe@octogon.de (business) |
| "In short, just as the Multics mentality of careful access controls |
| shows up throughout Unix, the cretinous CP/M mentality of uncontrolled |
| havoc shows up in DOS and all its mutant children." Tom Christiansen |
------------------------------
Date: 28 Aug 1998 12:44:42 -0400
From: Ala Qumsieh <aqumsieh@tigre.matrox.com>
Subject: Re: How to match anything but some characters (reg-exp)
Message-Id: <x3ybtp59htx.fsf@tigre.matrox.com>
tadmc@metronet.com (Tad McClellan) writes:
>
> if ($somescalar !~ /^[a-z0-9-]*$/) { # if any char other than
> do stuff # those 37 chars is in the string
> }
>
You surely mean for that caret to be after the '[' ... I hope :)
--
Ala Qumsieh | No .. not Just Another
ASIC Design Engineer | Perl Hacker!!!!!
Matrox Graphics Inc. |
Montreal, Quebec | (Not yet!)
------------------------------
Date: Fri, 28 Aug 1998 13:51:24 -0400
From: comdog@computerdog.com (brian d foy)
Subject: Re: How to match anything but some characters (reg-exp)
Message-Id: <comdog-ya02408000R2808981351240001@news.panix.com>
Keywords: from just another new york perl hacker
In article <x3ybtp59htx.fsf@tigre.matrox.com>, Ala Qumsieh <aqumsieh@tigre.matrox.com> posted:
>tadmc@metronet.com (Tad McClellan) writes:
>
>>
>> if ($somescalar !~ /^[a-z0-9-]*$/) { # if any char other than
>> do stuff # those 37 chars is in the string
>> }
>>
>
>You surely mean for that caret to be after the '[' ... I hope :)
nope. he meant what he wrote. look carefully at the expression
in the if().
--
brian d foy <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
Comprehensive Perl Archive Network (CPAN) <URL:http://www.perl.com>
Perl Mongers needs volunteers! <URL:http://www.pm.org/to-do.html>
------------------------------
Date: Fri, 28 Aug 1998 12:02:03 -0400
From: John Porter <jdporter@min.net>
Subject: Re: Max value in an array
Message-Id: <35E6D47B.40C4@min.net>
Haijo wrote:
>
> Randal Schwartz (merlyn@stonehenge.com) wrote:
> ++ Yup. map in a void context. Pure Evil.
>
> So are penguins.
What? Penguins are evil? Are you a Linux hater?
Or are you just unhappy with the state of Perl sandbox development?
> Please explain.
DejaNews.
--
John Porter
------------------------------
Date: Fri, 28 Aug 1998 08:59:34 -0700
From: Jonathan Biggar <jon@floorboard.com>
To: I R A Aggie <fl_aggie@thepentagon.com>
Subject: Re: Perl compiler
Message-Id: <35E6D3E6.65D1DAD0@floorboard.com>
I R A Aggie wrote:
>
> In article <6s47h6$4s4@ws051eng.ictest.delcoelect.com>,
> awdorrin@mail.delcoelect.com (Albert W. Dorrington) wrote:
>
> + Oh give me a break! There are many valid reasons for wanting
> + to keep source code hidden from users.
> +
> + Most of the reasons I can think of off the top of my head
> + deal with security issues or support.
>
> Ah, security by obscurity.
>
> James - hint: it ain't secure just 'cause you don't think anyone knows
> about the security hole in your system...
It's easy to throw out that aphorism, even when it doesn't always
apply. I agree that security through obscurity is bad in and of itself,
but when applied as an extra layer on top of a reasoned security
mechanism, it does provide for more security. For example, if a hacker
can't figure out what encryption algorithm you are using, then it makes
his job harder, since he can't exploit any known weaknesses in the
algorithm.
--
Jon Biggar
Floorboard Software
jon@floorboard.com
jon@biggar.org
------------------------------
Date: 28 Aug 1998 17:16:35 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Perl compiler
Message-Id: <6s6olj$2g1$1@client3.news.psi.net>
Bruce Barnett (see.my.address.below@domain.com) wrote on MDCCCXXIII
September MCMXCIII in <URL: news:yeku32xqllw.fsf@grymoire.birch>:
++ abigail@fnx.com (Abigail) writes:
++
++ > If prototyping means distributing and keeping it a secret, yes.
++
++ I guess that you also mean that PERL should not be used for the
++ development of a commercial software package, unlike serious software
++ systems.
No, I don't mean that. But if you mean that "commercial software package"
implies "keeping source a secret", then Perl will be unsuitable for you.
And before you ask. I work for a software company. The pricetags of our
products range from $300k till $6M. But we ship code to any client that
asks for it. All 400 Mb of it.
Abigail
--
sub _'_{$_'_=~s/$a/$_/}map{$$_=$Z++}Y,a..z,A..X;*{($_::_=sprintf+q=%X==>"$A$Y".
"$b$r$T$u")=~s~0~O~g;map+_::_,U=>T=>L=>$Z;$_::_}=*_;sub _{print+/.*::(.*)/s}
*_'_=*{chr($b*$e)};*__=*{chr(1<<$e)};
_::_(r(e(k(c(a(H(__(l(r(e(P(__(r(e(h(t(o(n(a(__(t(us(J())))))))))))))))))))))))
------------------------------
Date: 28 Aug 1998 17:23:44 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Perl compiler
Message-Id: <6s6p30$2g1$2@client3.news.psi.net>
Jonathan Biggar (jon@floorboard.com) wrote on MDCCCXXIII September
MCMXCIII in <URL: news:35E6D3E6.65D1DAD0@floorboard.com>:
++
++ It's easy to throw out that aphorism, even when it doesn't always
++ apply. I agree that security through obscurity is bad in and of itself,
++ but when applied as an extra layer on top of a reasoned security
++ mechanism, it does provide for more security. For example, if a hacker
++ can't figure out what encryption algorithm you are using, then it makes
++ his job harder, since he can't exploit any known weaknesses in the
++ algorithm.
``A fundamental rule of cryptography is that one must assume that the
cryptanalyst knows the general method of encryption used. [ .. ]
The amount of effort necessary to invent, test, and install a new
method every time the old method is compromised or thought to be
compromised has always made it impracitical to keep this secret,
and thinking it is secret when it is not does more harm than good.''
Andrew S. Tanenbaum: "Computer Networks". Prentice-Hall, 1981
pp 389. ISBN 0-13-164699-0.
Abigail
--
sub _'_{$_'_=~s/$a/$_/}map{$$_=$Z++}Y,a..z,A..X;*{($_::_=sprintf+q=%X==>"$A$Y".
"$b$r$T$u")=~s~0~O~g;map+_::_,U=>T=>L=>$Z;$_::_}=*_;sub _{print+/.*::(.*)/s}
*_'_=*{chr($b*$e)};*__=*{chr(1<<$e)};
_::_(r(e(k(c(a(H(__(l(r(e(P(__(r(e(h(t(o(n(a(__(t(us(J())))))))))))))))))))))))
------------------------------
Date: 28 Aug 1998 16:07:44 GMT
From: scott@softbase.com
Subject: Re: Perl Cookbook, does anyone have it?
Message-Id: <35e6d5d0.0@news.new-era.net>
Scott Boss (Scott.Boss@bridge.bellsouth.com) wrote:
> If it (the cookbook) is like the other Orielly Perl Books, I would not
> trade it for it's weight in gold (or silver).
But, you could cash in the metals, buy another copy,
and pocket the profits! Pretty decent profit, too, since
this book is supposed to be in the 700 page range.
Scott
--
Look at Softbase Systems' client/server tools, www.softbase.com
Check out the Essential 97 package for Windows 95 www.skwc.com/essent
All my other cool web pages are available from that site too!
My demo tape, artwork, poetry, The Windows 95 Book FAQ, and more.
------------------------------
Date: Fri, 28 Aug 1998 16:57:55 GMT
From: Aidan Rogers <aidan@salvador.blackstar.co.uk>
Subject: Re: Perl Cookbook, does anyone have it?
Message-Id: <904327048.892016@sparc.tibus.net>
If anyone wants to order the Perl Cookbook, you could order it from
http://www.blackstar.co.uk/
I don't want to sound like I'm advertising here, but the book will be
shipped for free worldwide, and most of our US customers get their orders
within a week. Plus the site is written in Perl (partly by me :)
Aidan
------------------------------
Date: 28 Aug 1998 17:13:23 GMT
From: gebis@fee.ecn.purdue.edu (Michael J Gebis)
Subject: Re: Perl Cookbook, does anyone have it?
Message-Id: <6s6ofj$i57@mozo.cc.purdue.edu>
Scott Boss <Scott.Boss@bridge.bellsouth.com> writes:
}brian d foy wrote:
}> In article <6s29q2$mag$1@nnrp1.dejanews.com>, dturley@pobox.com posted:
}> >checking my amazon order status twice a day!
} Barnes & Noble, Amazon.Com, Walden Books, Borders, etc... has not
}received their shipment from Orielly yet. I have called all of them multiple
}times. I *think* that it will be just days before they get them. Then it
}will take a few days for them to send it out to all their stores (or Mail it
}for Amazon..com).
>From Amazon this morning:
We thought you'd like to know that the following items have been
shipped to:
Michael Gebis
...
------------------------------------------------------------------
Ordered Title Price Shipped Subtotal
------------------------------------------------------------------
1 The Perl Cookbook 31.96 1 31.96
...
--
Mike Gebis gebis@ecn.purdue.edu mgebis@eternal.net
------------------------------
Date: Fri, 28 Aug 1998 13:14:57 -0400
From: Scott Boss <Scott.Boss@bridge.bellsouth.com>
Subject: Re: Perl Cookbook, does anyone have it?
Message-Id: <35E6E590.BB6CA075@bridge.bellsouth.com>
Well I just heard from Amazon that they have shipped all the pre-orders for
"Perl Cookbook" this morning. Their website reflects their statement. So
within a few days I will be a very happy camper.
Scott Boss
------------------------------
Date: Fri, 28 Aug 1998 16:35:56 GMT
From: bolesbr1@memorialmed.com
Subject: problem with substr function
Message-Id: <6s6m9d$oa4$1@nnrp1.dejanews.com>
Hello all,
Here is my problem. I am using the substr function to break up a line of
text into fields and then put that field into an array. My substr commands
expect the line of text to be 132 characters long. The problem is that the
lines vary in length, but none longer than 132 characters. This screws up my
array because I need to have a value stored in the array. This is what I
have now:
push @array, (split ' ', substr ($line, 105, 12);
In this example, this works fine as long as $line is at least 117 characters,
but if it is only 100 characters @array doesn't get anything pushed into it.
I would like @array to get a value of "0" or at least undef if $line is
shorter than 105 characters. Any suggestion would be greatly appreciated!
TIA!
[\/][\/][\/][\/][\/][\/][\/][\/][\/][\/][\/][\/][\/][\/][\/][\/][\/][\/]
[\/]Brandon Boles [\/] The expressed opinion's are[\/]
[\/]Systems Administrator [\/] entirely my own, not of my[\/]
[\/]Memorial Medical Center [\/] employer or any of its[\/]
[\/]bolesbr1@memorialmed.com [\/] affiliations.[\/]
[\/][\/][\/][\/][\/][\/][\/][\/][\/][\/][\/][\/][\/][\/][\/][\/][\/][\/]
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
------------------------------
Date: Fri, 28 Aug 1998 17:06:14 GMT
From: passion@freemail.nl (fred)
Subject: Reading a line from a file
Message-Id: <35e6e2c6.1979466@news.Leiden.NL.net>
Hello,
I have a large ascii database file. Every line is related to a record.
In fact: each line IS a record. So a record-number refers to a
line-number in that file. The file is about 4 mb large.
I want to create a Perl search interface to the database file.
Of course I can use the open(FILE..) command, and read every line,
until I reach the one I'm looking for.
The question is:
Is it possible to extract a line-number directly from the file? That
way my interface will work much faster. Maybe there are other
suggestions too?
TIA,
fred
------------------------------
Date: 28 Aug 1998 16:18:29 GMT
From: aajii@d85c.lanhovi.ton.tut.fi (Antti-Jussi Korjonen)
Subject: removing ^M when writing to file
Message-Id: <6s6l8l$5d0$1@baker.cc.tut.fi>
I get the output from a device and it's like the output below. My problem
are the ^M's. How can I get rid of them?
I write the output to a file and when I read that output from the file
and then write it back to a file. When I take a look at the file, I notice
that the text tends to move rightwards more and more every time when I
read and write it back to a file.
SYSTEM DISPLAY
DATE=28/08/98 TIME=18:51
-------------------------------------------------------------------------------
CPX-108/116 VERSION 3.19 BUFFERS=471 EPROM
PORTS=16 ACTIVE PORTS=0 SWITCH 2=28 SWITCH 3=20
1.LOGON BANNER=fsdafdsafsd
2.LOCAL ADDR= 3.EXPAND=N 4.PKT SIZE=128
5.TELENET=N 6.NBLK=N 7.MPAD=N
8.ABV=N 9.REMOTE LOGON=N 10.USER PROMPT=
11.DIAG WINDOW=2 12.CLR/CLR-CNF=N 13.P5 LOCK=N
14.PORT PASSWORDS=N 15.REMOTE PASSWORD=N 16.DIAG CUG=OFF
17.NMS CUG=OFF 18.RESERVED 21.LOCAL ADDR DEL=N
19.SECURITY LOGON BANNER =enter nui:
20.SECURITY PASSWD BANNER=enter password:
22.SUBADDRESS MATCH TO PHYSICAL PORT=N
--
__/ __/ __/ __/ Antti-Jussi Korjonen
__/ __/ __/ __/ __/__/ Vaajakatu 5 D 85
__/ __/ __/ __/ __/__/ 33720 TAMPERE, FINLAND
__/ __/ __/__/__/ __/ __/ tel. +358-(0)40-577 83 23
Antti-Jussi.Korjonen@sonera.fi
--------->> http://www.students.tut.fi/~k150556 <<---------
------------------------------
Date: Fri, 28 Aug 1998 11:23:04 -0500
From: "Jonathan A. Laub" <lakesoft@skypoint.com>
Subject: session id
Message-Id: <6s6ln2$44v$1@shadow.skypoint.net>
i need to create a uniquely-named file for use with a clipper polling app.
how does one obtain the "session id" for use in a perl script?
Thanks,
Jonathan
------------------------------
Date: Fri, 28 Aug 1998 17:26:39 GMT
From: maurice@hevanet.com (Maurice Aubrey)
Subject: Re: session id
Message-Id: <slrn6udq2g.ju.maurice@we-24-130-48-83.we.mediaone.net>
On Fri, 28 Aug 1998 11:23:04 -0500, Jonathan A. Laub <lakesoft@skypoint.com>
wrote:
>i need to create a uniquely-named file for use with a clipper polling app.
>
>how does one obtain the "session id" for use in a perl script?
I have no idea what you mean by a "session id". But if you want
the process id, it's stored in $$
HTH,
--
Maurice Aubrey <maurice@hevanet.com>
A society that does not recognize that each individual has values of
his own which he is entitled to follow can have no respect for the
dignity of the individual and cannot really know freedom.
- F.A. Hayek
------------------------------
Date: Fri, 28 Aug 1998 13:36:06 -0400
From: Peter Smith <psmith01@mindspring.com>
Subject: Re: Trouble with getc()...
Message-Id: <35E6EA86.53E550B3@mindspring.com>
hmmm...I'll try it. Thanks.
In the meantime, I'm running with reading entire lines (records) and using
substr():
while(<>)
$my_field = substr($_,$offset,$length);
//etc.
Mark-Jason Dominus wrote:
> In article <35E6BB41.18C57DEF@mindspring.com>,
> Peter Smith <psmith01@mindspring.com> wrote:
> >I usually manage to get about 143 out of 444 characters (bytes) in the
> >file. Any ideas?
>
> Perhaps use
>
> binmode IN;
>
> after you open IN and before you start reading?
--
--Peter--
psmith01@mindspring.com
------------------------------
Date: Fri, 28 Aug 1998 12:52:04 -0400
From: John Porter <jdporter@min.net>
Subject: Re: typeglobs and references... (re: Prog Perl, p 117)
Message-Id: <35E6E034.3CC1@min.net>
Benjamin Low wrote:
>
> Is there any way of determining what a typeglob aliases to, when it is
> used as a glob for a reference?
>
> Prog Perl, 2nd ed. p117 has an example of a typeglob used to do "symbol
> table aliasing":
>
> (*a, *b) = func(\@c, \@d);
>
> sub func
> {
> local (*e, *f) = @_;
> # stuff done with @e and @f, (\@e, \@f) returned
> }
>
> In the example func assumes you're passing it refs to arrays, how can I
> tell just what *e and *f "alias" to? (Say I want to different things
> depending on whether you pass an array, scalar, etc). I note that I can
> say
>
> defined($e) && print "scalar ref";
> defined(@e) && print "array ref"; # etc
>
> is this the only/best way? Or is there some way of using the ref
> operator to figure it out? ref(*e) doesn't seem to do anything.
The only way passing typeglobs works, is because you already know
what you want from each typeglob. That's because a typeglob
represents the entire symbol table entry for all variables with
that name: *a refers to $a, @a, %a, a-the-filehandle, a-the-format, etc.
You are free to use any or all of these as you see fit.
So if, as you say you're doing -- you assume that you only care about
the arrays in the typeglobs, you're doing all you can, and probably
all you need to do.
Of course, passing references is usually better then passing typeglobs,
because, among other things, you can test the 'type' directly:
func( \@c, \@d );
sub func {
my( $r1, $r2 ) = @_;
if ( ref($r1) eq 'ARRAY' ) {
...
hth,
--
John Porter
------------------------------
Date: Fri, 28 Aug 1998 12:40:54 -0400
From: John Porter <jdporter@min.net>
Subject: Re: use vars and my, have I got it right?
Message-Id: <35E6DD96.69CC@min.net>
Benjamin Low wrote:
>
> I'm trying to fully understand the point/use of the use vars pragma and
> the my statement. This is what I understand them to be:
>
> use vars predeclares the quoted "strings literals" as global variables,
> visible from all modules, etc. It doesn't actually create these
> variables (this fits in with my concept of 'use' being a compiler
> directive). i.e. it's a compile-time thing (a bit like extern in C?).
You don't care about when the variables are created.
In perl, they're created when they're first used, even if that
happens to be something other than an assignment.
However, it can be important is that use vars qw( @foo ) counts
as a usage of the variable, creating the symbol table entry.
> my is pretty much the same, except its scope is only to the enclosing
> block, etc. and it *does* create the variable/s. i.e. it's a
> compile-time declaration and run-time creation thing.
my is not really the same at all.
Lexical variables are very different from global ('package') variables.
Yes, they're lexically scoped, of course, but they also do not
exist in any symbol table.
--
John Porter
------------------------------
Date: Fri, 28 Aug 1998 11:13:10 -0500
From: "Clarence Washington Jr." <cwashing@ix.netcom.com>
Subject: Web Site Devoted Scripting Under Win32
Message-Id: <6s6krd$a0q$1@farragut.paranet.com>
Win32bit Scripting has moved. We are now at http://cwashington.netreach.net
Please update you links.
Thanks guys for those who have submitted scripts.
We currently are looking for some NT admin scripts. Small scripts that
illustrate how to add users and such. Nothing that will give away the farm.
The site's sole purpose is to teach and enlighten people to all of the
scripting possibilities for Windows 32bit Operating Systems. No monies are
earned directly or indirectly from the site.
If you haven't been out there yet, take a look. We have lots of sample
scripts in vbscript, jscript, perl, python, kixtart, and the nt command
line. Lots of referrence material and technical support via an online
discussion forum. Check it out.
--
Check it out
http://cwashington.netreach.net
Win32 bit scripting, lots of sample scripts, downloads,
referrence files, and technical support via an online discussion forum.
------------------------------
Date: Fri, 28 Aug 1998 12:08:16 -0400
From: comdog@computerdog.com (brian d foy)
Subject: Re: Why do these two differ?
Message-Id: <comdog-ya02408000R2808981208160001@news.panix.com>
Keywords: from just another new york perl hacker
In article <8cvhndcdf5.fsf@gadget.cscaper.com>, Randal Schwartz <merlyn@stonehenge.com> posted:
>>>>>> "Dan" == Dan Nguyen <nguyend7@msu.edu> writes:
>
>Dan> : #!/usr/bin/perl
>Dan> : $length = (0,1,2,3,4,5,6);
>Dan> : print $length ."\n";
>
>Dan> it prints 6 because it grabs the last scalar value
>Dan> try $length = scalar (0,1,2,3,4,5,6);
>
>Why? That's exactly the same thing. :)
>
>Or was that your point?
hmmm...
#!/usr/bin/perl
$length = (0,1,2,3,4,5,'foo!');
print $length ."\n";
$length = scalar (0,1,2,3,4,5,'foo!');
print $length ."\n";
__END__
'foo!'
'foo!'
remember, lists are not arrays!
--
brian d foy <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
Comprehensive Perl Archive Network (CPAN) <URL:http://www.perl.com>
Perl Mongers needs volunteers! <URL:http://www.pm.org/to-do.html>
------------------------------
Date: Fri, 28 Aug 1998 12:33:57 -0400
From: John Porter <jdporter@min.net>
Subject: Re: Why do these two differ?
Message-Id: <35E6DBF5.39F3@min.net>
Steven L. Reid wrote:
>
Say it right, Steven, or don't say it at all. Precision counts.
> fremont@ix.netcom.com wrote in message
> > $length = (0,1,2,3,4,5,6);
> > print $length ."\n";
>
> Setting a scalar to a list...
This isn't "setting a scalar to a list".
This is an example of the C-style comma operator.
To say it's a list implies that an actual list is created
(in transient storage), and the values put into it, only
to have the last one kept. But this is not what happens.
There is no list.
> >@array = (0,1,2,3,4,5,6);
> >$length = @array;
> >print $length ."\n";
>
> Here, interpreting a list in a scalar context causes it to return
> its size (in this case 7).
This is not a list, this is an array.
They are not the same.
Usually it's better to quote from the docs, where this is already
explained very lucidly.
--
John Porter
------------------------------
Date: 28 Aug 1998 16:32:59 GMT
From: psk@euclid.jpl.nasa.gov (Peter Scott)
Subject: Re: why no true/false keywords?
Message-Id: <6s6m3r$fhi@netline.jpl.nasa.gov>
Greg Bacon (gbacon@itsc.uah.edu) wrote in article <6s4ao3$j0f$5@info.uah.edu>:
> That locks &some_check_sub into only being useful in scalar context
> because
>
> @vals = some_check_sub;
> if (@vals) {
> ...;
> }
>
> will break when it returns FALSE. Simple, unadorned C<return> is very
> useful for this type of thing.
So couldn't they just use C<wantarray>:
if (condition) {
return wantarray ? () : FALSE;
}
--
This is news. This is your | Peter Scott, NASA/JPL/Caltech
brain on news. Any questions? | (psk@euclid.jpl.nasa.gov)
Disclaimer: These comments are the personal opinions of the author, and
have not been adopted, authorized, ratified, or approved by JPL.
------------------------------
Date: Fri, 28 Aug 1998 17:17:59 GMT
From: aleyva@erols.com (Angel Leyva)
Subject: Windows95, Perl, PWS (IIS)
Message-Id: <35e7e59a.10522349@news.erols.com>
Can someone please point me to any article at any location that
explains how to setup Perl to work for cgi on a windows 95 machine
running Personal Web Server.
I want to develop here and later upload the code to an NT4 Server that
is already setup to run perl.
I have Article ID: Q150629 (Configuring and Testing PERL Scripts with
IIS, but am not sure if windows95 and PWS is configured the same way.
Thanx in advance
Angel
------------------------------
Date: 28 Aug 1998 17:48:06 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Y2K Date Support
Message-Id: <6s6qgm$2g1$4@client3.news.psi.net>
Patrick Timmins (ptimmins@netserv.unmc.edu) wrote on MDCCCXXIII September
MCMXCIII in <URL: news:6s6h28$h2p$1@nnrp1.dejanews.com>:
++
++ How is it a problem with time_t (not that I am at all familiar with time_t)?
++ On a 32 bit system in early 2038, the number of seconds since Jan 1, 1970
++ will reach 2**31. A 32 bit CPU, bus, etc will not be able to work with
++ anything larger. How is this a software problem, as opposed to a hardware
++ problem?
Hmmm. Have you ever worked with a string containing more than 4 characters?
Did it fit on the bus?
Abigail
--
perl -wle\$_=\<\<EOT\;y/\\n/\ /\;print\; -eJust -eanother -ePerl -eHacker -eEOT
------------------------------
Date: 12 Jul 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 Mar 98)
Message-Id: <null>
Administrivia:
Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.
If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu.
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 3576
**************************************