[9036] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 2654 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu May 21 00:07:38 1998

Date: Wed, 20 May 98 21:00:27 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Wed, 20 May 1998     Volume: 8 Number: 2654

Today's topics:
    Re: A newbie question of some stringy dimensions... <rootbeer@teleport.com>
        Any build-in function to get the host name? (Alex Dong Li)
    Re: Any build-in function to get the host name? <tchrist@mox.perl.com>
    Re: Dose %_ have a spacal meaning? (Ronald J Kimball)
    Re: Dose %_ have a spacal meaning? (Kevin Reid)
    Re: Getting at the symbol table for an object. (Kevin Reid)
    Re: GNU attacks on the open software community <tchrist@mox.perl.com>
    Re: GNU attacks on the open software community <tchrist@mox.perl.com>
    Re: GNU attacks on the open software community <ak@muc.de>
    Re: GNU attacks on the open software community <seniorr@teleport.com>
    Re: GNU attacks on the open software community (Paul Kimoto)
    Re: GNU attacks on the open software community <tchrist@mox.perl.com>
    Re: GNU attacks on the open software community (Chris Adams)
    Re: GNU attacks on the open software community <tchrist@mox.perl.com>
    Re: GNU attacks on the open software community <tchrist@mox.perl.com>
    Re: Help on stripping a string (Martien Verbruggen)
        HELP: Can't Print cgi based Calendar <jafary@akuweb.com>
    Re: Here a real stupid question (Ronald J Kimball)
    Re: Newbie needs help! (Fa Q 242)
    Re: translate A-Z to 1-26 <ljz@asfast.com>
    Re: translate A-Z to 1-26 (Mark-Jason Dominus)
    Re: trying to filter with ne <rootbeer@teleport.com>
    Re: Why does "each" not go thru entire hash?? <rootbeer@teleport.com>
    Re: Year2000 compliant? (Mike Stok)
    Re: Year2000 compliant? (Greg Andrews)
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Thu, 21 May 1998 02:10:45 GMT
From: Tom Phoenix <rootbeer@teleport.com>
To: annalisa@mkt2mkt.com
Subject: Re: A newbie question of some stringy dimensions...
Message-Id: <Pine.GSO.3.96.980520190719.12546b-100000@user2.teleport.com>

On Wed, 20 May 1998, Annalisa wrote:

> Subject: A newbie question of some stringy dimensions...

Please check out this helpful information on choosing good subject
lines. It will be a big help to you in making it more likely that your
requests will be answered.

    http://www.perl.com/CPAN/authors/Dean_Roehrich/subjects.post

> So here's the script the DOESN't wrap the pages right... 

This program runs to on the order of 20 screenfuls of text. That's more
than I'm in the mood to read right now. :-)  Can you find one line which
isn't doing what you think it should be doing? If you can put that line
into a small program - say, half a dozen lines of code - you could post
that here, and I'm sure someone will take a look at it. 

Cheers!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



------------------------------

Date: Thu, 21 May 1998 02:10:35 GMT
From: lidong@globalserve.net (Alex Dong Li)
Subject: Any build-in function to get the host name?
Message-Id: <6k0604$r1u$1@titan.globalserve.net>

Hello, there,

Is there a build-in function to get the host name?

chop($hostname=`hostname`); works on unix and NT, but is there a perl-build-in 
function to do so?

Regards,

ALex 


------------------------------

Date: 21 May 1998 02:13:48 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Any build-in function to get the host name?
Message-Id: <6k02ks$hq6$4@csnews.cs.colorado.edu>

 [courtesy cc of this posting sent to cited author via email]

In comp.lang.perl.misc, lidong@globalserve.net (Alex Dong Li) writes:
:Is there a build-in function to get the host name?

The answer to that question can be grepped from the docs.

--tom
-- 
There's some side effect based on the fact that SIGCHLD isn't sent by
anyone, but is fabricated by the kernel when a child dies.  It's a huge
kludge.  But then, it _is_ SysV. --Chip Salzenberg, aka <chs@nando.net>


------------------------------

