[9128] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 2746 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu May 28 10:27:26 1998

Date: Thu, 28 May 98 07:01:00 -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           Thu, 28 May 1998     Volume: 8 Number: 2746

Today's topics:
    Re: A Email to WWW GaTeWaY, is there such a Thing? (Peter Granroth)
        Amputated CPAN <quednauf@nortel.co.uk>
    Re: Automation For Posting <aa162@RemoveThis.chebucto.ns.ca>
        Converting 31.12.1998 -> 12/31/1998 <ak@informatik.tu-cottbus.de>
    Re: Converting 31.12.1998 -> 12/31/1998 <Tony.Curtis+usenet@vcpc.univie.ac.at>
    Re: Copylefting manuals <dak@mailhost.neuroinformatik.ruhr-uni-bochum.de>
    Re: Copylefting manuals (Chris Nandor)
    Re: GNU attacks on the open software community rjk@greenend.org.uk
    Re: How to add invisible counter on Web page (Gabor)
    Re: how to init three dimentional array using perl <zenin@bawdycaste.org>
    Re: LABOR CRISIS: Perl SW Guru NEEDED MA Intranet Start (John Porter)
    Re: list context: || vs or (Mark-Jason Dominus)
    Re: list context: || vs or (John Porter)
    Re: new to OO Perl (John Porter)
    Re: OO - explicit package name required <quednauf@nortel.co.uk>
    Re: OO - explicit package name required (Chris Nandor)
    Re: OO - explicit package name required (Gabor)
        PC Screen Image File info@insyte.com
    Re: renaming files under NT ramos@cris.com
    Re: Statistics for comp.lang.perl.misc (Gabor)
    Re: Substitute gurus... got a better word wrap? (Gabor)
    Re: Visibility of "my" vars (Gabor)
    Re: Visibility of "my" vars <zenin@bawdycaste.org>
    Re: Visibility of "my" vars (Mark-Jason Dominus)
    Re: Visibility of "my" vars <tchrist@mox.perl.com>
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: 28 May 1998 13:19:45 GMT
From: f95pegr@granis.hemmet.s-hem.chalmers.se (Peter Granroth)
Subject: Re: A Email to WWW GaTeWaY, is there such a Thing?
Message-Id: <6kjo9h$416$1@eol.dd.chalmers.se>

on Wed, 27 May 1998 21:21:08 -0500, Igor shared with us the following words of wisdom:
> If you know where I can find email-to-www gateway (a-la Hotmail) so that
> I could read email from my Web Browser via HTTP, please email me.

> Thanks.

May I ask, why would you like to do that????
--
---------------------------------------------------------------
+        Peter Granroth        +  Microsoft is not the answer +
+ Mail: f95pegr@dd.chalmers.se +  Microsoft is the question   +
+ WWW:  http://193.10.242.45   +  The answer is NO            +
---------------------------------------------------------------


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

Date: Thu, 28 May 1998 14:32:48 +0100
From: "Frank L. Quednau" <quednauf@nortel.co.uk>
Subject: Amputated CPAN
Message-Id: <356D677F.DDB3589A@nortel.co.uk>

Yes, it would have been nice...I have tried to read the docs on
the strict and vars module (see me and OO [which looks like two
zeroes, in German a saying for someone who hasn't got a clue
whatsoever..]), but to no avail. On demon.co.uk and on funet.fi
both links where outdated. I'll be able to read it at home
through POD, but I thought I should say that here...

--
____________________________________________________________
Frank Quednau
http://www.surrey.ac.uk/~me51fq
________________________________________________





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

Date: Thu, 28 May 1998 09:30:58 -0400
From: "Philip M. Howard" <aa162@RemoveThis.chebucto.ns.ca>
Subject: Re: Automation For Posting
Message-Id: <6kjos5$4gn$1@tor-nn1.netcom.ca>

Caught in the Web's Active Upload may do some of what you want. See:

http://www.activeupload.com/

Open Text Livelink does it all (for a price):

http://www.opentext.com

-Philip
--
Philip M. Howard, Systems Engineer  |
ISG Inc.                            |   http://www.isginc.com
55 York St., Toronto, Suite 1500    |
tel: (416) 368-2222 x221            |
fax: (416) 366-6667                 |

