in reply to A Question on a homebrew XML parser

Just a minor nitpick here, but in several places you use double quotes("") around pure text (like ">").

Now since "" interpolate variables (ex: "$_>>>>"), and '' do not, and you are not interpolating any vars within the string, there is no need for the double quotes.

It probably doesn't matter much, but like I said, it's a nitpick (you wouldn't use splice(@a,0,1), where you meant shift(@a), now would you?)

  • Comment on Re: A Question on a homebrew XML parser

Replies are listed 'Best First'.
Re: Re: A Question on a homebrew XML parser
by Matts (Deacon) on Jan 24, 2002 at 02:09 UTC
    Actually no.

    Double quotes are optimised away by the compiler. In the case of no variables actually being interpolated, then double quotes work exactly the same way single quotes do. Effectively all the compiler does when it sees a variable in double quotes is turn something like:

    "Error $@ in $file"

    into:

    "Error " . $@ . " in " . $file;

    I know Doug MacEachern was also talking about optimising things so that in some cases you might optimise it into a join, or simply a comma separated list of strings and variables. But I don't think he's submitted any patches to do that just yet.