This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Re: DRAFT perlpacktut.pod v0.0
[perl5.git] / pod / perlopentut.pod
index d3d9f5a..b158480 100644 (file)
@@ -73,8 +73,8 @@ from a different file, and forget to trim it before opening:
 This is not a bug, but a feature.  Because C<open> mimics the shell in
 its style of using redirection arrows to specify how to open the file, it
 also does so with respect to extra white space around the filename itself
-as well.  For accessing files with naughty names, see L<"Dispelling
-the Dweomer">.
+as well.  For accessing files with naughty names, see 
+L<"Dispelling the Dweomer">.
 
 =head2 Pipe Opens
 
@@ -107,13 +107,13 @@ In most systems, such an C<open> will not return an error. That's
 because in the traditional C<fork>/C<exec> model, running the other
 program happens only in the forked child process, which means that
 the failed C<exec> can't be reflected in the return value of C<open>.
-Only a failed C<fork> shows up there.  See L<perlfaq8/"Why doesn't open()
-return an error when a pipe open fails?"> to see how to cope with this.
-There's also an explanation in L<perlipc>.
+Only a failed C<fork> shows up there.  See 
+L<perlfaq8/"Why doesn't open() return an error when a pipe open fails?"> 
+to see how to cope with this.  There's also an explanation in L<perlipc>.
 
 If you would like to open a bidirectional pipe, the IPC::Open2
-library will handle this for you.  Check out L<perlipc/"Bidirectional
-Communication with Another Process">
+library will handle this for you.  Check out 
+L<perlipc/"Bidirectional Communication with Another Process">
 
 =head2 The Minus File
 
@@ -126,8 +126,8 @@ access the standard output.
 If minus can be used as the default input or default output, what happens
 if you open a pipe into or out of minus?  What's the default command it
 would run?  The same script as you're currently running!  This is actually
-a stealth C<fork> hidden inside an C<open> call.  See L<perlipc/"Safe Pipe
-Opens"> for details.
+a stealth C<fork> hidden inside an C<open> call.  See 
+L<perlipc/"Safe Pipe Opens"> for details.
 
 =head2 Mixing Reads and Writes
 
@@ -175,7 +175,7 @@ L<perlfaq5> for more details.
 
 One of the most common uses for C<open> is one you never
 even notice.  When you process the ARGV filehandle using
-C<E<lt>ARGVE<gt>>, Perl actually does an implicit open 
+C<< <ARGV> >>, Perl actually does an implicit open 
 on each file in @ARGV.  Thus a program called like this:
 
     $ myprogram file1 file2 file3
@@ -189,7 +189,7 @@ using a construct no more complex than:
 
 If @ARGV is empty when the loop first begins, Perl pretends you've opened
 up minus, that is, the standard input.  In fact, $ARGV, the currently
-open file during C<E<lt>ARGVE<gt>> processing, is even set to "-"
+open file during C<< <ARGV> >> processing, is even set to "-"
 in these circumstances.
 
 You are welcome to pre-process your @ARGV before starting the loop to
@@ -239,7 +239,7 @@ Here's an example:
                 or die "can't open $pwdinfo: $!";
 
 This sort of thing also comes into play in filter processing.  Because
-C<E<lt>ARGVE<gt>> processing employs the normal, shell-style Perl C<open>,
+C<< <ARGV> >> processing employs the normal, shell-style Perl C<open>,
 it respects all the special things we've already seen:
 
     $ myprogram f1 "cmd1|" - f2 "cmd2|" f3 < tmpfile
@@ -264,7 +264,7 @@ you can fetch URLs before processing them:
 
     @ARGV = map { m#^\w+://# ? "GET $_ |" : $_ } @ARGV;
 
-It's not for nothing that this is called magic C<E<lt>ARGVE<gt>>.
+It's not for nothing that this is called magic C<< <ARGV> >>.
 Pretty nifty, eh?
 
 =head1 Open E<agrave> la C
@@ -309,7 +309,7 @@ C<O_DEFER>, C<O_SYNC>, C<O_ASYNC>, C<O_DSYNC>, C<O_RSYNC>,
 C<O_NOCTTY>, C<O_NDELAY> and C<O_LARGEFILE>.  Consult your open(2)
 manpage or its local equivalent for details.  (Note: starting from
 Perl release 5.6 the O_LARGEFILE flag, if available, is automatically
-added to the sysopen() flags because large files are the the default.)
+added to the sysopen() flags because large files are the default.)
 
 Here's how to use C<sysopen> to emulate the simple C<open> calls we had
 before.  We'll omit the C<|| die $!> checks for clarity, but make sure
