Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Confused by a couple of idioms

by nysus (Vicar)
on Feb 21, 2019 at 22:12 UTC ( #1230335=note: print w/replies, xml ) Need Help??


in reply to Confused by a couple of idioms

PS, I know the backslash is probably a reference, but I've never seen it used before my like this. I just didn't think anything like this was syntactically possible.

$PM = "Perl Monk's";
$MCF = "Most Clueless Friar Abbot Bishop Pontiff Deacon Curate Priest Vicar";
$nysus = $PM . ' ' . $MCF;
Click here if you love Perl Monks

Replies are listed 'Best First'.
Re^2: Confused by a couple of idioms
by Anonymous Monk on Feb 22, 2019 at 02:15 UTC
    Dont be afraid of that. It's just a precedence issue, precedence of my operator is higher than reference op, no more other mysteries. You are maybe used to open (my $fh,....) it's the same.
      ... And a handy precedence list can be found in perlcheat.

      I have a question about precedence of my. Isn't it a 'named uop', as I thought, or is it absent from precedent list? E.g.
      perl -wle 'print( my $i ** 2 )' #Use of uninitialized value $i in exponentiation (**) at -e line 1. #0
      perl -wle 'print( my ( $i ** 2 ) )' #Can't declare exponentiation (**) in "my" at -e line 1, near ") ) #" #Execution of -e aborted due to compilation errors.
      It looks that precedence of 'my' is higher than usual 'named uops'.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1230335]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (5)
As of 2019-06-27 08:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Is there a future for codeless software?



    Results (111 votes). Check out past polls.

    Notices?