perlfaq6: I put a regular expression into $/ but it didn't work. What's wrong?

[email protected] (_brian_d_foy)
Newsgroups perl.perlfaq.workers,perl.documentation
Message-ID <301020040736112843%[email protected]>
* Mention File::Stream



Index: perlfaq6.pod
===================================================================
RCS file: /cvs/public/perlfaq/perlfaq6.pod,v
retrieving revision 1.26
diff -u -d -r1.26 perlfaq6.pod
--- perlfaq6.pod        25 Oct 2004 18:47:04 -0000      1.26
+++ perlfaq6.pod        30 Oct 2004 12:25:27 -0000
@@ -151,7 +151,17 @@
 but don't get your hopes up. Until then, you can use these examples
 if you really need to do this.
 
-Use the four argument form of sysread to continually add to
+If you have File::Stream, this is easy.
+
+                        use File::Stream;
+                        my $stream = File::Stream->new($filehandle);
+
+                        $/ = qr/\s*,\s*/;
+                        print "$_\n" while <$stream>;
+
+If you don't have File::Stream, you have to do a little more work.
+
+You can use the four argument form of sysread to continually add to
 a buffer.  After you add to the buffer, you check if you have a
 complete line (using your regular expression).

-- 
brian d foy, [email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.