Date: Wed, 20 May 1998 22:38:08 -0400
From: rjk@coos.dartmouth.edu (Ronald J Kimball)
Subject: Re: Dose %_ have a spacal meaning?
Message-Id: <1d9aw4x.1rnsryz15et87aN@bay1-563.quincy.ziplink.net>

? the platypus {aka David Formosa} <dformosa@st.nepean.uws.edu.au>
wrote:

> Is [%_] spechal, or is it just a normal hash that gets shoved about in *_
> along with $_ and @_ ?

It's not special, it's just a regular hash.  It is useful for
obfuscation, though, as in $_{} and @_{}.

-- 
 _ / '  _      /         - aka -         rjk@coos.dartmouth.edu
( /)//)//)(//)/(     Ronald J Kimball      chipmunk@m-net.arbornet.org
    /                                  http://www.ziplink.net/~rjk/
        "It's funny 'cause it's true ... and vice versa."


------------------------------

Date: Wed, 20 May 1998 23:05:10 -0400
From: kpreid@ibm.net (Kevin Reid)
Subject: Re: Dose %_ have a spacal meaning?
Message-Id: <1d9bwpf.1mn2wp51b776f4N@slip166-72-108-56.ny.us.ibm.net>

Randal Schwartz <merlyn@stonehenge.com> wrote:

> >>>>> "Larry" == Larry Rosler <lr@hpl.hp.com> writes:
> 
> Larry> It is just a normal hash, but its name is special.  It need not be
> Larry> declared as "local %_", when "use strict 'vars'" is in effect, and it
> Larry> cannot be declared as "my %_" in any case (even within a block).
> 
> ... and it is forced to be in %main, even if you are in a different
> package.

Shouldn't that be %main::?

-- 
  Kevin Reid.      |         Macintosh.
   "I'm me."       |      Think different.


------------------------------

Date: Wed, 20 May 1998 23:05:12 -0400
From: kpreid@ibm.net (Kevin Reid)
Subject: Re: Getting at the symbol table for an object.
Message-Id: <1d9bx0t.1xffjjpvw6942N@slip166-72-108-56.ny.us.ibm.net>

Steve Goldstein <steveg_nospam@gcg.com> wrote:

