in reply to Distinguishing variables from surrounding text

Erm, I don't see why you say that using brackets to disambiguate isn't `clean', since that's what it's for (see perldoc perldata, Scalar value constructors). I mean if you really want unclean, use @{[ $foo ]} (but that's just ugly for ugly's sake; not to mention doing strange things to tied vars which pay attention to context).

Replies are listed 'Best First'.
Re: Re: Distinguishing variables from surrounding text
by knobunc (Pilgrim) on Feb 13, 2003 at 17:41 UTC

    Sorry. To clarify, the reason that I don't like saying ${foo} has nothing to do with that syntax. It is in general fine. However for the most part I don't use that syntax in strings. I prefer to say $foo unless I see that the next character is going to cause problems. However in my given case I don't immediately see that the next character will be a problem because it is the leading < which should be fine. Except that I am rewriting the code deeper down. My question really is how can I make the rewriting safer by making sure that there is something safe where the tag used to be so that what the programmer expects to happen actually happens.

    -ben

      How about
      "."
      That's close, concat, open.