Randy Borland wrote in message <355F87F7.2181EDE@erols.com>...
>All:
>
>I have a medium sized Intranet that supports my organization.  There are
>a number of technical staff that produce documents at somewhat regular
>intervals.  I'd like to give them the ability to directly post these
>documents to our Intranet.  Document conversion [assuming that they will
>follow style guidelines] will probably be accomplished via Word->HTML,
>FrontPage, or PDF print.





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

Date: Thu, 28 May 1998 15:21:22 +0200
From: ak <ak@informatik.tu-cottbus.de>
Subject: Converting 31.12.1998 -> 12/31/1998
Message-Id: <356D64D2.A699D224@informatik.tu-cottbus.de>

Hi !
I want to convert european dates to american dates. Has anyone a
solution for this problem ? Furthermore i need to check a string, if it
is a correct european date.

Thank you for any help
ak@informatik.tu-cottbus.de



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

Date: 28 May 1998 15:53:54 +0200
From: Tony Curtis <Tony.Curtis+usenet@vcpc.univie.ac.at>
To: ak@informatik.tu-cottbus.de
Subject: Re: Converting 31.12.1998 -> 12/31/1998
Message-Id: <7xaf82ijrh.fsf@beavis.vcpc.univie.ac.at>

Re: Converting 31.12.1998 -> 12/31/1998, ak
<ak@informatik.tu-cottbus.de> said:

ak> Hi !  I want to convert european dates to american
ak> dates. Has anyone a solution for this problem ?
ak> Furthermore i need to check a string, if it is a correct
ak> european date.

Try the popular date modules

    Date::DateCalc
    Date::Manip

and strftime() in

    POSIX


