in reply to Re^7: Indirect variable name
in thread Indirect variable name

Well... now we are entering the domain of taste. My arguments in short:
  1. symderefs are actually considered nonstrict and therefore evil
  2. they can't ever hinder optimization
  3. if they fail, nobody blames the compiler
  4. orthogonality between package vars and lexical should not be broken, even on the dark side of the force.
  5. they have a big advantage to eval, since there is no security risk of code infiltration.

Cheers Rolf

UPDATE: I think your arguments are valid to proof why real refs are much better than the evil symbolic ones. There is no doubt ... but sometimes you can't help but getting dirty to solve a problem. That's why perl has tools like eval helping to dig in the dirt.

Replies are listed 'Best First'.
Re^9: Indirect variable name
by LanX (Saint) on Nov 21, 2008 at 11:20 UTC
    UPDATE2: I think there is indeed a need to syntactically distinguish the two forms of dereferences, maybe by obliging the programmer to enclose symbols in double quotes:
    ${"$sym"}
    But this should be done equally for package and lexical vars, IMHO no need to break orthogonality.

    UPDATE3: But anyway you're bringing a syntax-argument into a semantic-discussion.