[32998] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4274 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Aug 21 14:09:17 2014

Date: Thu, 21 Aug 2014 11:09:04 -0700 (PDT)
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, 21 Aug 2014     Volume: 11 Number: 4274

Today's topics:
        Devel::NYTProf gotchas, drawbacks, watch out fors, et c (Tim McDaniel)
    Re: perl6 too much pointless functionality <bauhaus@futureapps.invalid>
    Re: perl6 too much pointless functionality <rweikusat@mobileactivedefense.com>
    Re: perl6 too much pointless functionality <rweikusat@mobileactivedefense.com>
    Re: perl6 too much pointless functionality <bauhaus@futureapps.invalid>
    Re: perl6 too much pointless functionality <rweikusat@mobileactivedefense.com>
    Re: perl6 too much pointless functionality <bauhaus@futureapps.invalid>
    Re: perl6 too much pointless functionality <rweikusat@mobileactivedefense.com>
        Whitespace in variable names? (Tim McDaniel)
    Re: Whitespace in variable names? <rweikusat@mobileactivedefense.com>
    Re: Whitespace in variable names? <jurgenex@hotmail.com>
    Re: Whitespace in variable names? (Tim McDaniel)
    Re: Whitespace in variable names? <gravitalsun@hotmail.foo>
    Re: Whitespace in variable names? <rweikusat@mobileactivedefense.com>
    Re: Whitespace in variable names? <rweikusat@mobileactivedefense.com>
    Re: Whitespace in variable names? <gravitalsun@hotmail.foo>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Wed, 20 Aug 2014 20:28:03 +0000 (UTC)
From: tmcd@panix.com (Tim McDaniel)
Subject: Devel::NYTProf gotchas, drawbacks, watch out fors, et cetera
Message-Id: <lt30cj$m41$1@reader1.panix.com>

I *swear* I saw a page with things to watch out for with
Devel::NYTProf, but I can't find it now.  In particular, there was an
explanation of how two adjacent lines that should be identical or
nearly so could be reported with very different times.  But there were
other gotchas listed.  Anyone have a URL?

-- 
Tim McDaniel, tmcd@panix.com


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

Date: Wed, 20 Aug 2014 13:37:42 +0200
From: "G.B." <bauhaus@futureapps.invalid>
Subject: Re: perl6 too much pointless functionality
Message-Id: <lt21a3$uur$1@dont-email.me>

On 19.08.14 20:37, Rainer Weikusat wrote:

