John M. Dlugosz has asked for the wisdom of the Perl Monks concerning the following question:

I know that you can use % to mention characters that can't appear directly in a HREF. But what about in the corresponding A NAME? What can go in the quotes? Does that get escaped out too, or can it be taken literally?

Example,

print (qq(<A NAME= "operator+="></A>)); ... other stuff. my $temp= URI_escape ("operator+="); print (qq(A HREF= "#$temp">operator+=</A>));
My first thought was to avoid non-alpha chars by mapping the names to an internal form. But if I can handle them more directly, that would be better. What's in a NAME, as Shakespere once penned?

—John

Replies are listed 'Best First'.
Re: generating A NAME tags in HTML output
by Fastolfe (Vicar) on Nov 26, 2001 at 03:11 UTC
      ID and NAME tokens must begin with a letter ([A-Za-z]) and may be followed by any number of letters, digits ([0-9]), hyphens ("-"), underscores ("_"), colons (":"), and periods (".").
      OK, assuming that the NAME in A NAME is a NAME token in SGML, that pretty much covers it.

      Thanks,

      —John

        ...may be followed by any number of letters...

        I assume that with "letters" you mean 'a' to 'z'? (There are many other characters that many, many people consider letters.)

        Update: That's when I finally read the post I answered. Doh! Me bad. Forget it.

        f--k the world!!!!
        /dev/world has reached maximal mount count, check forced.