diff options
author | Nick Ing-Simmons <nik@tiuk.ti.com> | 2002-06-17 14:50:35 +0000 |
---|---|---|
committer | Nick Ing-Simmons <nik@tiuk.ti.com> | 2002-06-17 14:50:35 +0000 |
commit | 1cbfc93d1589e4f5f6103e097177be6f791b2cb2 (patch) | |
tree | e61e2f2736138e91ea813b5aee291f3ac147c1e6 /lib | |
parent | aca0daca701f7dcdb767d1bc406a8942960007bc (diff) | |
download | perl-1cbfc93d1589e4f5f6103e097177be6f791b2cb2.tar.gz |
Integrate mainline
p4raw-id: //depot/perlio@17274
Diffstat (limited to 'lib')
-rw-r--r-- | lib/File/Basename.pm | 4 | ||||
-rw-r--r-- | lib/PerlIO.pm | 8 | ||||
-rw-r--r-- | lib/open.pm | 6 |
3 files changed, 13 insertions, 5 deletions
diff --git a/lib/File/Basename.pm b/lib/File/Basename.pm index 37faa6d465..b2ab469594 100644 --- a/lib/File/Basename.pm +++ b/lib/File/Basename.pm @@ -167,6 +167,10 @@ sub fileparse_set_fstype { sub fileparse { my($fullname,@suffices) = @_; + unless (defined $fullname) { + require Carp; + Carp::croak "fileparse(): need a valid pathname"; + } my($fstype,$igncase) = ($Fileparse_fstype, $Fileparse_igncase); my($dirpath,$tail,$suffix,$basename); my($taint) = substr($fullname,0,0); # Is $fullname tainted? diff --git a/lib/PerlIO.pm b/lib/PerlIO.pm index 6bef21fe18..9a4da3a2a3 100644 --- a/lib/PerlIO.pm +++ b/lib/PerlIO.pm @@ -33,8 +33,10 @@ PerlIO - On demand loader for PerlIO layers and root of PerlIO::* name space =head1 SYNOPSIS - open($fh,">:crlf","my.txt") - open($fh,">:raw","his.jpg") + open($fh,">:crlf", "my.txt"); # portably open a text file for writing + + open($fh,"<","his.jpg"); # portably open a binary file for reading + binmode($fh); Shell: PERLIO=perlio perl .... @@ -108,6 +110,8 @@ to a such a stream. =item raw +B<Note that the explicit use of the C<raw> layer is deprecated.> + A pseudo-layer which performs two functions (which is messy, but necessary to maintain compatibility with non-PerlIO builds of Perl and their way things have been documented elsewhere). diff --git a/lib/open.pm b/lib/open.pm index aab99fb713..872d8ea56c 100644 --- a/lib/open.pm +++ b/lib/open.pm @@ -146,7 +146,7 @@ open - perl pragma to set default disciplines for input and output =head1 SYNOPSIS - use open IN => ":crlf", OUT => ":raw"; + use open IN => ":crlf", OUT => ":bytes"; use open OUT => ':utf8'; use open IO => ":encoding(iso-8859-7)"; @@ -263,9 +263,9 @@ Directory handles may also support disciplines in future. =head1 NONPERLIO FUNCTIONALITY If Perl is not built to use PerlIO as its IO system then only the two -pseudo-disciplines ":raw" and ":crlf" are available. +pseudo-disciplines C<:bytes> and C<:crlf> are available. -The ":raw" discipline corresponds to "binary mode" and the ":crlf" +The C<:bytes> discipline corresponds to "binary mode" and the C<:crlf> discipline corresponds to "text mode" on platforms that distinguish between the two modes when opening files (which is many DOS-like platforms, including Windows). These two disciplines are no-ops on |