> In the camel book p 281, there is some code for getting at all the
> variables of a package:
> 
> foreach $symname (sort keys %pkg::) {
>       ...
> 
> How do I generalize this to all variables in an instantiation of an
> object?  Specifically, I want to hack some debugging code within the
> _get_sock_info method in LWP/Protocol/http.pm.

Try Data::Dumper.

-- 
  Kevin Reid.      |         Macintosh.
   "I'm me."       |      Think different.


------------------------------

Date: 21 May 1998 01:58:26 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: GNU attacks on the open software community
Message-Id: <6k01o2$hq6$2@csnews.cs.colorado.edu>

 [courtesy cc of this posting sent to cited author via email]

In comp.lang.perl.misc, Andi Kleen <ak@muc.de> writes:
:If I can't modify it it is not free. 

I beg to differ with you.  You are hurting our community.  Please stop
the lies.

I once again point out that there exist more than 1,000 printed pages of
free Perl documentation.  This the FSF or anyone is welcome to use on a
duplex printer, make a 500-page book, and give it away for free or for
their costs, and thus do the community a service.  No one is stopping you.

But you aren't going to allowed to lie about work created by others,
to steal things and claim them as your own and deny their authors due
copyright recognition.  Moreover, there's a significant social contract
that you break in doing so.  If that's the FSF's idea of freedom, then 
let us part company now, this very eve.

We will have peace when you and all your works have perished--and the
works of your dark master to whom you would deliver us.  You are a liar,
Saruman, and a corrupter of men's hearts.  --Theoden

--tom
-- 
I'm a programmer: I don't buy software, I write it.
    --Tom Christiansen


------------------------------

Date: 21 May 1998 02:11:54 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: GNU attacks on the open software community
Message-Id: <6k02ha$hq6$3@csnews.cs.colorado.edu>

 [courtesy cc of this posting sent to cited author via email]

In comp.lang.perl.misc, cadams@ro.com (Chris Adams) writes:
:A couple of years ago they attacked Linux, trying to rename it "Lignux",
:and when that was blasted for stupidity, they wanted to call it
:GNU/Linux.  If they had wanted to be real and give credit where credit
:was due, it would have been Linux/GNU/BSD/Perl/X/etc., but they wanted
:GNU/Linux (GNU before Linux).

Which is even stretching it.  But please, you've got to be kidding.  What
an insulting joke that would be if true!  Surely something has been lost
in the telling.  I can't believe they would be so arrogant, mendacious,
and disrespectful.  The man who does not give credit where credit is
due it at best a petty paraonid insecure of his own accomplishments--and
at worst a beggar, a scoundrel, and a thief.  I've never thought of the
FSF in those terms, and I hope to avoid doing so now.

:You mentioned the Camel book - that is a book from the evil O'Reilly
:company (according to RMS).  They are evil because they copyright their
:books and don't give the rights to the FSF.

That's certifiably insane, and if that were really the FSF's view, I would
move that Perl -- and all free software -- disassociate itself from GNU.

Fortunately, I prefer to believe that we're all really just trapped
in a P.K. Dick book laced with Lovecraft, and this awful Terror Out of
Cambridge shall by the light of day evaporate, leaving nothing but 
good intentions in its stead.

--tom
-- 
When I was a boy I was told that anybody could become President.  Now
I'm beginning to believe it.
                --Clarence Darrow


------------------------------

Date: 21 May 1998 04:22:37 +0200
From: Andi Kleen <ak@muc.de>
Subject: Re: GNU attacks on the open software community
Message-Id: <m3zpgcl5w2.fsf@fred.muc.de>

Tom Christiansen <tchrist@mox.perl.com> writes:

>  [courtesy cc of this posting sent to cited author via email]
> 
> In comp.lang.perl.misc, Andi Kleen <ak@muc.de> writes:
> :If I can't modify it it is not free. 
> 
> I beg to differ with you.  You are hurting our community.  Please stop
> the lies.

What lies? When I can't modify something to suit my needs it is not 
free for me. Your definition of "free" might differ of course, I'm
not refering to the free as in "no cost" but to the free as in "freedom
of speech". 

Of course it is nice of you that you make your documentation available
at no cost, but please don't claim that it is free. 

> But you aren't going to allowed to lie about work created by others,
> to steal things and claim them as your own and deny their authors due
> copyright recognition.  Moreover, there's a significant social contract
> that you break in doing so.  If that's the FSF's idea of freedom, then 
> let us part company now, this very eve.

I'm no lawyer, but my understanding is that the Berne convention forbids
this anyways. I also don't think that what you describe is the FSF's idea
of freedom [e.g. see 2(a) in the GPL].  

-Andi 


------------------------------

Date: Thu, 21 May 1998 02:19:23 GMT
From: Russell Senior <seniorr@teleport.com>
To: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: GNU attacks on the open software community
Message-Id: <864syk5psm.fsf@coulee.tdb.com>

>>>>> "Tom" == Tom Christiansen <tchrist@mox.perl.com> writes:

Andi> If I can't modify it it is not free.

Tom> I beg to differ with you.  You are hurting our community.  Please
Tom> stop the lies.

Values differ.

Tom> I once again point out that there exist more than 1,000 printed
Tom> pages of free Perl documentation.  This the FSF or anyone is
Tom> welcome to use on a duplex printer, make a 500-page book, and
Tom> give it away for free or for their costs, and thus do the
Tom> community a service.  No one is stopping you.

You haven't addressed Barry Margolin's observation that if one
modifies the code but can't modify the documentation, then the
documentation is no longer accurate.

Tom> But you aren't going to allowed to lie about work created by
Tom> others, to steal things and claim them as your own and deny their
Tom> authors due copyright recognition.  Moreover, there's a
Tom> significant social contract that you break in doing so.  If
Tom> that's the FSF's idea of freedom, then let us part company now,
Tom> this very eve.

Please try to avoid confusing yourself.  It is possible to modify
something while maintaining copyright recognition.  Investigate the
GPL for further details.


-- 
Russell Senior
seniorr@teleport.com


------------------------------

Date: 21 May 1998 02:30:11 GMT
From: kimoto@spacenet.tn.cornell.edu (Paul Kimoto)
Subject: Re: GNU attacks on the open software community
Message-Id: <slrn6m74ds.12j.kimoto@naked.tn.cornell.edu>

In article <m33ee4mlwj.fsf@fred.muc.de>, Andi Kleen wrote:
>Tom Christiansen <tchrist@mox.perl.com> writes:
>> That's right.  You can't steal my stuff and lie about who wrote it,
>> or insert little bits saying "First, God created Boston" or any there
>> bogosities inside it.  I give my stuff away.  I simply don't want people
>> screwing it up, or lying about whose it is.

> If I can't modify it it is not free. 

The end of etc/WHY-FREE in the emacs distribution says:

: Copyright 1994 Richard Stallman
: Verbatim copying and redistribution is permitted
: without royalty as long as this notice is preserved;
: alteration is not permitted.

I understand that this file is not software documentation, 
but there do seem to be some concerns parallel with Tom's.

-- 
|||    "It was not granted you to complete the task, and           |||
|||     yet you may not give it up."      --Rabbi Tarfon           |||
|  Paul Kimoto                     <kimoto@spacenet.tn.cornell.edu>  |


------------------------------

Date: 21 May 1998 02:33:50 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: GNU attacks on the open software community
Message-Id: <6k03qe$hq6$5@csnews.cs.colorado.edu>

 [courtesy cc of this posting sent to cited author via email]

In comp.lang.perl.misc, Russell Senior <seniorr@teleport.com> writes:
:You haven't addressed Barry Margolin's observation that if one
:modifies the code but can't modify the documentation, then the
:documentation is no longer accurate.

If someone modifies the code to make it behave differently than the
standard release, it is no longer Perl and they may not distribute it
under the same name.  If they modify the code and Perl still works the
same way, then there is no need to change documentation.

Anyway, if you see room for improvement on something I wrote, than 
please send me mail.  I welcome corrections and suggestions!  

But if you steal it and change it and remove my name and copyright
and then say its yours and sell it for your profit *AS HAS BEEN DONE
REPEATEDLY TO ME*, then I *shall* see you in a court of law.  I promise.
I will not write anything that anyone can do that with every again.
I won't even let you come close.  I've been raped before, but not again.

If FSF doesn't like this, they can go write their own Perl.  This is
smelling worse and worse.  I'll wait till I hear from Richard or his
duly appointed representative, but if it's as bad as private mail 
has indicated, things are going to have to change between us and you.

--tom
-- 
    X-Windows: graphics hacking :: roman numerals : sqrt(pi)
	--Jamie Zawinski


------------------------------

Date: 21 May 1998 02:56:46 GMT
From: cadams@ro.com (Chris Adams)
Subject: Re: GNU attacks on the open software community
Message-Id: <6k055e$ntc$1@news.ro.com>

According to Tom Christiansen  <tchrist@mox.perl.com>:
>In comp.lang.perl.misc, cadams@ro.com (Chris Adams) writes:
>:A couple of years ago they attacked Linux, trying to rename it "Lignux",
>:and when that was blasted for stupidity, they wanted to call it
>:GNU/Linux.  If they had wanted to be real and give credit where credit
>:was due, it would have been Linux/GNU/BSD/Perl/X/etc., but they wanted
>:GNU/Linux (GNU before Linux).
>
>Which is even stretching it.  But please, you've got to be kidding.  What
>an insulting joke that would be if true!  Surely something has been lost
>in the telling.  I can't believe they would be so arrogant, mendacious,
>and disrespectful.  The man who does not give credit where credit is
>due it at best a petty paraonid insecure of his own accomplishments--and
>at worst a beggar, a scoundrel, and a thief.  I've never thought of the
>FSF in those terms, and I hope to avoid doing so now.

See <199603070240.VAA16295@mole.gnu.ai.mit.edu> at dejanews for Richard
Stallman's original reasonings.  In Emacs 19.31, the configure program
was changed to say "lignux" instead of "linux".  After lots of
complaints it was changed to "gnu/linux".  AFAIK it still says that - I
don't use emacs (VI iMproved is great!).  I see this topic discussed
from time to time and ignore it.

I agree that Linux would probably not exist in anything like its current
form without GNU tools.  However, it would also be useless without
networking and other tools from the *BSD world, XFree86, and other
random bits like Perl.  Even to call it a Linux based GNU system is
stretching it to me.  Sure Linux fulfills the GNU objectives, but so do
the *BSD except they aren't GNU licensed.  They are still free however.
I think they even may use a few GNU tools.

>:You mentioned the Camel book - that is a book from the evil O'Reilly
>:company (according to RMS).  They are evil because they copyright their
>:books and don't give the rights to the FSF.
>
>That's certifiably insane, and if that were really the FSF's view, I would
>move that Perl -- and all free software -- disassociate itself from GNU.

I've heard the above in several places, but I should have qualified it
and said that I've not tried to verify it.  After the Linux debacle, I
pretty much have not paid attention to the political ramblings of RMS
and the FSF.

>Fortunately, I prefer to believe that we're all really just trapped
>in a P.K. Dick book laced with Lovecraft, and this awful Terror Out of
>Cambridge shall by the light of day evaporate, leaving nothing but 
>good intentions in its stead.

Quick!  Someone spray some Ubik on it and everything will be okay!
-- 
Chris Adams - cadams@ro.com
System Administrator - Renaissance Internet Services
I don't speak for anybody but myself - that's enough trouble.


------------------------------

Date: 21 May 1998 03:07:51 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: GNU attacks on the open software community
Message-Id: <6k05q7$nq9$1@csnews.cs.colorado.edu>

 [courtesy cc of this posting sent to cited author via email]

In comp.lang.perl.misc, Andi Kleen <ak@muc.de> writes:
:What lies? When I can't modify something to suit my needs it is not 
:free for me. 

The lie that Perl's documentation is not free.  It is.  Saying otherwise
is a lie.  Stop lying.  Also, the lie that you can't modify to suit your
own needs.  You can.  Saying you can't is a lie.  You can do anything
you want for *your*own*personal*use*.  I'm just tired of being screwed by
wannabe book authors stealing from me, Larry, and the rest of the authors.

Whoever claims otherwise is spreading fear, uncertainty, and doubt.
They are working to divide our community.  They are committing an evil
that should be revealed to the light, extirpated from our midst--burnt
out.

Could you possibly tell me whatever happened to pure simple social
decency of *asking* the author about his work?  Authors of free software
and free documentation are famous for the receptivity to these things.

:Of course it is nice of you that you make your documentation available
:at no cost, but please don't claim that it is free. 

I recognize (or at least strongly suspect) that you are not a native
speaker of English, and that in German, frei doesn't mean the same as
it does in English.  So I forgive you.

But my stuff is indeed free.  It's totally gratis, a gift.  That's free.
If you call it anything else, you're confused or lying.  But you're just
not free to screw me over with it.  That's thievery.

You can't change Perl to your own liking and go sell it calling it
Perl, you know.

And you can't distribute incomplete distributions.  You are required
to distribute the whole thing, or nothing.  You can't just chop pieces
out if you feel like it.  "Oh, I don't think we'll ship Perl with an 
open system all" doesn't cut it.  And you can't omit the docs on open
either.

It's really a matter of being a decent human being and respecting
other people's authorship rights.  If you want something changed, ask. 
If you want into my house, ring the door bell.

--tom
-- 
    A formal parsing algorithm should not always be used.
		    --D. Gries


------------------------------

Date: 21 May 1998 03:08:51 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: GNU attacks on the open software community
Message-Id: <6k05s3$nq9$2@csnews.cs.colorado.edu>

 [courtesy cc of this posting sent to cited author via email]

In comp.lang.perl.misc, 
    kimoto@spacenet.tn.cornell.edu writes:
:The end of etc/WHY-FREE in the emacs distribution says:
:
:: Copyright 1994 Richard Stallman
:: Verbatim copying and redistribution is permitted
:: without royalty as long as this notice is preserved;
:: alteration is not permitted.
:
:I understand that this file is not software documentation, 
:but there do seem to be some concerns parallel with Tom's.

Good find.  I'm happy to see that Richard is in full agreement with me.

--tom
-- 
    Be consistent.
            --Larry Wall in the perl man page 


------------------------------

Date: 21 May 1998 02:59:50 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Help on stripping a string
Message-Id: <6k05b6$8kc$1@comdyn.comdyn.com.au>

In article <3563858F.62FD8BDE@earthlink.net>,
	Matthew Purdon <playinmantis@earthlink.net> writes:
> 
> --------------138E1049B8FE20C1D9AAC1CB
> Content-Type: text/plain; charset=us-ascii
> Content-Transfer-Encoding: 7bit

Please don't do this. Usenet is a plain text medium. HTML is for the Web.

> @string = ("Perl Language",
>            "Perl+Language",
>            "\"Perl Language\"",
>            "\"Perl Language\" Misc",
>            "\"Perl Language\"+Misc");

You do realise that if you had used single quotes, that you wouldn't need
all the backticks?

> foreach $string (@string) {
>     if (index($string,"\"") == -1) {
>         $string =~ s/\+/ /;
>         @templist = split(/\s/,$string);
>     } elsif (index($string,"\" ") != -1) {
>         $string =~ /\"([a-zA-Z0-9]+\s+[a-zA-Z0-9]+)\"\s+([a-zA-Z0-9]+)/;
>         @templist = ($1,$2);
>     } else {
>         $string =~ s/\"//g;
>         @templist = split(/\+/,$string);
>     }
>     foreach $templist (@templist) {
>         push(@permlist,$templist);
>     }
> }

This will break if the string between quotes contains a '+'. Also see
my example in <6jvudk$824$1@comdyn.comdyn.com.au>.

It will break for both these strings, although in a different way:

"Perl+Language" Misc
"Perl+Language"+Misc

Even though the original poster didn't specify that he needed to be
able to have a '+' in the quoted string, and preserve it, it probably
isn't a bad assumption.

Text::ParseWords does this sort of thing, and it does it quite well.

Martien
-- 
Martien Verbruggen                      |
Webmaster www.tradingpost.com.au        | "In a world without fences,
Commercial Dynamics Pty. Ltd.           |  who needs Gates?"
NSW, Australia                          |


------------------------------

Date: Wed, 20 May 1998 22:11:01 -0400
From: Fahim Jafary <jafary@akuweb.com>
Subject: HELP: Can't Print cgi based Calendar
Message-Id: <35638D35.1C27@akuweb.com>

Hi all:

I have setup a cgi based Calendar which works FINE.  However when I try
to print it by clicking on the Print button in Netscape MOST OFTEN I get
a message "There are no pages to print".  ON the other hand, sometimes
it WILL print fine.  Can anyone help??

The URL is http://www.akuweb.com/cgibin/Calendar_3.0/calendar.cgi

Please email me DIRECTLY as I don't access this newsgroup often.

Thanks

Fahim Jafary


------------------------------

Date: Wed, 20 May 1998 22:38:11 -0400
From: rjk@coos.dartmouth.edu (Ronald J Kimball)
Subject: Re: Here a real stupid question
Message-Id: <1d9awkc.urfe0b13kyitcN@bay1-563.quincy.ziplink.net>

Pacific News <jeff@pacific.net> wrote:

> Please forgive this newbie question, but I'm new to perl and I'm on a
> time line.
  ^^^^^^^^^

-----|----|-|-----
 .    |    | +---------+
 .    |    |           |
 .    |    +------+    |
 .    |           |    |
 .  Jeff starts   |  Jeff posts basic
 .  programming   |  CGI question to
 .  in Perl       |  comp.lang.perl.misc
 .                |
 .              Jeff gets
 .              stuck on
 .              basic CGI

;-)

