summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>2000-03-01 05:55:20 +0000
committerGurusamy Sarathy <gsar@cpan.org>2000-03-01 05:55:20 +0000
commitd1edabcfc0953113eff6d4bda774297dc66644b9 (patch)
treef4266884bbe4c54c73e0342392d531c8e79e8db0
parent2fa86c13816417d1d62616d1bb8114a5a9831c33 (diff)
downloadperl-d1edabcfc0953113eff6d4bda774297dc66644b9.tar.gz
update Todo-5.6, add stub open.pm
p4raw-id: //depot/perl@5392
-rw-r--r--MANIFEST1
-rw-r--r--Todo-5.617
-rw-r--r--lib/open.pm36
3 files changed, 46 insertions, 8 deletions
diff --git a/MANIFEST b/MANIFEST
index bf39be2da2..d0e88b5c43 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -713,6 +713,7 @@ lib/lib.pm For "use lib"
lib/locale.pm For "use locale"
lib/look.pl A "look" equivalent
lib/newgetopt.pl A perl library supporting long option parsing
+lib/open.pm Pragma to specify default I/O disciplines
lib/open2.pl Open a two-ended pipe (uses IPC::Open2)
lib/open3.pl Open a three-ended pipe (uses IPC::Open3)
lib/overload.pm Module for overloading perl operators
diff --git a/Todo-5.6 b/Todo-5.6
index 8ae31ad497..d220c97228 100644
--- a/Todo-5.6
+++ b/Todo-5.6
@@ -2,18 +2,19 @@ Bugs
fix small memory leaks on compile-time failures
Unicode support
- finish byte <-> utf8 and localencoding <-> utf8 conversions
- make substr($bytestr,0,0, $charstr) do the right conversion
+ finish byte <-> utf8 and localencoding <-> utf8 conversions
+ make substr($bytestr,0,0,$charstr) do the right conversion
add Unicode::Map equivivalent to core
add support for I/O disciplines
- - open(F, "<!crlf!utf16", $file)
- - binmode(STDIN, "<!crlf!utf16")?
- - a way to set the "system" discipline (binmode("!crlf!utf16") maybe?)
- - nice IO::Filter module to push/pop disciplines
+ - a way to specify disciplines when opening things:
+ open(F, "<:crlf :utf16", $file)
+ - a way to specify disciplines for an already opened handle:
+ binmode(STDIN, ":slurp :raw")
+ - a way to set default disciplines for all handle constructors:
+ use open IN => ":any", OUT => ":utf8", SYS => ":utf16"
eliminate need for "use utf8;"
- support C<print v1.2.3>
- make C<v123> mean C<chr(123)> (if !exists(&v123))
autoload utf8_heavy.pl's swash routines in swash_init()
+ autoload byte.pm when byte:: is seen by the parser
check uv_to_utf8() calls for buffer overflow
Multi-threading
diff --git a/lib/open.pm b/lib/open.pm
new file mode 100644
index 0000000000..da8a04453c
--- /dev/null
+++ b/lib/open.pm
@@ -0,0 +1,36 @@
+package open;
+
+=head1 NAME
+
+open - perl pragma to set default disciplines for input and output
+
+=head1 SYNOPSIS
+
+ use open IN => ":any", OUT => ":utf8"; # unimplemented
+
+=head1 DESCRIPTION
+
+NOTE: This pragma is not yet implemented.
+
+The open pragma is used to declare one or more default disciplines for
+I/O operations. Any constructors for file, socket, pipe, or directory
+handles found within the lexical scope of this pragma will use the
+declared default.
+
+Handle constructors that are called with an explicit set of disciplines
+are not influenced by the declared defaults.
+
+The default disciplines so declared are available by the special
+discipline name ":def", and can be used within handle constructors
+that allow disciplines to be specified. This makes it possible to
+stack new disciplines over the default ones.
+
+ open FH, "<:para :def", $file or die "can't open $file: $!";
+
+=head1 SEE ALSO
+
+L<perlunicode>, L<perlfunc/"open">
+
+=cut
+
+1;