[8227] in Perl-Users-Digest
Perl-Users Digest, Issue: 1845 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Feb 10 10:27:29 1998
Date: Tue, 10 Feb 98 07:00:31 -0800
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, 10 Feb 1998 Volume: 8 Number: 1845
Today's topics:
ARP protocol in perl? <mrbulli@cyber1.servtech.com>
Re: Basic question (123) <dformosa@st.nepean.uws.edu.au>
C structures mapping into PERL <waldekg@uhc.lublin.pl>
Re: Debuggin Tips for beginners (w/o shell) <muse@harlech.ac.uk>
debugging perl script <IDSamson@Beauty.HSRC.ac.za>
Re: Forgery => Killfile <tchrist@mox.perl.com>
Re: garbage collection in perl <oboyle@csociety.ecn.purdue.edu>
Re: Happy with Perl? <nwi-tech@dircon.net>
Re: Happy with Perl? <ebohlman@netcom.com>
Help needed: pattern matching with * as a wildcard (Sylvain Juneau)
Re: Is Perl 5 year 2000 compliant? <dformosa@st.nepean.uws.edu.au>
Re: Linux <tchrist@mox.perl.com>
Re: New Perl book reviews <tchrist@mox.perl.com>
Perl HTML output in Win 95 (InterVisors)
Re: Perl HTML output in Win 95 (Jack Straw)
Re: Perl HTML output in Win 95 (InterVisors)
Re: Perl HTML output in Win 95 (InterVisors)
Re: Perl HTML output in Win 95 (InterVisors)
Re: Perl HTML output in Win 95 (Jack Straw)
Perl lessons / Hong Kong <noemail@noemail.com>
Perl lessons Hong Kong <noemail@noemail.com>
Re: reading in a file to an associative array <merlyn@stonehenge.com>
Re: reading in a file to an associative array (Clay Irving)
Re: returning the date <jdporter@min.net>
Re: Sharing variables between scripts (Jack Ostroff)
Re: Sharing variables between scripts <banman@execpc.com>
substitution/expression (Thomas A. Loser)
Summary Q: Using unpack or split to get fixed-length su <Morten.Andersen@molbio.uu.se>
Re: Syntax-coloring editor for NT geoff@elj.com
Re: Unpack float <dformosa@st.nepean.uws.edu.au>
Re: use of regex in INDEX (Lars Gregersen)
Re: Year 2000 Compliance: Lawyers, Liars, and Perl <camerond@mail.uca.edu>
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 10 Feb 1998 13:50:44 GMT
From: Thomas Bullinger <mrbulli@cyber1.servtech.com>
Subject: ARP protocol in perl?
Message-Id: <6bplvk$fpj$1@post.servtech.com>
Keywords: ARP perl implementation
Before I go ahead and try to re-invent the wheel - has anyone (heard of or
written) a perl implementation of the ARP protocol? What I need is
basically a way to determine an Ethernet address from an IP address (using
the ARP protocol, no NIS/YP lookups!!!).
---______ __ <---- Thomas Bullinger ----- mrbulli@btoy1.rochester.ny.us -->
' / '/ ) mrbulli@servtech.com - bulli@fangz.com - bulli@ag01.kodak.com
/ /--< 76535.2221@compuserve.com FAX: +1-716-377-6732 (2-3am)
(_/ /___/ WWW: http://btoy1-gw.roc.servtech.com/users/mrbulli
------------------------------
Date: 10 Feb 1998 11:57:04 GMT
From: ? the platypus {aka David Formosa} <dformosa@st.nepean.uws.edu.au>
Subject: Re: Basic question (123)
Message-Id: <887111784.171924@cabal>
In <34DEA8F8.68D0A6EC@coos.dartmouth.edu> Chipmunk <rjk@coos.dartmouth.edu> writes:
[...]
>No, the standard input goes to whereever you put it. Many
>operations, including the input operator <>, default to
>using $_.
<> only defaults to $_ inside while(<>).
--
Please excuse my spelling as I suffer from agraphia see the url in my header.
Never trust a country with more peaple then sheep.
Support NoCeM http://www.cm.org/
I'm sorry but I just don't consider 'because its yucky' a convincing argument
------------------------------
Date: Tue, 10 Feb 1998 11:13:16 +0100
From: =?ISO-8859-2?Q?Waldek_Grudzie=F1?= <waldekg@uhc.lublin.pl>
Subject: C structures mapping into PERL
Message-Id: <Pine.HPP.3.96.980210110721.3238D-100000@clinicom.uhc.lublin.pl>
Does anyone know where I can find examples of C structures mapping into
PERL structure (to use in C functions wrote in XSUB)
I would like to map e.g. structure :
struct test {
char id[20];
char name[50];
struct test *next;
}
to list of hash tables :
%test = ( 'id' => '...',
'name' => '...')
Thanks,
Waldek Grudzien
///////////////////////////////////////////
// http://www.uhc.lublin.pl/~waldekg/ //
// Lublin/Lubartow, Poland //
\\ University Health Care \\
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
------------------------------
Date: Fri, 06 Feb 1998 13:38:18 -0800
From: MUSE <muse@harlech.ac.uk>
Subject: Re: Debuggin Tips for beginners (w/o shell)
Message-Id: <34DB82CA.1800@harlech.ac.uk>
Here is another type from a beginner.
To test your scripts, get a server on your stand alone machine. I use
SAMBAR Server which lets me test all the environment bits.
------------------------------
Date: Tue, 10 Feb 1998 12:00:42 +0200
From: "Ian Samson" <IDSamson@Beauty.HSRC.ac.za>
Subject: debugging perl script
Message-Id: <6bp8fi$1mkq@ludwig.HSRC.ac.za>
Hi. I have a rather long (271 lines) script to mail questionnaire results.
Each time I test it in the browser, I get a message that says "The server
returned an invalid or unrecognized response". How do I find out which line
is causing the error?
Thanks.
--
Ian Samson
Internet Systems Development, Human Sciences Research Council, Pretoria,
South Africa
IDSamson@Beauty.HSRC.ac.za http://www.hsrc.ac.za/
------------------------------
Date: 10 Feb 1998 14:47:24 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Forgery => Killfile
Message-Id: <6bpp9s$35k$3@csnews.cs.colorado.edu>
In comp.lang.perl.misc, Eli the Bearded <*@qz.to> writes:
:> People who forge their return address will not receive my
:> help. In fact, you will be killfiled. I'm not going to
:
:Suit yourself, but we didn't need to know.
That's your opinion. I believe people unwittingly engaged in antisocial
behaviour deserve to be informed. If they choose to continue once they
have learned of this, I don't care.
--tom
--
Tom Christiansen tchrist@jhereg.perl.com
stab_val(stab)->str_nok = 1; /* what a wonderful hack! */
--Larry Wall in stab.c from the perl source code
------------------------------
Date: 10 Feb 1998 14:39:53 GMT
From: Todd O'Boyle <oboyle@csociety.ecn.purdue.edu>
Subject: Re: garbage collection in perl
Message-Id: <6bporp$dsi@mozo.cc.purdue.edu>
[ courtesy copy cc'ed to mikedoug@texas.net and posted ]
Michael Douglass <mikedoug@texas.net> contributed:
> I've searched the web and I've searched the news groups... Does anyone
> have any information on the garbage collection under perl? Is it
> done automatically as you release variables? Or does it que them up
> for a while before taking care of them. I ask because I have a fairly
> busy program I wrote using perl that does quite a bit with hashes...
> The memory footprint grows to about 50MB with about half of that
> resident at all time. I find it terribly hard to believe that my
> data is taking up that much space in reality; this doesn't say much
> about perl's memory management.
Perl uses reference counts to do garbage collection.
>From perlguts:
Perl uses an reference count-driven garbage collection
mechanism. SVs, AVs, or HVs (xV for short in the following)
start their life with a reference count of 1. If the
reference count of an xV ever drops to 0, then it will be
destroyed and its memory made available for reuse.
This normally doesn't happen at the Perl level unless a
variable is undef'ed or the last variable holding a
reference to it is changed or overwritten. At the internal
level, however, reference counts can be manipulated with the
following macros:
int SvREFCNT(SV* sv);
SV* SvREFCNT_inc(SV* sv);
void SvREFCNT_dec(SV* sv);
cheers,
-Todd
--
Key: ftp://csociety.ecn.purdue.edu/pub/oboyle/oboyle.asc
Fingerprint: DA 83 ED B0 48 79 F4 5D B2 4D B0 B7 F1 A3 C1 49
Location: 86 54' 29" W / 40 25' 33" N
------------------------------
Date: 10 Feb 98 10:58:37 GMT
From: "nwi-tech" <nwi-tech@dircon.net>
Subject: Re: Happy with Perl?
Message-Id: <01bd3613$2e469ca0$ea3670c2@lwnvf>
> > >is perl stable? would it be a good idea to risk millions of pounds on
> > >something that is unsupported? what do you think?
> > >
> >
> > Unsupported ? UNSUPPORTED ??? What the @##@!% do you think the
people in
> > this newsgroup are doing ? Sheesh, the nerve of some people... :-)
if i wrote a program in perl which backed up $100 million worth of dealing
information, and that program failed because of a bug in the perl source,
my company would not be able to sue anyone, and other than perlclinic
(found them now), i would have only you lot to ask advice of. with
respect, you do not have any obligation to help me, and might even provide
inaccurate advice given that the situation i would be in where we would be
losing $60,000 an hour is one that is easy to misinterpret given its
complexity.
please don't reply to this mail, i just thought i'd let you know comments
like
> > Unsupported ? UNSUPPORTED ??? What the @##@!% do you think the
people in
> > this newsgroup are doing ? Sheesh, the nerve of some people... :-)
are unwelcome on the whole. it was only a simple question. net bods bite
too many peoples heads off about simple things.
------------------------------
Date: Tue, 10 Feb 1998 12:09:58 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: Happy with Perl?
Message-Id: <ebohlmanEo5wGn.B18@netcom.com>
nwi-tech <nwi-tech@dircon.net> wrote:
: if i wrote a program in perl which backed up $100 million worth of dealing
: information, and that program failed because of a bug in the perl source,
: my company would not be able to sue anyone, and other than perlclinic
: (found them now), i would have only you lot to ask advice of. with
: respect, you do not have any obligation to help me, and might even provide
: inaccurate advice given that the situation i would be in where we would be
: losing $60,000 an hour is one that is easy to misinterpret given its
: complexity.
Of course, if you wrote your program in some other language, and a bug in
a commercial compiler caused it to fail, the company that sold the
compiler would undoubtedly point to language in its licensing agreement
to the effect that the company was not responsible for consequential
damages. It's unlikely that you'd be able to recover anything more than
what you paid for the compiler, if that.
------------------------------
Date: Tue, 10 Feb 1998 14:32:15 GMT
From: sjuneau@microtec.net (Sylvain Juneau)
Subject: Help needed: pattern matching with * as a wildcard
Message-Id: <34e06451.8536380@news.cmc.ec.gc.ca>
I have a file :
emask A700*P
imask *P dbim 2 Y food/cis dbadd
imask *C dbim 2 Y food/cis dbadd
I have another file. I open that file and I want to search in it:
A700*P where I want to have * to be a wildcard so that it can have
any value (abcdef.....12345....)
then I would like same for *P and *C.
My question is how do I search through this file using a wildcard?
I assume you use a pattern matching but how???
Thank you very much
Sylvain
e-mail sjuneau@microtec.net
------------------------------
Date: Tue, 10 Feb 1998 21:36:12 +1100
From: ? the Platypus {aka David Formosa} <dformosa@st.nepean.uws.edu.au>
Subject: Re: Is Perl 5 year 2000 compliant?
Message-Id: <Pine.LNX.3.93.980210213024.143B-100000@shirley>
On Mon, 9 Feb 1998, Tom Phoenix wrote:
> On 9 Feb 1998, ? the platypus {aka David Formosa} wrote:
[...]
> > A suggestion if you make a RTFM type reply why don't
> > you set the message id to <rtfm.orginal-message-id> so only one reply
> > will ever occour on the same newspool.
> The people in a newsgroup about Usenet itself can give you a lot of
> reasons why that would be a Bad Thing to do.
This suggestion (wich was not totaly serious) is a parody of the $alzs
convention of <cancel.orginal-message-id> which prevents multipal cancels
to the same post being on the same spool.
This dose not do anything negitive to the system.
> But if a thread seems too repetitive to you, just kill the thread in
> your newsreader.
Which I do.
- --
Please excuse my spelling as I suffer from agraphia see the url in my header.
Never trust a country with more peaple then sheep. ex-net.scum and proud
You Say To People "Throw Off Your Chains" And They Make New Chains For
Themselves? --Terry Pratchett.
Version: 2.6.3i
Charset: noconv
iQCVAwUBNOAtpKQK0ynCmdStAQFcBAP+L3Rilv3vTlyDsnk7VK/TLpK0vXsza6S2
Ic1Js2IWAVzTEUhZsJbQISto1QnolWHpFGIhegLUanMAiXgUa98mLD+gF0s2ilQm
Dfea0Ka5IO+FSV0mTETE1QD1+xQ2T5nNIUwgLxq8Br18L+MGpWV9oQn6Tf4V9UqD
8tRPwUzHkjY=
=HLFC
-----END PGP SIGNATURE-----
------------------------------
Date: 10 Feb 1998 14:43:48 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Linux
Message-Id: <6bpp34$35k$2@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc, cowboy@cnnw.net (James L. Taylor) writes:
:I'm new to perl and I have been reading the news group here for a
:couple weeks and I have been noticing that alot of people talk about
:perl editors so they can do their work off line....
What does "do work offline" mean? If I get one more person
who asks me whether they can use "perl offline", I'm either
going to hand them a pad of paper with a pencil, or else
terminate their AOL accounts.
--tom
--
Tom Christiansen tchrist@jhereg.perl.com
"It's easier to make up sayings people like to hear than sayings they
like to heed."
--Larry Wall
------------------------------
Date: 10 Feb 1998 14:37:49 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: New Perl book reviews
Message-Id: <6bpont$35k$1@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc, petdance@maxx.mc.net (Andy Lester) writes:
:I've put up a page of Perl book reviews.
You should link to the other lists?
http://language.perl.com/critiques/index.html
Why don't you link to perl.com?
http://www.perl.com/
Why don't you reference the standard port for Windows victims?
http://www.perl.com/ports/win32/Standard/
--tom
--
Tom Christiansen tchrist@jhereg.perl.com
I think I'm likely to be certified before Perl is... :-)
--Larry Wall in <1995Feb12.061604.6008@netlabs.com>
------------------------------
Date: Tue, 10 Feb 1998 13:11:50 GMT
From: intervisors@nospam.intervisors.nl (InterVisors)
Subject: Perl HTML output in Win 95
Message-Id: <34e05098.3394921@194.109.6.91>
Hi there,
I've been programming in Perl under Unix for quite some time. To save
communication costs to our server from Home and for speed I decided to
install the Microsoft Personal Web server 4 and the latest build of
Perl for win 32 on my windows 95 machine. Perl works fine from a dos
prompt.
Unfortunatly when I run a local perl script from a local html page the
HTML source code flashes by in a dos box but doesnt get ported to
Netscape, the browser from which the perl script was launched in the
first place.
Anybody know how to get the perl script to output back to the browser?
Thanks,
Luke
Here is a part of my script:
#!c:/internet/perl/bin/perl
print "Content-type: text/html\n\n";
print "<HTML><HEADER><TITLE>test page</TITLE></HEADER>";
------------------------------
Date: Tue, 10 Feb 1998 13:43:47 GMT
From: jackstraw@notachance.net (Jack Straw)
Subject: Re: Perl HTML output in Win 95
Message-Id: <34e158b0.6495576@news.erols.com>
I ended up running a HTTP server daemon on my machine and then asking
for http://127.0.0.1 in my browser. This gives me both client
(Netscape, etc.) and server (Fnord!). The server must have the
cdi-bin directory marked as a cgi dir so that the output you saw flash
by in the dos box will instead be piped to your browser by your
server.
You can get Fnord! as well as some other freeware servers at TUCOWS.
http://www.tucows.com Just look under server daemons and then under
HTTP. Don't be intimidated. I never did this before last week and it
turned out to be very easy.
InterVisors in <34e05098.3394921@194.109.6.91>:
;Hi there,
;
;I've been programming in Perl under Unix for quite some time. To save
;communication costs to our server from Home and for speed I decided to
;install the Microsoft Personal Web server 4 and the latest build of
;Perl for win 32 on my windows 95 machine. Perl works fine from a dos
;prompt.
;
;Unfortunatly when I run a local perl script from a local html page the
;HTML source code flashes by in a dos box but doesnt get ported to
;Netscape, the browser from which the perl script was launched in the
;first place.
;
;Anybody know how to get the perl script to output back to the browser?
;
;Thanks,
;
;Luke
;
;Here is a part of my script:
;
;#!c:/internet/perl/bin/perl
;
;print "Content-type: text/html\n\n";
;print "<HTML><HEADER><TITLE>test page</TITLE></HEADER>";
+;+;+;
Jack Straw <wnpxfgenj naba rstn bet> KeyID:0x3D561045
Get & learn PGP -> http://www.pgp.com
------------------------------
Date: Tue, 10 Feb 1998 13:53:14 GMT
From: intervisors@nospam.intervisors.nl (InterVisors)
Subject: Re: Perl HTML output in Win 95
Message-Id: <34e05986.5682227@194.109.6.91>
I tried running the script from the Personal Webserver and now I have
the following two erros:
1. The PWS 4 does not like it when I try to run the script with the
POST method. "Illegal method blah blah" is the result.
2. The CGI-bin gives a 500 error when I do use the GET method.
I suppose there is something wrong with the location of perl in the
file header, or PWS 4 is executing the perl script wrong, or it could
be the way I'm using the script to print HTML.
The perl file starts with:
#!c:/internet/perl/bin/perl
The html is printed after:
print "Content-type: text/html\n\n";
print "<HTML><HEADER><TITLE>
Do I have to tell the PWS 4 where and how to use perl scripts?
All help is welcome,
Thanks,
Luke
------------------------------
Date: Tue, 10 Feb 1998 14:39:06 GMT
From: intervisors@nospam.intervisors.nl (InterVisors)
Subject: Re: Perl HTML output in Win 95
Message-Id: <34e065fd.8872908@194.109.6.91>
It seemt that the Personal Web Server 4 isn't accessing Perl corectly.
Is there a way to do this? Mime types etc?
I think I'm asking the question in the wrong newsgroup.
Still I hope someone can help me out. Otherwise, is there a site or
newsgroup that explaines using the win32 perl and the PWS 4?
Thanks,
Luke
------------------------------
Date: Tue, 10 Feb 1998 14:40:42 GMT
From: intervisors@nospam.intervisors.nl (InterVisors)
Subject: Re: Perl HTML output in Win 95
Message-Id: <34e066a6.9042033@194.109.6.91>
Thanks Jack,
Unfortunatly I need the PWS 4 because of its MS Frontpage 98
extensions. I know that PWS 4 should be able to do the trick too.
Thanks again,
Luke
------------------------------
Date: Tue, 10 Feb 1998 14:49:50 GMT
From: jackstraw@notachance.net (Jack Straw)
Subject: Re: Perl HTML output in Win 95
Message-Id: <34e1690c.581474@news.erols.com>
InterVisors in <34e05986.5682227@194.109.6.91>:
;I tried running the script from the Personal Webserver and now I have
;the following two erros:
;
;1. The PWS 4 does not like it when I try to run the script with the
;POST method. "Illegal method blah blah" is the result.
;
;2. The CGI-bin gives a 500 error when I do use the GET method.
;I suppose there is something wrong with the location of perl in the
;file header, or PWS 4 is executing the perl script wrong, or it could
;be the way I'm using the script to print HTML.
;
;Do I have to tell the PWS 4 where and how to use perl scripts?
;
Yes. In my server, when I set up paths/permissions there are four
types of dirs: normal, CGI, ISAPI and redirect. I chose CGI for my
/cgi-bin dir - that's why the server repipes Perl output to the
client.
You will find more and better help at
news://comp.infosystems.www.servers.ms-windows
+;+;+;
Jack Straw <wnpxfgenj naba rstn bet> KeyID:0x3D561045
Get & learn PGP -> http://www.pgp.com
------------------------------
Date: Tue, 10 Feb 1998 18:36:50 +0800
From: Noemail <noemail@noemail.com>
Subject: Perl lessons / Hong Kong
Message-Id: <34E02DC2.722B@noemail.com>
I would like to take private lessons in Perl and C programming (advanced
programming - I know the basics). I am situated in Hong Kong.
If anyone can provide this service please email me a fee proposal.
My tel is (852) 9460-1130.
Regards
Jean-Yves Sireau
------------------------------
Date: Tue, 10 Feb 1998 18:37:50 +0800
From: Noemail <noemail@noemail.com>
Subject: Perl lessons Hong Kong
Message-Id: <34E02DFE.28DB@noemail.com>
I would like to take private lessons in Perl and C programming (advanced
programming - I know the basics). I am situated in Hong Kong.
If anyone can provide this service please email me a fee proposal.
My tel is (852) 9460-1130.
Regards
Jean-Yves Sireau
jys -at- hk.super.net
(replace -at- with @ please)
------------------------------
Date: 10 Feb 1998 05:34:36 -0700
From: Randal Schwartz <merlyn@stonehenge.com>
To: Brian Charles <charlesb@ccmail.orst.edu>
Subject: Re: reading in a file to an associative array
Message-Id: <8cpvkvk59f.fsf@gadget.cscaper.com>
>>>>> "Brian" == Brian Charles <charlesb@ccmail.orst.edu> writes:
Brian> Hi,
Brian> I have a file with name and email separated by a '|'
Brian> I want to use a while loop to read it in as an associative array, the
Brian> name being the key and email the value. How do I do that? I'm used to
Brian> just scalar variables.
You mean "hash". They haven't been called "associative arrays" for
four years now.
Here's a very short version:
open IN, "myfile" or die "Cannot open myfile: $!";
my %email = map /^(.*?)\|(.*)/, <IN>;
close IN;
For a longer version, wait for some other post. :)
print "Just another Perl hacker," # but not what the media calls "hacker!" :-)
## legal fund: $20,990.69 collected, $186,159.85 spent; just 203 more days
## before I go to *prison* for 90 days; email fund@stonehenge.com for details
--
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@teleport.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me
------------------------------
Date: 10 Feb 1998 08:47:28 -0500
From: clay@panix.com (Clay Irving)
Subject: Re: reading in a file to an associative array
Message-Id: <6bplpg$5bn@panix.com>
In <34dfe94b.524144494f47414741@radiogaga.harz.de> martin@RADIOGAGA.HARZ.DE (Martin Vorlaender) writes:
>Brian Charles (charlesb@ccmail.orst.edu) wrote:
>: I have a file with name and email separated by a '|'
>: I want to use a while loop to read it in as an associative array, the
>: name being the key and email the value. How do I do that? I'm used to
>: just scalar variables.
>my %hash;
>while (<FILE>)
>{
> my ($name,$email) = split /|/, $_, 2;
my ($name,$email) = split /\|/, $_, 2; # backwhack the |
> $hash{$name} = $email;
>}
--
Clay Irving <clay@panix.com> I think, therefore I am. I think?
http://www.panix.com/~clay/
------------------------------
Date: Tue, 10 Feb 1998 09:21:18 -0500
From: John Porter <jdporter@min.net>
Subject: Re: returning the date
Message-Id: <34E0625E.72CE@min.net>
Tom Christiansen wrote:
>
> In comp.lang.perl.misc,
> Wolfgang Denk <wd@denx.muc.de> writes:
> :How about 1998-04-23 then? At least this can be easily used to sort
> :the names in chronological order...
>
> The problem, my dear Wolfgang, is that some of us don't automatically
> intuit 1998-03-04 or 03-04-1998 to be in either March or April. More
> specifically, you have your idea, but most of the net has another. :-)
>
> PS: I say "most of the Net" because most of the net is North American,
> for whom MMDDYY is the rule, not DDMMYY.
Well, YYYY-MM-DD is something of a standard -- although I'll be
gosh-darned if I can remember where I read that. ISO, in their
infinite wisdom ;-) chose a "middle-endian" format.
I notice that the HTTP 1.1 spec indicates a preference for
RFC1123 format, which is like
Sun, 06 Nov 1994 08:49:37 GMT
Then there's the U.S. military's Date Time Group (DTG) format:
YYYYMMDDHHMMSS.HH
all parts optional, from the outside in (to seconds) (as I recall).
John Porter
------------------------------
Date: 10 Feb 1998 14:15:56 GMT
From: ostroj@gsun150.pfizer.com (Jack Ostroff)
To: banman@earth.execpc.com (Brian M. Beaulieu)
Subject: Re: Sharing variables between scripts
Message-Id: <6bpnes$8uu1@mascagni.pfizer.com>
banman@earth.execpc.com (Brian M. Beaulieu) writes (combining two posts):
> I've seen this done before but can't recall how again. All I need to do
> is share variables that are located in 1 perl script between other scripts
> .. I've tried 'require' .. that didn't seem to do the trick (and I did
> give it the relative path to the script with my variables)
>
> one perl script .. has $foo = 'bar';
> but say there are 50 variables.. in that one script..
> and I want another script to use the variable, not necessarily
> the values.. the script that contains the variables.. *just* contains
> variables.. no other functions..
> To make it simple.. I have for instance 30 scripts.. CGI or non CGI .. that
> are going to be using the same variables..and say there are 30 variables...
> is there a simple way to 'include' or 'require' a script.pl that has the
> variables listed. Maybe this can't be done.. thought it could be.
>
Brian,
Can you give a more concrete example? I really don't follow what you
are trying to do, and what the problem is. What does it mean to "use
the variables, not the values"?
------------------------------
Date: Tue, 10 Feb 1998 08:37:51 -0600
From: "Brian M. Beaulieu" <banman@execpc.com>
Subject: Re: Sharing variables between scripts
Message-Id: <6bpoo0$s40@newsops.execpc.com>
> Brian,
>
> Can you give a more concrete example? I really don't follow what you
> are trying to do, and what the problem is. What does it mean to "use
> the variables, not the values"?
ok...
contents of 'variables.pl'
--
#!/usr/bin/perl
$var1 = 'value1';
$var2 = 'value2';
etc..
--
and i have script1.pl, script2.pl etc ..
and I want to use variables.pl in script#.pl .. sharing the variables..
sort of like sharing a sub{}; in between scripts..
Sounds like it can't be done.. but thanks for your help.
Brian
------------------------------
Date: Tue, 10 Feb 1998 09:40:31 -0500
From: tloser@valdemar.microserve.com (Thomas A. Loser)
Subject: substitution/expression
Message-Id: <tloser-1002980940320001@168.133.124.5>
After wracking my brain (and compter - it's often easier and faster to just
try various syntaxes) I have hit a dead ened.
I am attempting to capitalize any character in a field that follows a " " or
a "/". Forget doubling them up, right now I'd settle for getting *either* to
work. According to the manuals (camel 2nd ed p73) I should be able to put an
expression as the 2nd part of a substitution. But when I try:
$field = "Tom jerry";
$field =~ s/ [a-z]/(uc $&)/e;
print $field;
all I get is: "Tomerry"
Pardon my stupidity but can anyone explain what obvious simple thing I am
overlooking?
-Tom Loser (obvious comments about the name can be left unsaid please)
--
imagine a world with no hypothetical situations
All opinions expressed here are mine and only mine - but you are welcome to borrow them if you like.
------------------------------
Date: 10 Feb 1998 10:40:58 +0100
From: Morten Stig Andersen <Morten.Andersen@molbio.uu.se>
Subject: Summary Q: Using unpack or split to get fixed-length substrings?
Message-Id: <x51zxb7q6t.fsf@beagle.bmc.uu.se>
Morten Stig Andersen <Morten.Andersen@molbio.uu.se> writes:
^^^^^^ That's me :-)
> I want to break ascii strings into fixed-length substrings as efficient
> as possible. I have a string like
>
> my $string = "aaabbbcccd";
>
> If my fixed-length is three, I want it split into a list of substrings
> like: ("aaa", "bbb", "ccc", "d")
>
Thanks to all for the replys! The most efficient solution, using unpack,
came from Andrew Johnson <ajohnson@gpu.srv.ualberta.ca>. The code below
reveals that the unpack solution is almost 3 times faster on my Sun
ULTRA at work, and 3-4 times faster on my Linux box at home.
------------------- cut here ---------------
#!/bin/perl -w
use Benchmark;
my $string = "aaabbbcccd" x 100000 ;
my (@arr, $mult);
my $count = 4;
timethese($count,
{
'using_unpack' => \&using_unpack,
'using_regexp' => \&using_regexp
}
);
sub using_unpack {
$mult = int(length($string)/3); #how many 3-character substrings
$mult+=1 if length($string)%3; #add 1 if remainder not 0
@arr=unpack "a3" x $mult ,$string;
}
sub using_regexp {
@arr = ($string =~ /(\w{1,3})/g);
}
------------------- cut here ---------------
--
=-=-=-=-=-=-=-=-=-=-=-= \,`/ / =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Morten Stig Andersen _).. `_ Department of Molecular Biology
( __ -\ BMC, University of Uppsala
tel: +46 18 4714214 '`. Box 590, 751 24 UPPSALA, Sweden
fax: +46 18 557723 ( \>_-_, --------------------------------
mail: moan@biobase.dk _||_ ~-/ http://evolution.bmc.uu.se/~moan
------------------------------
Date: Tue, 10 Feb 1998 04:33:31 -0600
From: geoff@elj.com
Subject: Re: Syntax-coloring editor for NT
Message-Id: <6bpadr$70q$1@nnrp2.dejanews.com>
In article <6bl9e9$g9t$3@usenet88.supernews.com>,
petdance@maxx.mc.net (Andy Lester) wrote:
>
> I'm partial to MultiEdit by American Cybernetics. The Perl coloring is
> pretty good, and I like the editor a bunch, and it's only $100.
I've been using UltraEdit ( http://www.ultraedit.com/ ). It has syntax
highlighting for upto 8 languages. Six are already pre-installed, not
including Perl. However, you can download the Perl syntax file from their
web site at:
http://www.ultraedit.com/downloads/additional.html
I describe how to use UltraEdit as next the best thing to an IDE for
GNU Eiffel at:
http://www.eiffel-forum.org/archive/eldridge/
All of what is said there applies to Perl (which gave me the idea for
GNU Eiffel IDE [1]). You can grep files using regexp, run your Perl scripts
from UltraEdit and capture the output. After a 45 day trail period you
can purchase for $30US. I use Perl in an ``object-oriented'' way (my Eiffel
preference showing) and UltraEdit allowed me to develop some rather
intricate realtime web applications using the Eiffel Method [2] in Perl:
http://www.tg.nsw.gov.au/sem/realtime/qld/ppsd/
Hope this helps ..
Geoff -- ``Eiffel, Back to the Future''
-- geoff@elj.com
-- Eiffel Liberty: http://www.elj.com/
-- Eiffel Forum: http://www.eiffel-forum.org/
Webreference :
[1] GNU Eiffel - http://www.elj.com/elj/v1/n3/dc/
[2] Eiffel Method - Best described in Bertrand Meyer's highly acclaimed
book titled ``Object Oriented Software Contruction''. See:
http://www.eiffel.com/doc/oosc.html
[3] Tom C's Excellent Perltoot made all this possible for me:
http://www.perl.com/CPAN-local/doc/FMTEYEWTK/perltoot.html
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: 10 Feb 1998 12:42:27 GMT
From: ? the platypus {aka David Formosa} <dformosa@st.nepean.uws.edu.au>
Subject: Re: Unpack float
Message-Id: <887114508.103372@cabal>
In <34e3ba68.2436582@news.tornado.be> bart.mediamind@tornado.be (Bart Lateur) writes:
>Tom Christiansen <tchrist@mox.perl.com> wrote:
[...]
>>You'll find that 2**2000 is precisely
>>
>> 1148130695274254524232833201177681...
> [rest snipped. Nobody reads this anyway.]
>Now why would anybody want such a high precision, except maybe the US
>government, to calculate the military expenses? :-)
Meany scuraty applications need numbers of the order of 2**2046 for RSA
keys and other such evils.
[...]
>>is given as the risibly inaccurate "Inf".
>Perl knows about Inf? Can it distinguish between +Inf and -Inf, too?
I would be interested if Perl knows about NaN.
--
Please excuse my spelling as I suffer from agraphia see the url in my header.
Never trust a country with more peaple then sheep.
Support NoCeM http://www.cm.org/
I'm sorry but I just don't consider 'because its yucky' a convincing argument
------------------------------
Date: Tue, 10 Feb 1998 10:40:16 GMT
From: lg@kt.dtu.dk (Lars Gregersen)
Subject: Re: use of regex in INDEX
Message-Id: <34e02d2e.2679180@130.228.3.8>
On Mon, 09 Feb 1998 12:53:18 -0600, rsignorino@yahoo.com wrote:
>I tried the INDEX function:
> $position = index($line, /&[0-9a-zA-Z]\./i);
>
>while looping thru each input $line if the file,but INDEX seems to
>require an actual string ("mystring"), rather than a regex. ( I keep
>getting 0 for $position)
Yes. 'index' is faster than a regex, but the price you pay is that it
only works for an exact match.
Do you really need the position? Often you don't. Maybe you can use
the s/// operator?
If you really need the position you can look up 'pos' in perlfunc.
Lars
Lars Gregersen, M.Sc., Chem. Engng.
Technical University of Denmark
Department of Chemical Engineering
E-mail : lg@kt.dtu.dk
Homepage: http://www.gbar.dtu.dk/~matlg/
------------------------------
Date: Tue, 10 Feb 1998 08:18:09 -0600
From: Cameron Dorey <camerond@mail.uca.edu>
To: Jon.Kibler@aset.com
Subject: Re: Year 2000 Compliance: Lawyers, Liars, and Perl
Message-Id: <34E061A1.BF53C520@mail.uca.edu>
Jon R. Kibler wrote:
> [snip]
> If data was stored on disk or tape, the common
> means of backing it up was to create a punched card backup of the disk
> or tape.
>
> Man, THE TREES WE WASTED in those days...
But, the punches made GREAT confetti for football games! The longhairs
(girls _and_ boys) couldn't get it out of their hair for days, the
punches were so small... Waste, nah - entertainment value!
Cameron (first programming on punchcards on an IBM 360(forget number?))
camerond@mail.uca.edu
------------------------------
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 1845
**************************************