-- 
 _ / '  _      /         - aka -         rjk@coos.dartmouth.edu
( /)//)//)(//)/(     Ronald J Kimball      chipmunk@m-net.arbornet.org
    /                                  http://www.ziplink.net/~rjk/
        "It's funny 'cause it's true ... and vice versa."


------------------------------

Date: 21 May 1998 03:57:16 GMT
From: faq242@aol.com (Fa Q 242)
Subject: Re: Newbie needs help!
Message-Id: <1998052103571600.XAA25796@ladder01.news.aol.com>

That works?  I'm fairly (very) new to perl so I'd like to know why that would
work.  Is it the "<"?  I only know how to check for a file's existence by doing
this:

#!/usr/bin/perl
$myfile = "/blah/and/stuff.txt"
if (-e $myfile){
print "do this";
}
else
{
print "or do this";
}

Thanks....


------------------------------

Date: 20 May 1998 22:00:41 -0400
From: Lloyd Zusman <ljz@asfast.com>
Subject: Re: translate A-Z to 1-26
Message-Id: <lt67j0e62e.fsf@asfast.com>

"Larry Rosler" <lr@hpl.hp.com> writes:

> Mark-Jason Dominus wrote in message <6js2le$gpd$1@monet.op.net>...
> >
> >In article <ltaf8fapzc.fsf@asfast.com>, Lloyd Zusman  <ljz@asfast.com>
> wrote:
> >>But in EBCDIC, the set ('a' .. 'z') contains 41 elements.
> >
> >You'd think so, but according to this article, it contains 9.
> >(_Perl and EBCDIC?_, Peter Prymmer, The Perl Journal, vol 2. no
> >4. pp. 16-16)
> 
> That's pp. 16-18.
> 
> To quote from p. 18:
> 
> However, attempts to create a continuously collated list will simply
> truncate at the EBCDIC punch card boundaries:
> 
> [ ... ]
> 
> As I read that explanation, the truncation is a bug which would be
> corrected, were there to be any future ports. :-)