> The original statement was
>
> ,----
> | While there appears to be some concerted work on some
> | libraries, the creative people still behind Perl 6 seem to spend
> | more energy on mixing more 7 bit ASCII ideographs with the current
> | syntax,
> `----
>
> This is an assertion about the present

Correct, but as part of a rant, "present" was meant to address
that present which is the one anyone will likely consider to
be "now" when reading at perl6.org, and then commenting here.

OTOH, nitpicking, there is this in S02-bits.pod:

"    Last Modified: 18 Aug 2014
"    Version: 283

"This document summarizes Apocalypse 2, which covers small-scale
lexical items and typological issues."

> Even when leaving this aside, it doesn't make too much sense: Of course,
> the people who designed Perl6 spent more time on designing a new
> programming language than on dealing with more-or-less obsolete
> third-party packages programmed in some other programming language

"Other programming language" for Perl 5 is a bit strong, I think.
Renovation seems more like it, tendencies towards poetry and
changes to implementations of the core notwithstanding. People
should otherwise be told that it isn't Perl anymore, then we
might see if they react differently.

>> This then will miss the overarching concern during the evaluation of
>> Perl 6, no matter whether the person is perceiving the Perl 6 events
>> at wall clock time or at Perl version time or at Perl 6 perception
>> time: Being able to use Perl, with useful packages, while
>> understanding the syntax, is it.
>
> Should this perhaps have been 'an evaluation'?

Yes.

> If so, I think the
> 'useful packages' are a secondary concern: If the language in itself is
> useful, it can be used within the limits of the available library
> support.

Right. I think that if a scripting language is not intended
to be a better shell then it is essential for it to have
extensive and working library support. (It would be great
to have a better shell.)




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

Date: Wed, 20 Aug 2014 13:32:17 +0100
From: Rainer Weikusat <rweikusat@mobileactivedefense.com>
Subject: Re: perl6 too much pointless functionality
Message-Id: <8761hn9wa6.fsf@sable.mobileactivedefense.com>

John Black <jblack@nospam.com> writes:
> In article <20140819114744.369@kylheku.com>, kaz@kylheku.com says...
>> On 2014-08-12, George Mpouras <gravitalsun@hotmail.foo> wrote:

[mostly good stuff]

>>    (defvar dynamic 1)
>> 
>>    (let ((lexical 2))
>>      (defun test ()
>>        (list dynamic lexical)))
>> 
>>    (let ((dynamic 100)
>>          (lexical 200))
>>      (test))              ->   (100 2)  ;; dynamic now 100

[...]

> I'm not sure if you are trying to prove the original poster's point but none of this is 
> remotely comprehensible to anyone save a handful of people in the
> world.

I'm still amazed how rather superficial, graphical changes can throw
people completely off the tracks. The code above is (mostly) equivalent to

--------------
our $dynamic = 1;

{
	my $lexical = 2;
        sub test { ($dynamic, $lexical); }
}

{
    local $dynamic = 100;
    my $lexical = 200;

    print(join(', ', test()), "\n");
}

print(join(', ', test()), "\n");
--------------

this being a simple example illustrating the difference between
lexically bound dynamically scoped variables ($dynamic) and lexically
scoped variables: The subroutine accesses the $lexical which existed at
the time of its creation, hence, the second value of the returned list
remains 2 despite a different object also named $lexical is created
for the first call but there's only one $dynamic _name_ (existing in the
symbol table of the package), although it may be bound to different
values in different contexts, 100 inside the second block but 1 outside
of it.

And I'm sure a great many people understand that, even despite they
might not be familiar with the LISP-associated terminology for
describing the situation, eg, 'lexically bound dynamically scoped
variable' might be more familiar when being called 'localized global'
(or something like that --- I always think of (let (...) ...) when I
think of local but I knew LISP way before I knew Perl --- I
considered that an extremely exciting/ interesting toy when I was a lot
younger than nowadays :-).

> I think this kind of confusing complexity might be somewhat
> responsible for Perl 6 not being adopted very widely.

As demonstrated above (again), this is nothing which Perl doesn't
already have and has had for a while (syntax is transient, concepts are
persistent ...).


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

Date: Wed, 20 Aug 2014 17:34:08 +0100
From: Rainer Weikusat <rweikusat@mobileactivedefense.com>
Subject: Re: perl6 too much pointless functionality
Message-Id: <87lhqj3ytb.fsf@sable.mobileactivedefense.com>

"G.B." <bauhaus@futureapps.invalid> writes:
> On 19.08.14 20:37, Rainer Weikusat wrote:
>> The original statement was
>>
>> ,----
>> | While there appears to be some concerted work on some
>> | libraries, the creative people still behind Perl 6 seem to spend
>> | more energy on mixing more 7 bit ASCII ideographs with the current
>> | syntax,
>> `----
>>
>> This is an assertion about the present
>
> Correct, but as part of a rant, "present" was meant to address
> that present which is the one anyone will likely consider to
> be "now" when reading at perl6.org, and then commenting here.

Insofar something which makes up Perl6 was designed in the past, nobody
spends anything on that now. 

>
> OTOH, nitpicking, there is this in S02-bits.pod:
>
> "    Last Modified: 18 Aug 2014
> "    Version: 283
>
> "This document summarizes Apocalypse 2, which covers small-scale
> lexical items and typological issues."

The actual change is this here:

https://github.com/perl6/specs/commit/d3c3141b43853874f43d9f2031cfe3462c1e2e85#diff-21ddd2f7467f302ff405498af278b731

which supports the 2nd part of your assertion (Perl6 syntax,
particularly, making creative use non-alphanumerc characters in order to
express things everyone already knew in a way nobody understand anymore
[pun on local $name vs my $*name], is still in flux).

