Author: lwall Date: 2009-12-11 00:37:21 +0100 (Fri, 11 Dec 2009) New Revision: 29313
Modified: docs/Perl6/Spec/S16-io.pod docs/Perl6/Spec/S32-setting-library/IO.pod Log: [IO] long promised destruction of p{} Modified: docs/Perl6/Spec/S16-io.pod =================================================================== --- docs/Perl6/Spec/S16-io.pod 2009-12-10 21:53:46 UTC (rev 29312) +++ docs/Perl6/Spec/S16-io.pod 2009-12-10 23:37:21 UTC (rev 29313) @@ -82,7 +82,7 @@ The use of filenames requires a special quoting syntax. It works as follows: - p{/path/to/file} + qp{/path/to/file} q:p{/path/to/file} Both of the above result in the same thing. @@ -94,7 +94,7 @@ Naturally you can also ask for interpolation in filenames: - p:qq{$directory/$file} + qp:qq{$directory/$file} qq:p{$directory/$file} There are a number of special adverbs that can be applied to the file quoting @@ -104,7 +104,7 @@ Any path that starts with a "/" is considered an absolute path, otherwise the path is considered relative. -When creating a path with p{}, the Path.Encoding attribute is set to $?ENC, unless +When creating a path with qp{}, the Path.Encoding attribute is set to $?ENC, unless the :bin modifier (see below) is used. =head3 Default constraints Modified: docs/Perl6/Spec/S32-setting-library/IO.pod =================================================================== --- docs/Perl6/Spec/S32-setting-library/IO.pod 2009-12-10 21:53:46 UTC (rev 29312) +++ docs/Perl6/Spec/S32-setting-library/IO.pod 2009-12-10 23:37:21 UTC (rev 29313) @@ -610,7 +610,7 @@ Examples: # Read, no interpolation - $fobj = new IO::File(Path => p{/path/to/file}); + $fobj = new IO::File(Path => qp{/path/to/file}); # Write, interpolation $fobj = new IO::File( @@ -701,7 +701,7 @@ =head2 Path The "Path" role covers both the path to the file, and the file metadata. They -are usually created with the p{/path/to/file} syntax. It could be a directory, +are usually created with the qp{/path/to/file} syntax. It could be a directory, file, link, or something else OS-specific. role Path does Str does Array { @@ -735,7 +735,7 @@ =item new -While new Path objects will normally be created with the p{/path/to/file} +While new Path objects will normally be created with the qp{/path/to/file} syntax, there are also OO-related alternatives. This is called automatically on object creation. @@ -788,15 +788,15 @@ Examples: # These three do the same thing (on a Unix machine) - $path = p{/home/wayland}; + $path = qp{/home/wayland}; $path = new Path(PathElements => ['home', 'wayland']); - $path = new Path(Constraints => ['Unix'], Path => p{/home/wayland}); - $path = new Path(Path => p{/home/wayland}); + $path = new Path(Constraints => ['Unix'], Path => qp{/home/wayland}); + $path = new Path(Path => qp{/home/wayland}); # This creates a symlink from /home/wayland/m to /home/wayland/Music $path = new Path( - Path => p{/home/wayland/m}, - Target => p{/home/wayland/Music}, + Path => qp{/home/wayland/m}, + Target => qp{/home/wayland/Music}, ); =item path @@ -863,6 +863,13 @@ throws an error unless the C<Recursive> option is specified. It returns the number of nodes deleted, and may throw an exception. +=item get + + multi get () + +Returns the next line from $*ARGFILES. (Note that other C<get> functions +and methods are operations on any iterator, not just an IO handle.) + =item lines method lines ($handle: @@ -872,8 +879,17 @@ Any :$nl = "\n", Bool :$chomp = True, --> List - ) is export + ) + multi lines (IO $fh = $*ARGFILES, + Any $limit = *, + Bool :$bin = False, + Str :$enc = "Unicode", + Any :$nl = "\n", + Bool :$chomp = True, + --> List + ) + multi lines (Str $filename, Any $limit = *, Bool :$bin = False, @@ -913,7 +929,12 @@ Bool :$bin = False, Str :$enc = "Unicode", --> Str|Buf - ) is export + ) + multi slurp (IO $fh = $*ARGFILES, + Bool :$bin = False, + Str :$enc = "Unicode", + --> Str|Buf + ) multi slurp (Str $filename, Bool :$bin = False, Str :$enc = "Unicode",