I'm curious what intended result would be after this bug gets fixed.
Would the EBCDIC ('a'..'z') then return a 41-member list or a
26-member list?

-- 
 Lloyd Zusman   ljz@asfast.com
 perl -e '$n=170;for($d=2;($d*$d)<=$n;$d+=(1+($d%2))){for($t=0;($n%$d)==0;
 $t++){$n=int($n/$d);}while($t-->0){push(@r,$d);}}if($n>1){push(@r,$n);}
 $x=0;map{$x+=(($_>0)?(1<<log($_-0.5)/log(2.0)+1):1)}@r;print"$x\n"'


------------------------------

Date: 20 May 1998 23:58:35 -0400
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: translate A-Z to 1-26
Message-Id: <6k08pb$2e7$1@monet.op.net>
Keywords: acorn calm cryptic puddle

In article <ltemxoe9r4.fsf@asfast.com>, Lloyd Zusman  <ljz@asfast.com> wrote:
>> (_Perl and EBCDIC?_, Peter Prymmer, The Perl Journal, vol 2. no
>> 4. pp. 16-16) 
>
>Does this article appear on line anywhere?

I don't know of anywhere.  Jon might have trouble selling
subscriptions if he put the articles on line.

Subscription information is available at

	http://www.tpj.com/

I think it's a really excellent magazine.



