Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Re: Re: Sometimes it's in Void Context

by ariels (Curate)
on Jun 03, 2002 at 08:45 UTC ( #171171=note: print w/replies, xml ) Need Help??


in reply to Re: Re: Sometimes it's in Void Context
in thread Sometimes it's in Void Context

I don't see the issue here, sorry.

$lines[0] = [3,2,1]: here we agree that [3,2,1] must mean an array reference.

$lines[0][3,2,1]: I fail to see how this can parse as something like ``$lines[ARRAY(0x1a7efd8)]'' (i.e. [3,2,1] becomes an array reference, which is "numericalised" into the value 0x1a7efd8. For that, you'd need an extra set of square brackets: the inner pair delimits an array reference, the outer pair delimits an array index! Indeed, testing $lines[0][[3,2,1]] shows that it behaves as a numericalised array reference.

I can see nowhere in the "grammar" of Perl (I use the term loosely...) where both a scalar value (such as an array reference!) and an array subscript are legal. So there's no problem here.

Replies are listed 'Best First'.
Re: Re: Re: Re: Sometimes it's in Void Context
by theorbtwo (Prior) on Jun 03, 2002 at 08:52 UTC

    (BTW, formaly speaking, perl /almost/ has a grammar: look at perly.y in the source tree.)


    We are using here a powerful strategy of synthesis: wishful thinking. -- The Wizard Book

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://171171]
help
Chatterbox?
[Eily]: Maybe the puns in his dialogues were somehow kept through translation, but I can tell he lost his accent
[LanX]: qui?
[Eily]: Astérix
1nickt gives up on finding a Perl YAML parser that supports hash merging. In 2017.
[LanX]: Oh yes true, he lost his accent! xD
[Eily]: and since his name is a modified version of astérisque (asterisk), which is a typographical symbol, I think it's even funnier that he would lose a diacritic
[Eily]: the pun doesn't work so well with "he lost a diacritic" though :P
[LanX]: Obelix might offer to find it again ...
[LanX]: not much to translate anyway since Goscinny died
[Eily]: https://en. wikipedia.org/ wiki/List_of_Aster ix_characters some of the names were changed to include a new pun

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (13)
As of 2017-05-24 14:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?