Commit | Line | Data |
---|---|---|
d1edabcf GS |
1 | package open; |
2 | ||
3 | =head1 NAME | |
4 | ||
5 | open - perl pragma to set default disciplines for input and output | |
6 | ||
7 | =head1 SYNOPSIS | |
8 | ||
9 | use open IN => ":any", OUT => ":utf8"; # unimplemented | |
10 | ||
11 | =head1 DESCRIPTION | |
12 | ||
13 | NOTE: This pragma is not yet implemented. | |
14 | ||
15 | The open pragma is used to declare one or more default disciplines for | |
16 | I/O operations. Any constructors for file, socket, pipe, or directory | |
17 | handles found within the lexical scope of this pragma will use the | |
18 | declared default. | |
19 | ||
20 | Handle constructors that are called with an explicit set of disciplines | |
21 | are not influenced by the declared defaults. | |
22 | ||
23 | The default disciplines so declared are available by the special | |
24 | discipline name ":def", and can be used within handle constructors | |
25 | that allow disciplines to be specified. This makes it possible to | |
26 | stack new disciplines over the default ones. | |
27 | ||
28 | open FH, "<:para :def", $file or die "can't open $file: $!"; | |
29 | ||
30 | =head1 SEE ALSO | |
31 | ||
32 | L<perlunicode>, L<perlfunc/"open"> | |
33 | ||
34 | =cut | |
35 | ||
36 | 1; |