------------------------------

Date: Thu, 21 May 1998 02:30:28 GMT
From: Tom Phoenix <rootbeer@teleport.com>
To: GoYankees98@my-dejanews.com
Subject: Re: trying to filter with ne
Message-Id: <Pine.GSO.3.96.980520192201.12546d-100000@user2.teleport.com>

On Wed, 20 May 1998 GoYankees98@my-dejanews.com wrote:

> As I parse through the submitted values, I want to put them into a
> variable for later use. Except, I want to filter some out. 

Sounds like a job for grep, perhaps.

> ## You've all seen this before...
> @cont = split(/&/, $bigcontent);
> foreach $cont (@cont) {
>     ($name, $value) = split(/=/, $cont);
>     $value =~ tr/+/ /;
>     $value =~ s/%0D//eg;
>     $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
>     $input{$name} = $value;

We've not only seen it before - we've seen it done right. And this isn't
it. If you won't use a module to do this, at least be certain that your
code is better than the module's. This isn't. I'm not trying to be harsh
with you, but you should know that this code probably doesn't do what you
think it does. 

> ## This is where my trouble is. I want to put most,
> ## but not all the submitted info a variable I can then
> ## PRINT into mail. All the hidden variables I don't
> ## want begin with 'nm'. I want to filter them out before
> ## I put the rest into $tvar. So I made two trys
> 
> ##This is attempt one, didn't work
>     	#if ($input{$name} ne "nm".*)

Perhaps you should check out substr(). With a good module and grep, what
you're doing here should take about three lines of code - and that's
easier to debug than a screenful, don't you agree?

>     	{
>     		$tvar= "\n$tvar $name: $value\n\n";
>     	}

> Also, for some reason, there are several line returns printing at the
> top of $tvar, but I can't figure out where they're coming from. 

I have a guess. :-)

