James Mastros wrote:
> >     print $::OUT http://www.wall.org/~larry/index.html;
> Please, no!  A URL isn't a /new/ type of literal, really.
> Either it's a > wierd form of a literal list, or it's a
> wierd type of file name, so you should open() it.  Or it's
> a self-quoting literal, like Packagename::.  If you
> really want to be able to read from a URL in one line,
> let yourself do <open(foo)>.  But make opening a URL an
> explicit act.

I agree that an implicit "open plus get" would be a bit much.
However, I see nothing wrong with defining a new form of
literal, especially if everything acts like an object.

It would be nice to say:

$mySite = http://www.foo.bar/text.html;

and then

$mySite->get(...);
$mySite->post(...);

even:

$page = <$mySite>;
$page = <http://www.foo.bar/text.html>;

I could go further: If I'm reading a URL of type html then, after reading
it, I should be able to say:

$header = $page->head;
$title = $page->title;

etc.

I think what I'm saying is that we shouldn't think in terms of strings
unless a method is evaluated in a "string context". Until its reduced to a
string, a literal (or any other value) should maintain its class.


Dave.
--
Dave Whipp, Senior Verification Engineer,
Fast-Chip inc., 950 Kifer Rd, Sunnyvale, CA. 94086
tel: 408 523 8071; http://www.fast-chip.com
Opinions my own; statements of fact may be in error.

Reply via email to