afuna_archive: (Default)
[personal profile] afuna_archive
Damn. PHP also uses @$. First thing I thought when I saw it was, "Oh neat, it's dereferencing an array reference." Then I realized a) the variable on the LHS wasn't an array, and b) I was in the wrong language.

(It's used for error control instead, which is also neat in its own way, I guess.)

Date: 2008-01-04 03:55 am (UTC)
From: [identity profile] ciaran-h.livejournal.com
PHP makes me go :(.

Date: 2008-01-04 11:46 am (UTC)
pauamma: Cartooney crab wearing hot pink and acid green facemask holding drink with straw (Default)
From: [personal profile] pauamma
At least, PHP doesn't consider @$@ to mean something. :-)

Date: 2008-01-04 02:11 pm (UTC)
afuna: Cat under a blanket. Text: "Cats are just little people with Fur and Fangs" (Default)
From: [personal profile] afuna
...okay. I give up. What does it mean? :)

Date: 2008-01-04 02:29 pm (UTC)
pauamma: Cartooney crab wearing hot pink and acid green facemask holding drink with straw (Default)
From: [personal profile] pauamma
From perldoc perlvar:

       $@      The Perl syntax error message from the last eval() operator.
               If $@ is the null string, the last eval() parsed and executed
               correctly (although the operations you invoked may have failed
               in the normal fashion).  (Mnemonic: Where was the syntax error
               "at"?)


(and @ is the array dereference)

Date: 2008-01-04 02:30 pm (UTC)
pauamma: Cartooney crab wearing hot pink and acid green facemask holding drink with straw (Default)
From: [personal profile] pauamma
(Yes, you can actually assign an arrayref to $@. I tried.)

Date: 2008-01-05 08:48 am (UTC)
afuna: Cat under a blanket. Text: "Cats are just little people with Fur and Fangs" (Default)
From: [personal profile] afuna
Oh interesting. Have you ever used it? *curious* (And not just to test ;p)

Date: 2008-01-06 01:42 am (UTC)
pauamma: Cartooney crab wearing hot pink and acid green facemask holding drink with straw (Default)
From: [personal profile] pauamma
I have used $@ in code meant to Do Something Useful, but not to store an arrayref in it. You can pass a blessed reference to die inside an eval, which would set $@ to that reference, but blessed references are usually hashrefs (or pseudohash refs a la fields::phash), not arrayrefs.

Date: 2008-01-08 04:18 pm (UTC)
afuna: Cat under a blanket. Text: "Cats are just little people with Fur and Fangs" (Default)
From: [personal profile] afuna
"pass a blessed reference to die inside an eval"
Something about these words together makes me think of a video game :-)

And hmmm. *nods thoughtfully*

Date: 2008-01-04 02:13 pm (UTC)
afuna: Cat under a blanket. Text: "Cats are just little people with Fur and Fangs" (Default)
From: [personal profile] afuna
Hee. It's somewhat simple and easy to learn which means there's a *lot* of bad code out there written by people who don't know better, but I don't find PHP itself that bad.

Profile

afuna_archive: (Default)
afuna_archive

June 2009

S M T W T F S
  1 2 3 4 5 6
7 8 9 10 11 1213
14151617181920
21222324252627
282930    

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Jul. 9th, 2025 04:47 am
Powered by Dreamwidth Studios