in reply to Re: Re: Re: Re: Small question: Why can't I print "@-"?
in thread Small question: Why can't I print "@-"?

But I _did_ put a smiley face on my node dude... :-)

Oh, I did see the smiley; it's just in my nature to take such suggestions seriously, I guess. Particularly when they come from you, demerphq.

Although I'm not prejudiced against array interpolation in strings, I'm perfectly happy with using join() instead. (I do agree that avoiding $"||"" is better; it's ugly and prevents joining with "0".)

But, your first suggestion made me shudder.

:-)

-sauoq
"My two cents aren't worth a dime.";
  • Comment on Re: Re: Re: Re: Re: Small question: Why can't I print "@-"?

Replies are listed 'Best First'.
Re: Re: Re: Re: Re: Re: Small question: Why can't I print "@-"?
by demerphq (Chancellor) on Sep 24, 2003 at 00:24 UTC

    (I do agree that avoiding $"||"" is better; it's ugly and prevents joining with "0".)

    Yeah it should be $" // "" or defined $" ? $" : "", but you wouldn't do that normally. :-)

    But, your first suggestion made me shudder.

    That was the point. :-) Seriously tho, that trick can be useful, interpolating constants (which really is calling subs) inside of a string, or more specifically a here doc can be nicer than precalculating and interpolating in.


    ---
    demerphq

      First they ignore you, then they laugh at you, then they fight you, then you win.
      -- Gandhi


      Seriously tho, that trick can be useful, interpolating constants (which really is calling subs) inside of a string, or more specifically a here doc can be nicer than precalculating and interpolating in.

      It can be, but it does come with caveats. Aristotle and I had a short exchange about them once: Re^2: CGI and why?. Basically it boils down to "be wary of context."

      I freely admit to using "@{[...]}" fairly regularly myself, though, so I don't mean to discourage it when it makes sense.

      -sauoq
      "My two cents aren't worth a dime.";