X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=pod%2Fperlfaq6.pod;h=4e5ba50ee5167b880fa638aaaa732d1b3898c98e;hb=d672126634c5e568812ed35d4c8ea53a9a55ee4c;hp=fe53ea8ab0ea01ad4e962a02bfd6b1542e14fbf8;hpb=fe854a6f990f7776a8ee8bd28f02e1bd36e5bb58;p=p5sagit%2Fp5-mst-13.2.git diff --git a/pod/perlfaq6.pod b/pod/perlfaq6.pod index fe53ea8..4e5ba50 100644 --- a/pod/perlfaq6.pod +++ b/pod/perlfaq6.pod @@ -1,6 +1,6 @@ =head1 NAME -perlfaq6 - Regexes ($Revision: 1.5 $, $Date: 2001/12/02 01:55:12 $) +perlfaq6 - Regular Expressions ($Revision: 1.12 $, $Date: 2002/06/01 22:31:09 $) =head1 DESCRIPTION @@ -9,7 +9,7 @@ littered with answers involving regular expressions. For example, decoding a URL and checking whether something is a number are handled with regular expressions, but those answers are found elsewhere in this document (in L: ``How do I decode or create those %-encodings -on the web'' and L: ``How do I determine whether a scalar is +on the web'' and L: ``How do I determine whether a scalar is a number/whole/integer/float'', to be precise). =head2 How can I hope to use regular expressions without creating illegible and unmaintainable code? @@ -70,9 +70,9 @@ delimiter within the pattern: =head2 I'm having trouble matching over more than one line. What's wrong? -Either you don't have more than one line in the string you're looking at -(probably), or else you aren't using the correct modifier(s) on your -pattern (possibly). +Either you don't have more than one line in the string you're looking +at (probably), or else you aren't using the correct modifier(s) on +your pattern (possibly). There are many ways to get multiline data into a string. If you want it to happen automatically while reading input, you'll want to set $/ @@ -166,7 +166,7 @@ appear within a certain time. close FH; ## Get a read/write filehandle to it. - $fh = new FileHandle "+). =head2 What's wrong with using grep or map in a void context? -Both grep and map build a return list, regardless of their context. -This means you're making Perl go to the trouble of building up a -return list that you then just ignore. That's no way to treat a -programming language, you insensitive scoundrel! +The problem is that both grep and map build a return list, +regardless of the context. This means you're making Perl go +to the trouble of building a list that you then just throw away. +If the list is large, you waste both time and space. If your +intent is to iterate over the list then use a for loop for this +purpose. =head2 How can I match strings with multibyte characters? @@ -728,7 +730,7 @@ in L. =head1 AUTHOR AND COPYRIGHT -Copyright (c) 1997-1999 Tom Christiansen and Nathan Torkington. +Copyright (c) 1997-2002 Tom Christiansen and Nathan Torkington. All rights reserved. This documentation is free; you can redistribute it and/or modify it