@@ -393,7 +393,7 @@ folders, cookie files, and internal temporary files.
 Sometimes you already have a filehandle open, and want to make another
 handle that's a duplicate of the first one.  In the shell, we place an
 ampersand in front of a file descriptor number when doing redirections.
-For example, C<2E<gt>&1> makes descriptor 2 (that's STDERR in Perl)
+For example, C<< 2>&1 >> makes descriptor 2 (that's STDERR in Perl)
 be redirected into descriptor 1 (which is usually Perl's STDOUT).
 The same is essentially true in Perl: a filename that begins with an
 ampersand is treated instead as a file descriptor if a number, or as a
@@ -444,8 +444,8 @@ these days.  Here's an example of that:
     $fd = $ENV{"MHCONTEXTFD"};
     open(MHCONTEXT, "<&=$fd")   or die "couldn't fdopen $fd: $!";
 
-If you're using magic C<E<lt>ARGVE<gt>>, you could even pass in as a
-command line argument in @ARGV something like C<"E<lt>&=$MHCONTEXTFD">,
+If you're using magic C<< <ARGV> >>, you could even pass in as a
+command line argument in @ARGV something like C<"<&=$MHCONTEXTFD">,
 but we've never seen anyone actually do this.
 
 =head2 Dispelling the Dweomer
@@ -474,7 +474,7 @@ The only vaguely popular system that doesn't work this way is the
 proprietary Macintosh system, which uses a colon where the rest of us
 use a slash.  Maybe C<sysopen> isn't such a bad idea after all.
 
-If you want to use C<E<lt>ARGVE<gt>> processing in a totally boring
+If you want to use C<< <ARGV> >> processing in a totally boring
 and non-magical way, you could do this first:
 
     #   "Sam sat on the ground and put his head in his hands.  
@@ -684,9 +684,9 @@ also some high-level modules on CPAN that can help you with these games.
 Check out Term::ReadKey and Term::ReadLine.
 
 What else can you open?  To open a connection using sockets, you won't use
-one of Perl's two open functions.  See L<perlipc/"Sockets: Client/Server
-Communication"> for that.  Here's an example.  Once you have it,
-you can use FH as a bidirectional filehandle.
+one of Perl's two open functions.  See 
+L<perlipc/"Sockets: Client/Server Communication"> for that.  Here's an 
+example.  Once you have it, you can use FH as a bidirectional filehandle.
 
     use IO::Socket;
     local *FH = IO::Socket::INET->new("www.perl.com:80");
@@ -765,7 +765,7 @@ uses locking and another doesn't, all bets are off.
 
 By default, the C<flock> call will block until a lock is granted.
 A request for a shared lock will be granted as soon as there is no
-exclusive locker.  A request for a exclusive lock will be granted as
+exclusive locker.  A request for an exclusive lock will be granted as
 soon as there is no locker of any kind.  Locks are on file descriptors,
 not file names.  You can't lock a file until you open it, and you can't
 hold on to a lock once the file has been closed.
@@ -846,12 +846,8 @@ the POSIX documentation.
 
 Copyright 1998 Tom Christiansen.  
 
-When included as part of the Standard Version of Perl, or as part of
-its complete documentation whether printed or otherwise, this work may
-be distributed only under the terms of Perl's Artistic License.  Any
-distribution of this file or derivatives thereof outside of that
-package require that special arrangements be made with copyright
-holder.
+This documentation is free; you can redistribute it and/or modify it
+under the same terms as Perl itself.
 
 Irrespective of its distribution, all code examples in these files are
 hereby placed into the public domain.  You are permitted and