Or if you want to hack it yourself try split() on `.'
followed by string interpolation:

    my $eurodate = '31.12.1998';
    my ($d, $m, $Y) = split /\./, $eurodate;
    my $amidate = "$m/$y/$Y";

hth,
tony
-- 
Tony Curtis, Systems Manager, VCPC,      | Tel +43 1 310 93 96 - 12; Fax - 13
Liechtensteinstrasse 22, A-1090 Wien, AT | http://www.vcpc.univie.ac.at/

"You see? You see? Your stupid minds! Stupid! Stupid!" ~ Eros, Plan9 fOS.


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

Date: 28 May 1998 15:29:40 +0200
From: David Kastrup <dak@mailhost.neuroinformatik.ruhr-uni-bochum.de>
Subject: Re: Copylefting manuals
Message-Id: <m2k976ttff.fsf@mailhost.neuroinformatik.ruhr-uni-bochum.de>

pudge@pobox.com (Chris Nandor) writes:

> You are absolutely correct.  If I publish a book of my own
> algorithms, which I invented and copyrighted and are fantastic and
> new to the world, I can require that you don't use them in a program
> for sale.  However, that would most likely fall under patent law.

For something to fall under patent law, you have to patent it.  If you
don't do that, only normal copyright law applies, regardless of how
fantastic your algorithms may be.


-- 
David Kastrup                                     Phone: +49-234-700-5570
Email: dak@neuroinformatik.ruhr-uni-bochum.de       Fax: +49-234-709-4209
Institut f|r Neuroinformatik, Universitdtsstr. 150, 44780 Bochum, Germany


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

Date: Thu, 28 May 1998 13:56:19 GMT
From: pudge@pobox.com (Chris Nandor)
Subject: Re: Copylefting manuals
Message-Id: <pudge-2805980950440001@dynamic265.ply.adelphia.net>

In article <m2k976ttff.fsf@mailhost.neuroinformatik.ruhr-uni-bochum.de>,
David Kastrup <dak@mailhost.neuroinformatik.ruhr-uni-bochum.de> wrote:

# pudge@pobox.com (Chris Nandor) writes:
# 
# > You are absolutely correct.  If I publish a book of my own
# > algorithms, which I invented and copyrighted and are fantastic and
# > new to the world, I can require that you don't use them in a program
# > for sale.  However, that would most likely fall under patent law.
# 
# For something to fall under patent law, you have to patent it.  If you
# don't do that, only normal copyright law applies, regardless of how
# fantastic your algorithms may be.

I did not mean to imply that something is under patent without being
registered (although people have gone back and patented things that have
been in public use).  I am just pointing out that if an example is
modified, there is a good chance it won't be considered copyright
infringement.

-- 
Chris Nandor          mailto:pudge@pobox.com         http://pudge.net/
%PGPKey = ('B76E72AD', [1024, '0824090B CE73CA10  1FF77F13 8180B6B6'])


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

Date: 28 May 1998 14:18:59 +0100
From: rjk@greenend.org.uk
Subject: Re: GNU attacks on the open software community
Message-Id: <wwvu36aedoc.fsf@sfere.greenend.org.uk>

barr@cis.ohio-state.edu (Dave Barr) writes:

> If you look at GNU's web page, every reference to Linux is "GNU/Linux".
> 
> If you look at virtually any Linux page, Linux is "Linux", or maybe
> "Foo Linux", where "Foo" is a particular distribution.

http://www.debian.org is a good counterexample to this.


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

Date: 28 May 1998 13:50:28 GMT
From: gabor@vmunix.com (Gabor)
Subject: Re: How to add invisible counter on Web page
Message-Id: <slrn6mqra8.mhe.gabor@vnode.vmunix.com>

In comp.lang.perl.misc, JP <pangjo@vincentinc.com> wrote :
# We are running Novell Web server with Perl interpeter installed.  We would
# like to keep track of the main page without letting the users see the
# counter.  
# 
# Can anyone tell me what I should do to accomplish this.  Thanks in advance.
# 
# Joe

Just analyze your server logs.  If it's apache, I have a script that
parses it.
vnode.vmunix.com/~gabor/perl/logstats.pl
use -h flag to get help on usage


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

Date: 28 May 1998 12:54:43 GMT
From: Zenin <zenin@bawdycaste.org>
Subject: Re: how to init three dimentional array using perl
Message-Id: <896360517.425079@thrush.omix.com>

johnvun <johnvun@asiapac.net> wrote:
: how to init three dimentional array and how the syntax look like ???

  $array[1][2][3] = 'value'; # this is just one element though

: i want to init the three dimentional array be zero.
: for ($in = 1; $in < 13; $in++)
:         for ($shop =1; $shop < 120; $shop++)
:                for ($trans=1; $trans<100; $trans++)
:                 @isarray{"$in","$shop","$trans"}=0;
: is this syntax ok ????
: how i check my array is zero ???

	Woops, now quite right.

	foreach my $in (1..12) {
	    foreach my $shop (1..119) {
	        foreach my $trans (1..99) {
	            $isarray[$in][$shop][$trans] = 0;
	        }
	    }
	}

	-Although I question why you're starting from 1 and not 0...

	Brackets are *always* needed in perl, unlike C.  Most people
	consider this a Good Thing[tm].  You can use a for() loop, but
	foreach () is faster and normally cleaner to read too.

	When thinking about what kind of thingy identifier you need to
	use infront of the variable ($, %, or @), don't think about
	what the variable is but what kind of data you are assigning or
	reading from it.  If you're reading/writing a single (ala
	scalar) value from an array or hash, you want the scalar thingy
	marker:

	    $array[0]  = 'value';
	    $hash{foo} = 'value';

	This also applys to assigning values to hashes in an "array" style,
	in which case you need the array thingy marker even though you're
	talking about a hash:

	    @hash{'key_one', 'key_two', 'key_three'} = (1, 2, 3);
	    ## This sets the three keys of %hash at once, but has nothing
	    ## to do with the array @hash, or the scalar $hash.

	When working with arrays and lists, you are talking about indexs,
	so you need the index style markers, "[]".  When talking about
	hashes, you need hash style markers, "{}".  Don't mix them, or
	you'll do something you didn't want to do.  Seeing what kind of
	markers a variable is using is the single big clue as to what it
	really is.  Anything with "[]" is going to be an array.  Anything
	with "{}" is going to be a hash.  The exception to this is when
	the array or hash is being stored as a reference, in which case
	it still applys, but indirectly as the reference to the array or
	hash thingy is in a scalar, which might though one off as it
	would use ->[] or ->{} for access to the referenced thingys.

	See, simple right?  <evil grin>

-- 
-Zenin
 zenin@archive.rhps.org


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

Date: Thu, 28 May 1998 13:50:42 GMT
From: jdporter@min.net (John Porter)
Subject: Re: LABOR CRISIS: Perl SW Guru NEEDED MA Intranet Start-up 80K+>+Equity
Message-Id: <MPG.fd73789d9e1692c9896f4@news.min.net>

On 27 May 1998 16:48:03 -0700,
in article <t_patl.896312358@gano>,
t_patl@qualcomm.com (Pat Luther) wrote:
> Now, the one that made me *really* laugh was a while back when I saw a company in San
> Diego asking for a Software Configuration Management specialist who had 10+ years
> of experience in the industry, including 5 years of programming and 5 of windows 95, and
> was offering $30K for this person :-)

I'm not sure what's funnier, the $30k, or the "5 years of Windows 95"!

John Porter


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

Date: 28 May 1998 09:18:07 -0400
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: list context: || vs or
Message-Id: <6kjo6f$f2v$1@monet.op.net>
Keywords: Matson pun Sturbridge Thoreau


In article <6ki6qb$ho5$1@mathserv.mps.ohio-state.edu>,
Ilya Zakharevich <ilya@math.ohio-state.edu> wrote:
>> (waiting for those twin swine Orwant and mjd to tell me about the
>> number theoretic term "bunch" ...)
>
>Then you may relax.

Yeah, I tried, but there really isn't one.

There's clumping theory, but no bunching theory.



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

Date: Thu, 28 May 1998 13:22:47 GMT
From: jdporter@min.net (John Porter)
Subject: Re: list context: || vs or
Message-Id: <MPG.fd73104d3cc04cc9896f2@news.min.net>

On 27 May 1998 14:36:49 GMT,
in article <6kh8e1$ib4$3@csnews.cs.colorado.edu>,
tchrist@mox.perl.com (Tom Christiansen) wrote:
>  [courtesy cc of this posting sent to cited author via email]
> 
> In comp.lang.perl.misc, 
>     jdporter@min.net (John Porter) writes:
> :This works just fine:
> :	@pwent = getpwnam("fred") or catch_the_error();
> 
> True.  For someone reasons, I never ever write that.
> I always write one of these, the reversed one more
> often.  This may not be something to brag about.
> 
>     die catch_the_error() unless @pwent = getpwnam("fred") 
>     (@pwent = getpwnam("fred")) || catch_the_error();

You said Larry made you change all the ||'s to or's...
The only reason for wanting this, I think, is to elinate
some parens.  Now if that's Larry's goal, then I should
think he would also want a low-precedence version of the
the ternary operator, so we could say

	@pwent = getpwnam("fred")
		yup	&groovy( @pwent )
		nope 	die "getpwnam: $!";

or some such.

John Porter


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

Date: Thu, 28 May 1998 13:41:59 GMT
From: jdporter@min.net (John Porter)
Subject: Re: new to OO Perl
Message-Id: <MPG.fd7357fdd6d05c79896f3@news.min.net>

On Wed, 27 May 1998 11:17:30 -0400,
in article <356C2E8A.B8DE906F@ral1.zko.dec.com>,
jc@ral1.zko.dec.com (John Chambers) wrote:
> John Porter wrote:
> > 
> > Make the following substitutions throughout your code:
> >    In place of:             Use:
> >    $props{$key}             $self->{'props'}{$key}
> >    %props                   %{$self->{'props'}}
> >    $format[$index]          $self->{'format'}[$index]
> >    @format                  @{$self->{'format'}}
> > (for all values of $key and $index)
> 
> What strikes me in examining the right
> column is that in each case, there is one extra hash-table
> lookup....
> Table lookups are expensive, typically
> hundreds of times the cost of an add or multiply....
> Even a good hash algorithm (and perl does seem 
> to have a good one) is expensive....
> So I'd  expect that the code in the right column would produce
> a significant performance hit.  The OO approach is, of course,
> notorious for producing incredibly bad performance, except for
> a few cases where the programmers really understand it and know
> the performance gotchas. 

> But just telling programmers to "Use
> this marvelous new approach; it'll solve all your problems" is
> often a performance disaster, because of issues like this.

Well, I never said it would solve all his problems.  He was
trying to do it the OO way, and was doing it wrong.  I was
(I hope) showing him how to correct his code, to do it the
way he wanted.

And the performance penalty associated with using hashes
is essentially independent of object-oriented perl
programming.  They're two different things.  Don't go
blasting OO when it's the hashes that cause the problem.


> Any comments? What does a programmer need to know about how
> perl does OO, so as to avoid the performance hit from extra
> run-time table lookups?

Arrays seem to be a bit faster than hashes, so if one can
reasonably implement his objects as blessed array-refs
rather than hash-refs, it should be faster. I've seen it done.


> (Note that I'm not casting aspersions on perl's hash tables.
> I use them a lot, ...

So hashes are o.k. but OO is bad?

And then there's the issue of efficiency in the big scheme of
things.  I don't care if my program takes 10 minutes to run
instead of one, if I can write it in 10 minutes instead of
an hour.  I think that's been beaten to death; search DejaNews.

John Porter


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

Date: Thu, 28 May 1998 14:21:47 +0100
From: "Frank L. Quednau" <quednauf@nortel.co.uk>
Subject: Re: OO - explicit package name required
Message-Id: <356D64EA.A40902B0@nortel.co.uk>

Chris Nandor wrote:

> In article <356D27B5.B43C4A96@nortel.co.uk>, "Frank L. Quednau"
> <quednauf@nortel.co.uk> wrote:
>
> # Global symbol "ISA" requires explicit package name at
> # E:\PERL\lib/Infocentre.pm line 5.
> # Compilation failed in require at test.pl line 5.
> # BEGIN failed--compilation aborted at test.pl line 5.
>
> The Ferengi Rule of Programming #34 is The error message *means what it
> says*.

This is probably one of the most important rules of aquisition :) Thanks for
your help. I will read the doc on how to make a module instantly after having
written this.

> You need to specify a package for @ISA.  You can get around it,
> though, with use vars.

That's what I don't quite get, you see? Isn't Time::Localtime a package?

____________________________________________________________
Frank Quednau
http://www.surrey.ac.uk/~me51fq
________________________________________________





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

Date: Thu, 28 May 1998 13:32:32 GMT
From: pudge@pobox.com (Chris Nandor)
Subject: Re: OO - explicit package name required
Message-Id: <pudge-2805980926570001@dynamic265.ply.adelphia.net>

In article <356D64EA.A40902B0@nortel.co.uk>, "Frank L. Quednau"
<quednauf@nortel.co.uk> wrote:

# > You need to specify a package for @ISA.  You can get around it,
# > though, with use vars.
# 
# That's what I don't quite get, you see? Isn't Time::Localtime a package?

Everything not lexically scoped is in a package.  When you have use
strict, you have to qualify your variable with a package name.  i.e.:

  package X;
  use strict;
  @ISA = qw(A B C);

is not good enough.  You would have to do:

  package X;
  use strict;
  @X::ISA = qw(A B C);

or:

  package X;
  use strict;
  use vars qw(@ISA);
  @ISA = qw(A B C);

The latter form is preferred.

-- 
Chris Nandor          mailto:pudge@pobox.com         http://pudge.net/
%PGPKey = ('B76E72AD', [1024, '0824090B CE73CA10  1FF77F13 8180B6B6'])


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

Date: 28 May 1998 13:24:21 GMT
From: gabor@vmunix.com (Gabor)
Subject: Re: OO - explicit package name required
Message-Id: <slrn6mqpp9.mhe.gabor@vnode.vmunix.com>

In comp.lang.perl.misc, Frank L. Quednau <quednauf@nortel.co.uk> wrote :
# hi there,
# I am very new to OO programming, so pardon my terrible
# un-knowledge.
# 
# I start with my own package:
# 
# ..see below..
# 
# sub new {
#   my $proto= shift;
#   my $class = ref($proto) || $proto;
#   my $self = {};
#   $self->{TITLE} = undef;
#   $self->{TEXT} = undef;
#   bless($self, $class);
#   return $self;
# }
# 
# 
# Now I also want methods from Time::Localtime. So I do at the top:
# 
# package Infocentre;
# 
# use Time::Localtime;
# use strict;
# @ISA = ("Time::Localtime");
# 
# Looks silly to me, and indeed it doesn't work:
# 
# Global symbol "ISA" requires explicit package name at
# E:\PERL\lib/Infocentre.pm line 5.
# Compilation failed in require at test.pl line 5.
# BEGIN failed--compilation aborted at test.pl line 5.

Use h2xs to create your module stub.
Look up what 'use strict' does. :)

gabor.
--
    Although the Perl Slogan is There's More Than One Way to Do It, I
    hesitate to make 10 ways to do something.  :-)
        -- Larry Wall in <9695@jpl-devvax.JPL.NASA.GOV>


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

Date: Thu, 28 May 1998 13:37:00 GMT
From: info@insyte.com
Subject: PC Screen Image File
Message-Id: <6kjp9s$1bv$1@nnrp1.dejanews.com>

I am attempting to process a file which is actually a PC screen image, i.e.
each display character is two bytes with the odd numbered byte being an
attribute. The raw data for the area of interest begins at byte 12 and each
"line" is 48 displayed charaters (96 data bytes) long. Because its going to a
fixed format PC display the source data does not contain NLs, the physical
display simply wraps every 48 characters. My objective is to end up with a
text file consisting of "lines" of 48 byte data elements.

The portion of the file that I want has alphamerics and some limited
punctuation so I have tried reading this file into an array and doing:

    @out_data = (<FILE>);
    $out_data =~ tr /a-zA-Z0-9':+/ /c;

This does get rid of the non-alphamerics (attributes) but leaves me with
spaces. If I do

    $out_data =~ tr /a-zA-Z0-9'://c;

the output ends up with a "ODOA" (new line) after EVERY data character.

I've tried treating it both as a array and as a scalar with varying results,
but all negative. Some of the attribute data in the source is things like
"OA" "OB" OD, etc. Some of the things I've tried have resulted in these
attributes being treated as if they were NL's etc!

Any suggestions on how I can process this down to plain ASCII text

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/   Now offering spam-free web-based newsreading


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

Date: Thu, 28 May 1998 13:22:14 GMT
From: ramos@cris.com
Subject: Re: renaming files under NT
Message-Id: <6kjoe6$e6$1@nnrp1.dejanews.com>



(perl rename() doesn't work under NT)

I have a similar but apparently (upon investigation) different
problem.

What I have found is that although the Perl rename() works
fine in the commandline (e.g. perl -e "rename ...blah..."),
it will not work if the Perl script in question is being
invoked by an Apache server as a CGI script.

When it works, it works even without the full path name.

When it fails, the error from $! is "Permission Denied", even
though this is a single-user machine with all security settings
wide open. And it fails even if using the full path name as
suggested by the other reader (embedded below).

I ran out of ideas to try on this one. Any suggestions???

In article <3565A0BA.F8A4A125@inlink.com>,
  perlguy@technologist.com wrote:
>
> You need to put the FULL PATH information, including the drive letter,
> in the rename function.  NT doesn't seem smart enought to look in the
> current directory for a file.


-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/   Now offering spam-free web-based newsreading


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

Date: 28 May 1998 13:47:55 GMT
From: gabor@vmunix.com (Gabor)
Subject: Re: Statistics for comp.lang.perl.misc
Message-Id: <slrn6mqr5f.mhe.gabor@vnode.vmunix.com>

In comp.lang.perl.misc, Greg Bacon <gbacon@cs.uah.edu> wrote :
# Top 10 Threads by Number of Posts
# =================================
# 
# Posts  Subject
# -----  -------
# 
#   418  GNU attacks on the open software community
#    90  GPL documentation == unspeakable evil
#    46  Clearly define "free software"
#    42  Tom Christiansen attacks the free software community (was: Re: GNU attacks on the open software community)
#    42  More double standards out of the FSF
#    31  Does Perl have a IDE?I don't like command line.
#    23  translate A-Z to 1-26
#    22  Why NOT crypt???
#    22  Suggestion Re: GNU attacks on the open software community
#    17  GNU attacks on the open software community.
# 
# These threads accounted for 39.1% of all articles.
# 
# Top 10 Threads by Volume
# ========================
# 
#   (kb)   (kb)  (kb)  (kb)
# Volume (  hdr/ body/ orig)  Posts  Subject
# --------------------------  -----  -------
# 
#  905.6 (370.5/482.0/280.8)    418  GNU attacks on the open software community
#  212.7 ( 85.9/116.0/ 75.5)     90  GPL documentation == unspeakable evil
#  117.5 ( 37.6/ 75.5/ 40.4)     46  Clearly define "free software"
#   94.1 ( 44.1/ 45.3/ 27.1)     42  Tom Christiansen attacks the free software community (was: Re: GNU attacks on the open software community)
#   90.3 ( 37.0/ 48.9/ 30.6)     42  More double standards out of the FSF
#   57.7 ( 24.7/ 27.5/ 14.7)     31  Does Perl have a IDE?I don't like command line.
#   43.5 ( 16.0/ 25.1/ 15.2)     22  Why NOT crypt???
#   40.0 ( 20.4/ 17.5/ 11.6)     22  Suggestion Re: GNU attacks on the open software community
#   37.2 ( 13.7/ 21.7/ 14.0)     16  Quiet summary
#   34.3 ( 14.8/ 13.4/  8.3)     17  GNU attacks on the open software community.
# 
# These threads accounted for 45.5% of the total volume.

I think this clearly shows the need for a moderated newsgroup.  Any
Perl topics?  I guess 'Why NOT crypt?' might qualify.

gabor.
--
    echo "ICK, NOTHING WORKED!!!  You may have to diddle the includes.";
        -- Larry Wall in Configure from the perl distribution


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

Date: 28 May 1998 13:21:11 GMT
From: gabor@vmunix.com (Gabor)
Subject: Re: Substitute gurus... got a better word wrap?
Message-Id: <slrn6mqpjb.mhe.gabor@vnode.vmunix.com>

In comp.lang.perl.misc, Mid Summers Eve Festival <msef@pyramus.com> wrote :
# I've been using the following for word wrapping :
# 
# s/(.{1,80})\s+/$1\n/g
# 
# But this appears to remove leading tabs/spaces at the begining of each line... 
# does someone have a better method?
# 
# Peace,
# Blake

Text::Wrap; # simple wrapping
Text::NWrap; # simple wrapping
Text::Format; # advanced formatting/wrapping

gabor.
--
    Perl itself is usually pretty good about telling you what you
    shouldn't do. :-)
        -- Larry Wall in <11091@jpl-devvax.JPL.NASA.GOV>


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

Date: 28 May 1998 13:17:20 GMT
From: gabor@vmunix.com (Gabor)
Subject: Re: Visibility of "my" vars
Message-Id: <slrn6mqpc4.mhe.gabor@vnode.vmunix.com>

In comp.lang.perl.misc, Bob Kline <bkline@cortex.nlm.nih.gov> wrote :
# 
# The man page for perlsub has the following passage:
# 
# "Unlike dynamic variables created by the ``local'' statement, lexical
# variables declared with ``my'' are totally hidden from the outside world,
# including any called subroutines ...."
# 
# This would appear to be saying that any called subroutines would not
# be able to see a lexically scoped variable declared/defined at file
# scope, but this does not appear to be matched by the behavior of Perl
# 5.004, at least the builds I have been working with:
# 
# % cat t.pl
# my $foo = 8;
# &bar;
# sub bar
# {
#     $foo += 3;
#     print "$foo\n";
# }
# % perl t.pl
# 11
# % 

Here is my understanding of 'my' vars.  Please, don't flame me if I am
wrong, I am still a newbie.
A 'my' var has block scope.  A file in this case can be considered a
block, hence everything in the file can see the 'my' var.  It's as if
the whole file was wrapped in curly brackets.  If you declare a 'my'
then all blocks below it can see it;

use strict;

my $foo = 17;

{
    # $foo == 17
    my $foo = 8; # this redeclares a new $foo for the block
    # $foo == 8
    {
        $foo += 10;
        # $foo == 18
    }
}
# $foo == 17
{
    # $foo == 17
    {
        $foo += 10;
        # $foo == 27
    }
    # $foo == 27
}
# $foo == 27

gabor.
--
    This made me wonder, suddenly: can telnet be written in perl?
    Of course it can be written in Perl.  Now if you'd said nroff, 
    that would be more challenging...
        -- Larry Wall


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

Date: 28 May 1998 13:17:52 GMT
From: Zenin <zenin@bawdycaste.org>
Subject: Re: Visibility of "my" vars
Message-Id: <896361906.509380@thrush.omix.com>

Bob Kline <bkline@cortex.nlm.nih.gov> wrote:
: The man page for perlsub has the following passage:
: "Unlike dynamic variables created by the ``local'' statement, lexical
: variables declared with ``my'' are totally hidden from the outside world,
: including any called subroutines ...."

	Hmm, a little misleading, but not incorrect (entirely).  The
	sub declaration is not the outside world, it's the same world
	(scope).  Anything outside of that scope can't see it though,
	even if they walk the name space.

: This would appear to be saying that any called subroutines would not
: be able to see a lexically scoped variable declared/defined at file
: scope,

	But you see, the "file scope" is the lexical scope of the
	my variable in this case, at least from the point of
	the declaration to the EOF (anything before the declaration
	can't see it).

: % cat t.pl
: my $foo = 8;

	Scope of this $foo is from this point to the end of file.

: &bar;
: sub bar
: {
:     $foo += 3;
:     print "$foo\n";
: }

: Is this a bug in the documentation?

	It's documented, somewhere (can't remember off hand, sorry).

: Can the behavior I'm observing be relied upon in future versions?

	I sure hope so, or half the modules on CPAN would fail. :-)

-- 
-Zenin
 zenin@archive.rhps.org


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

Date: 28 May 1998 09:34:51 -0400
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: Visibility of "my" vars
Message-Id: <6kjp5r$f73$1@monet.op.net>
Keywords: Blum Exxon furthest insurrect


In article <6kjju6$rps$1@lhc.nlm.nih.gov>,
Bob Kline <bkline@cortex.nlm.nih.gov> wrote:
>"Unlike dynamic variables created by the ``local'' statement, lexical
>variables declared with ``my'' are totally hidden from the outside world,
>including any called subroutines ...."

Yes, but you took it out of context.  

The rule about the visibility of `my' variables is: 

	A `my' variable is visible from the place that it is declared to
	the end of the smallest enclosing block or file.

The paragraph you're quoting is just trying to contrast it with a
`local' variable.  Here's the difference:

	sub a {
	  my $my = 1;
	  local $local = 1;

	  &b();
	}

	sub b {
	  print "my=$my; local=$local\n";
	}

	# b prints:
	# my=; local=1	