Hope this helps!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



------------------------------

Date: Thu, 21 May 1998 02:21:37 GMT
From: Tom Phoenix <rootbeer@teleport.com>
To: Tom Turton <tturton@cowboys.anet-dfw.com>
Subject: Re: Why does "each" not go thru entire hash??
Message-Id: <Pine.GSO.3.96.980520191215.12546c-100000@user2.teleport.com>

On Wed, 20 May 1998, Tom Turton wrote:

> I am seeing some bizarre behavior while trying to use a while/each on a
> hash.  It appears to jump into the middle/end of the hash the first time
> through.

Do you mean that each() doesn't traverse the entire hash? That's not
supposed to happen, but perhaps you're not re-setting the iterator
somewhere.

> %runway = ("DFW18R", 0, "DFW18L", 1, "DFW17R", 2, "DFW17C", 3, "DFW17L",
> 4,  "DFW13R", 5, "DFW35C", 6, "DFW35R", 7 , "DFW35L", 8, "DFW36L", 9,
> "DFW36R", 10, "DFW31R", 11, "DFW13L", 12, "DFW31L", 13);
> .
> .
> for ($rwi=0; $rwi<14; $rwi++) {
>      while( ($m,$n) = each(%runway)){
>             if ($n == $rwi) {
>                  print OUTFILE "\$rwi = $rwi, \$n = $n\n";
>             }
>      }
> }