Whether or nor 'more energy' is spent on that vs 'one something else'
(like invading Perl 5 in order to "break one 'cos we can't get other
done") would still need to be determined.

>> Even when leaving this aside, it doesn't make too much sense: Of course,
>> the people who designed Perl6 spent more time on designing a new
>> programming language than on dealing with more-or-less obsolete
>> third-party packages programmed in some other programming language
>
> "Other programming language" for Perl 5 is a bit strong, I think.
> Renovation seems more like it, tendencies towards poetry and
> changes to implementations of the core notwithstanding. People
> should otherwise be told that it isn't Perl anymore, then we
> might see if they react differently.

Syntactically, Java is closer related to C than Perl6 to Perl and
semantically, some things in Perl6 are almost the exact opposite of what
they are in Perl, eg, in Perl @ denotes a set of objects and $ a single
object, that's why @a[5 .. 7] denotes an array slice but $a[6] an
individual object. In Perl6 (AFAIK) @ is just a type-prefix and means
'array' (this is not a statement about the relative merits of either
approach).

>>> This then will miss the overarching concern during the evaluation of
>>> Perl 6, no matter whether the person is perceiving the Perl 6 events
>>> at wall clock time or at Perl version time or at Perl 6 perception
>>> time: Being able to use Perl, with useful packages, while
>>> understanding the syntax, is it.
>>
>> Should this perhaps have been 'an evaluation'?
>
> Yes.
>
>> If so, I think the
>> 'useful packages' are a secondary concern: If the language in itself is
>> useful, it can be used within the limits of the available library
>> support.
>
> Right. I think that if a scripting language is not intended
> to be a better shell then it is essential for it to have
> extensive and working library support. (It would be great
> to have a better shell.)

And I think you're wrong: First and foremost, the language + runtime
environment is useful (or not so useful) for 'programming stuff'. In
case parts of 'stuff' are sufficiently generic and sufficiently
complicated that using a third-party solution seems appropriate,
availabilty of that is an option which is nice to have. OTOH, every
piece of third-party code used is also a liability because it will
have to be maintained and it will also cause work which could have been 
avoided. "There ain't no such thing as a free download".



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

Date: Wed, 20 Aug 2014 18:55:11 +0200
From: "G.B." <bauhaus@futureapps.invalid>
Subject: Re: perl6 too much pointless functionality
Message-Id: <lt2jtr$8jt$1@dont-email.me>

On 20.08.14 18:34, Rainer Weikusat wrote:
>>> If so, I think the
>>> >>'useful packages' are a secondary concern: If the language in itself is
>>> >>useful, it can be used within the limits of the available library
>>> >>support.
>> >
>> >Right. I think that if a scripting language is not intended
>> >to be a better shell then it is essential for it to have
>> >extensive and working library support. (It would be great
>> >to have a better shell.)
> And I think you're wrong: First and foremost, the language + runtime
> environment is useful (or not so useful) for 'programming stuff'. In
> case parts of 'stuff' are sufficiently generic and sufficiently
> complicated that using a third-party solution seems appropriate,
> availabilty of that is an option which is nice to have. OTOH, every
> piece of third-party code used is also a liability because it will
> have to be maintained and it will also cause work which could have been
> avoided. "There ain't no such thing as a free download".

Can we have a quick show of hands?

Who is using Perl in one or more serious projects and either

  [ ] - depends on something from CPAN or equivalent, or
  [ ] - can use just the bare local Perl installation?



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

Date: Wed, 20 Aug 2014 18:11:04 +0100
From: Rainer Weikusat <rweikusat@mobileactivedefense.com>
Subject: Re: perl6 too much pointless functionality
Message-Id: <87ha173x3r.fsf@sable.mobileactivedefense.com>

"G.B." <bauhaus@futureapps.invalid> writes:
> On 20.08.14 18:34, Rainer Weikusat wrote:
>>>> If so, I think the
>>>> >>'useful packages' are a secondary concern: If the language in itself is
>>>> >>useful, it can be used within the limits of the available library
>>>> >>support.
>>> >
>>> >Right. I think that if a scripting language is not intended
>>> >to be a better shell then it is essential for it to have
>>> >extensive and working library support. (It would be great
>>> >to have a better shell.)
>> And I think you're wrong: First and foremost, the language + runtime
>> environment is useful (or not so useful) for 'programming stuff'. In
>> case parts of 'stuff' are sufficiently generic and sufficiently
>> complicated that using a third-party solution seems appropriate,
>> availabilty of that is an option which is nice to have. OTOH, every
>> piece of third-party code used is also a liability because it will
>> have to be maintained and it will also cause work which could have been
>> avoided. "There ain't no such thing as a free download".
>
> Can we have a quick show of hands?
>
> Who is using Perl in one or more serious projects and either
>
>  [ ] - depends on something from CPAN or equivalent, or
>  [ ] - can use just the bare local Perl installation?

What's that supposed to demonstrate? "People use (and sometimes overuse)
available resources"? Can we have another 'show of hands'?

Who has ever used Perl code not downloaded from CPAN?

Who has ever written someting (size notwithstanding) in Perl which
didn't require downloading something from CPAN first?

Who has ever uploaded something to CPAN he initially wrote for his own
use?


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

Date: Wed, 20 Aug 2014 19:57:33 +0200
From: "G.B." <bauhaus@futureapps.invalid>
Subject: Re: perl6 too much pointless functionality
Message-Id: <lt2nic$4e5$1@dont-email.me>

On 20.08.14 19:11, Rainer Weikusat wrote:
>> Can we have a quick show of hands?
>> >
>> >Who is using Perl in one or more serious projects and either
>> >
>> >  [ ] - depends on something from CPAN or equivalent, or
>> >  [ ] - can use just the bare local Perl installation?
> What's that supposed to demonstrate?

A poll is a way to approximate the truth or falsity
of an assertion about a Perl library being typically
a necessary addition to the language.

Since a statistical method, in particular if targeting a NG
only, is so easy to attack from all corners of rhetoric,
I'll stop here.



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

Date: Wed, 20 Aug 2014 19:38:57 +0100
From: Rainer Weikusat <rweikusat@mobileactivedefense.com>
Subject: Re: perl6 too much pointless functionality
Message-Id: <87d2bv3t1a.fsf@sable.mobileactivedefense.com>

"G.B." <bauhaus@futureapps.invalid> writes:
> On 20.08.14 19:11, Rainer Weikusat wrote:
>>> Can we have a quick show of hands?
>>> >
>>> >Who is using Perl in one or more serious projects and either
>>> >
>>> >  [ ] - depends on something from CPAN or equivalent, or
>>> >  [ ] - can use just the bare local Perl installation?
>> What's that supposed to demonstrate?
>
> A poll is a way to approximate the truth or falsity
> of an assertion about a Perl library being typically
> a necessary addition to the language.
>
> Since a statistical method, in particular if targeting a NG
> only, is so easy to attack from all corners of rhetoric,
> I'll stop here.

I didn't ask for your wrong opinion on the value of polls with
self-selecting samples but started a statement with a rethorical
question.




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

Date: Wed, 20 Aug 2014 20:30:27 +0000 (UTC)
From: tmcd@panix.com (Tim McDaniel)
Subject: Whitespace in variable names?
Message-Id: <lt30h3$dsa$1@reader1.panix.com>

Is there any way to have whitespace in a variable name?

-- 
Tim McDaniel, tmcd@panix.com


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

Date: Wed, 20 Aug 2014 21:43:21 +0100
From: Rainer Weikusat <rweikusat@mobileactivedefense.com>
Subject: Re: Whitespace in variable names?
Message-Id: <878umi51ue.fsf@sable.mobileactivedefense.com>

tmcd@panix.com (Tim McDaniel) writes:
> Is there any way to have whitespace in a variable name?

The perldata manpage defines 'identifier' as

	a string beginning with a letter or underscore, and containing
	letters, underscores, and digits

so the answer would be 'no'. It is possible to put arbitrary names into
a Perl symbol table by using symbolic references, though:

[rw@sable]~#perl -MDevel::Peek -e '${"white space"} = 4; Dump(${"white space"});'
SV = IV(0x81b79b4) at 0x81b79b8
  REFCNT = 1
  FLAGS = (IOK,pIOK)
  IV = 4


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

Date: Wed, 20 Aug 2014 14:10:06 -0700
From: Jürgen Exner <jurgenex@hotmail.com>
Subject: Re: Whitespace in variable names?
Message-Id: <ik3av9d2aive68eiltk7uop47jfumgdtej@4ax.com>

tmcd@panix.com (Tim McDaniel) wrote:
>Is there any way to have whitespace in a variable name?

You could use a hash instead.

jue


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

Date: Wed, 20 Aug 2014 21:30:44 +0000 (UTC)
From: tmcd@panix.com (Tim McDaniel)
Subject: Re: Whitespace in variable names?
Message-Id: <lt3424$oo3$1@reader1.panix.com>

In article <ik3av9d2aive68eiltk7uop47jfumgdtej@4ax.com>,
Jürgen Exner  <jurgenex@hotmail.com> wrote:
>tmcd@panix.com (Tim McDaniel) wrote:
>>Is there any way to have whitespace in a variable name?
>
>You could use a hash instead.

Like %:: or %main::?  I'm not really familiar with that, though I've
now found it in "man perlmod".

     $ perl -e '$fred = 23; print($::{fred}, "\n")'
     *main::fred

Why does it have that output?  Is there a way to get it to output 23?

-- 
Tim McDaniel, tmcd@panix.com


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

Date: Thu, 21 Aug 2014 00:40:15 +0300
From: George Mpouras <gravitalsun@hotmail.foo>
Subject: Re: Whitespace in variable names?
Message-Id: <lt34k8$jjm$1@news.ntua.gr>

On 20/8/2014 11:30 μμ, Tim McDaniel wrote:
> Is there any way to have whitespace in a variable name?
>

# method 1

	local ${'Perl variable'} = 20;
	      ${'Perl variable'}++;
	print ${'Perl variable'};

# method 2

	my $var="i am a variable";
	$refglobe = \*$var;
	*{$refglobe}=\100;
	print ${'i am a variable'};



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

Date: Wed, 20 Aug 2014 23:11:24 +0100
From: Rainer Weikusat <rweikusat@mobileactivedefense.com>
Subject: Re: Whitespace in variable names?
Message-Id: <874mx64xrn.fsf@sable.mobileactivedefense.com>

tmcd@panix.com (Tim McDaniel) writes:
> Jürgen Exner  <jurgenex@hotmail.com> wrote:
>>tmcd@panix.com (Tim McDaniel) wrote:
>>>Is there any way to have whitespace in a variable name?
>>
>>You could use a hash instead.
>
> Like %:: or %main::?  I'm not really familiar with that, though I've
> now found it in "man perlmod".
>
>      $ perl -e '$fred = 23; print($::{fred}, "\n")'
>      *main::fred
>
> Why does it have that output?

Because symbol table entries are 'globs' (the Perl equivalent of a LISP
symbol), cf


[rw@sable]/tmp#perl -MDevel::Peek -e '$fred = 23; Dump($::{fred}, "\n")'
SV = PVGV(0x81e6c58) at 0x81d14e8
  REFCNT = 2
  FLAGS = (MULTI,IN_PAD)
  NAME = "fred"
  NAMELEN = 4
  GvSTASH = 0x81b7698   "main"
  GP = 0x81e4970
    SV = 0x81d14fc
    REFCNT = 1
    IO = 0x0
    FORM = 0x0  
    AV = 0x0
    HV = 0x0
    CV = 0x0
    CVGEN = 0x0
    LINE = 1
    FILE = "-e"
    FLAGS = 0xa
    EGV = 0x81d14e8     "fred"

> Is there a way to get it to output 23?

You need to access the scalar stored in the SV slot of the glob, eg, by
using a symbolic reference,

[rw@sable]/tmp#perl -e '$fred = 23; print(${'fred'}, "\n")'
23

or accessing it directly,

[rw@sable]/tmp#perl -e '$fred = 23; print(${*{fred}{SCALAR}}, "\n")'
23


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

Date: Wed, 20 Aug 2014 23:15:50 +0100
From: Rainer Weikusat <rweikusat@mobileactivedefense.com>
Subject: Re: Whitespace in variable names?
Message-Id: <87zjey3izt.fsf@sable.mobileactivedefense.com>

George Mpouras <gravitalsun@hotmail.foo> writes:
> On 20/8/2014 11:30 ¦Ì¦Ì, Tim McDaniel wrote:

[...]

> # method 2
>
> 	my $var="i am a variable";
> 	$refglobe = \*$var;
> 	*{$refglobe}=\100;
> 	print ${'i am a variable'};

 	my $var="i am a variable";
 	$refglobe = \*$var;
 	*{$refglobe}=\100;
 	print ${'i am a variable'}, "\n";

	eval { ${'i am a variable'} = 3; };
	$@ and print("Ups ... seems I'm a constant! ($@) \n");


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

Date: Thu, 21 Aug 2014 01:35:01 +0300
From: George Mpouras <gravitalsun@hotmail.foo>
Subject: Re: Whitespace in variable names?
Message-Id: <lt37qu$red$1@news.ntua.gr>

On 21/8/2014 1:15 ¦Ð¦Ì, Rainer Weikusat wrote:
> George Mpouras <gravitalsun@hotmail.foo> writes:
>> On 20/8/2014 11:30 ¦Ì¦Ì, Tim McDaniel wrote:
>
> [...]
>
>> # method 2
>>
>> 	my $var="i am a variable";
>> 	$refglobe = \*$var;
>> 	*{$refglobe}=\100;
>> 	print ${'i am a variable'};
>
>   	my $var="i am a variable";
>   	$refglobe = \*$var;
>   	*{$refglobe}=\100;
>   	print ${'i am a variable'}, "\n";
>
> 	eval { ${'i am a variable'} = 3; };
> 	$@ and print("Ups ... seems I'm a constant! ($@) \n");
>

you catch me.


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

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>


Administrivia:

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

Back issues are available via anonymous ftp from
ftp://cil-www.oce.orst.edu/pub/perl/old-digests. 

#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 V11 Issue 4274
***************************************


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