The `my' variable is only visible in the scope it's declared; that
includes the body of `a', but not subroutine `b'.  When `b' tries to
print $my, it prints undef, because `b' doesn't have a `$my'.

But the *local* variable is created at run time in subroutine a by the
`local' statement, exists until `a' returns, and *is* visible in
called subroutines, including `b'.  `$local' would be visible in `b'
even if b were in another file.  This is because `local' variables are
actually global.

So, unlike dynamic variables created by the ``local'' statement,
lexical variables declared with ``my'' are totally hidden from the
outside world, including any called subroutines.

>This would appear to be saying that any called subroutines would not
>be able to see a lexically scoped variable declared/defined at file
>scope,

No, because you have misinterpreted `outside world'.  Scopes nest.  A
`my' variable declared in file scope is visible anywhere in that
scope; subroutines in the file are inside that scope, not outside.

Subroutines in other files *are* part of the `outside world'.

>Is this a bug in the documentation? 

That depends on how many other people are confused.  But it seems
clear to me.

>Can the behavior I'm observing be relied upon in future versions?

Yes.

>It would be nice if the bug were in the documentation, since the
>current behavior matches the file-static variables of C/C++, which
>provides a very convenient level of granularity.

It's not a bug.  It's the way it's supposed to work.

And it *is* in the documentation.  The paragraph immediately before
the one you quoted says:

>     A "my" declares the listed variables to be confined
>     (lexically) to the enclosing block, subroutine, eval, or
>     do/require/use'd file. 



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

Date: 28 May 1998 13:40:53 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Visibility of "my" vars
Message-Id: <6kjph5$fq9$1@csnews.cs.colorado.edu>

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

In comp.lang.perl.misc, 
    bkline@cortex.nlm.nih.gov (Bob Kline) writes:
:"Unlike dynamic variables created by the ``local'' statement, lexical
:variables declared with ``my'' are totally hidden from the outside world,
:including any called subroutines ...."
:
:This would appear to be saying that any called subroutines would not
:be able to see a lexically scoped variable declared/defined at file
:scope, 

No, it isn't. 

--tom
-- 
Just remember: when you go to court, you are trusting your fate t+
twelve people that weren't smart enough to get out of jury duty+


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

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

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