Re: URI stuff

[email protected] (Tatsuhiko Miyagawa)
Newsgroups perl.p5ee
Message-ID <[email protected]>
At Fri, 01 Mar 2002 18:10:35 -0500,
Stephen Adkins wrote:

> I would suggest that you name it something like
> 
>    URI::Resource
> 
> because it represents (in my understanding of it) something
> more than just a stream by which you can retrieve data
> (i.e. the "Resource" that the URI identifies).

Umm but URI's "R" means Resource, so a little verbose IMO. 

> There also is the issue of whether to make it a minimalist
> implementation or a feature-rich implementation.

As a user, I want it to be feature-rich:

  # 'w' means writing
  $handle = URI::Stream->new("file://path", 'w');      # file output
  $handle = URI::Stream->new("ftp://host/path", 'w');  # FTP PUT
  $handle = URI::Stream->new("http://host/path", 'w'); # WebDAV ;)
  $handle = URI::Stream->new('mailto:your@address', 'w'); # send Mail

  # fragment support
  $handle = URI::Stream->new("http://host/path#fragment"); # seeks

  # something like composite pattern
  $dir = URI::Stream->new("ftp://host/path/dir");
  @files = $dir->children; # @files == URI::Stream array

But as a developer, I want to keep it simple and small ;)

-- 
Tatsuhiko Miyagawa
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.