Note that the HTML a shortcut does an escapeHTML on the HREF attribute automatically. The manual equivalent would be:#!/usr/bin/perl use CGI qw(:all); use URI::Escape; print header, start_html("sample"), h1("sample"); print map { a({ -href => uri_escape($_)}, escapeHTML($_)), br } glob " +*"; print end_html;
Yes, all that escaping is necessary. Do not shirk.print '<A HREF="', escapeHTML(uri_escape($_)), '">', escapeHTML($_), '</A>';
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Dump a directory as links from CGI
by epoptai (Curate) on May 31, 2001 at 01:52 UTC | |
by merlyn (Sage) on May 31, 2001 at 02:39 UTC | |
by epoptai (Curate) on May 31, 2001 at 06:51 UTC | |
by merlyn (Sage) on May 31, 2001 at 07:02 UTC | |
by cLive ;-) (Prior) on Jun 03, 2001 at 03:35 UTC |