Perhaps you should consider using an inverted hash instead of looping over
the entire hash. Perhaps not. :-)

> When I run it in my main program, the first time through ($rwi = 0), it
> appears to check starting with 'values' 3,6,10 then goes on to index
> $rwi=1 

If I'm understanding this correctly, that sounds as if your iterator was
left set partway through the hash. Could you have been iterating over that
hash earlier in your program, perhaps? If that's the case, you may reset
the iterator by simply using keys() in a scalar (or void) context, so
adding this line before the loop should fix it. 

    keys %runway;	# reset hash iterator, just in case

Good luck!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



------------------------------

Date: 21 May 1998 02:11:01 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: Year2000 compliant?
Message-Id: <6k02fl$fud@news-central.tiac.net>

In article <6jvho6$spn$4@marina.cinenet.net>,
Craig Berry <cberry@cinenet.net> wrote:
>Wen Gong (wgong@hpprsd1.sc.hp.com) wrote:
>: Does anyone know if Perl 4.0+ is Year2000 compliant?
>
>Oh, god, here we go again.
>
>First, see Deja News for endless discussion of this topic.
>
>Second, don't use Perl 4 for anything at all; it's got serious security
>and stability problems.  Stick with Perl 5, and indeed 5.004, the current,
>stable, secure, *good* version. 

Why not usde perl 4 for "anything at all" I have several seripts which
don't seem vulnerable to user-caused buffer overruns as they never process
user data and perl 4.036's startup time and footprint is less painful to
old machines running DOS.

Yes, perl 5 is supported and has certain bugs eliminated and a stack more
features, but as develpmnet has stopped on perl 4 it is finally stable :-)

Mike

-- 
mike@stok.co.uk                    |           The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/       |   PGP fingerprint FE 56 4D 7D 42 1A 4A 9C
http://www.tiac.net/users/stok/    |                   65 F3 3F 1D 27 22 B7 41
stok@colltech.com                  |            Collective Technologies (work)


------------------------------

Date: 21 May 1998 03:01:54 GMT
From: gerg@shell. (Greg Andrews)
Subject: Re: Year2000 compliant?
Message-Id: <6k05f2$80o$1@news.ncal.verio.com>

cberry@cinenet.net (Craig Berry) writes:
>Wen Gong (wgong@hpprsd1.sc.hp.com) wrote:
>:
>: Does anyone know if Perl 4.0+ is Year2000 compliant?
>
>Oh, god, here we go again.
>

Does anybody really know what FAQ it is?
Does anybody really care?

(sigh)

  -Greg


------------------------------

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 2654
**************************************

home help back first fref pref prev next nref lref last post