This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Protection against trailing spaces in embed.fnc
[perl5.git] / x2p / a2p.pod
index 4e61fd6..0506e2d 100644 (file)
@@ -41,6 +41,29 @@ Any delimiter can be used to separate the field names.
 
 causes a2p to assume that input will always have that many fields.
 
+=item B<-o>
+
+tells a2p to use old awk behavior.  The only current differences are:
+
+=over 5
+
+=item *
+
+Old awk always has a line loop, even if there are no line
+actions, whereas new awk does not.
+
+=item *
+
+In old awk, sprintf is extremely greedy about its arguments.
+For example, given the statement
+
+       print sprintf(some_args), extra_args;
+
+old awk considers I<extra_args> to be arguments to C<sprintf>; new awk
+considers them arguments to C<print>.
+
+=back
+
 =back
 
 =head2 "Considerations"
@@ -82,13 +105,13 @@ block to bypass the block under such circumstances can be simplified
 by removing the conditional in the END block and just exiting directly
 from the perl script.
 
-Perl has two kinds of array, numerically-indexed and associative.  Awk
-arrays are usually translated to associative arrays, but if you happen
-to know that the index is always going to be numeric you could change
-the {...} to [...].  Iteration over an associative array is done using
-the keys() function, but iteration over a numeric array is NOT.  You
-might need to modify any loop that is iterating over the array in
-question.
+Perl has two kinds of array, numerically-indexed and associative.
+Perl associative arrays are called "hashes".  Awk arrays are usually
+translated to hashes, but if you happen to know that the index is
+always going to be numeric you could change the {...} to [...].
+Iteration over a hash is done using the keys() function, but iteration
+over an array is NOT.  You might need to modify any loop that iterates
+over such an array.
 
 Awk starts by assuming OFMT has the value %.6g.  Perl starts by
 assuming its equivalent, $#, to have the value %.20g.  You'll want to