<br><font size=2 face="sans-serif">Nothing super sneaky, I just prefer
the OO interfaces. This just uses join.</font>
<br>
<br><font size=2 face="sans-serif">use strict;</font>
<br><font size=2 face="sans-serif">use IO::File;</font>
<br>
<br><font size=2 face="sans-serif">{</font>
<br><font size=2 face="sans-serif"> my $fh = new IO::File
'Colours.xml';</font>
<br><font size=2 face="sans-serif"> my $file = join '', $fh->getlines;</font>
<br>
<br><font size=2 face="sans-serif"> print $file;</font>
<br><font size=2 face="sans-serif">}</font>
<br><font size=2 face="sans-serif"><br>
---<br>
Rick Croote<br>
Software Engineer<br>
Environment and Tools Team<br>
Philips Medical Systems<br>
Bothell, WA<br>
Rick.Croote@Philips.com<br>
Phone: 425-487-7834<br>
</font>
<br><font size=1 color=#800080 face="sans-serif">----- Forwarded by Rick
Croote/ATL-BTL/MS/PHILIPS on 2005-07-20 06:44 PM -----</font>
<br>
<br><font size=2><tt>spug-list-bounces@pm.org wrote on 2005-07-20 06:24:49
PM:<br>
<br>
> I just found this, is this the best practice?<br>
> <br>
> while ( <COLOURS> )<br>
> {<br>
> $myfile = $myfile . $_;<br>
> }<br>
> <br>
> Duane<br>
> <br>
> On 7/20/05, Duane Blanchard <dblanchard@gmail.com> wrote:<br>
> > Hi gang,<br>
> > <br>
> > I'm too tired to think straight and too tired to keep looking
on the<br>
> > 'Net. I want to match things like 'line\s+that' in the example
file<br>
> > below.<br>
> > <br>
> > <file><br>
> > this is a line<br>
> > that is a line<br>
> > </file><br>
> > <br>
> > What has worn me out today is not realizing that I'll never match<br>
> > across lines of a file if I only read one line at a time. So,
I either<br>
> > need a clever way to match across elements of an array or hash
table,<br>
> > or (more likely) to read the whole file into a scalar. As I recall,<br>
> > I'll use the 'm' flag to hand the RE more than one line, and
'\s'<br>
> > should handle '\n'.<br>
> > <br>
> > Someone, please give a little pointer. Thanks,<br>
> > <br>
> > D<br>
> > --<br>
> > Duane Blanchard<br>
> > 206.934.5873<br>
> > <br>
> > There are 10 kinds of people in the world;<br>
> > those who know binary and those who don't.<br>
> > _____________________________________________________________<br>
> > Seattle Perl Users Group Mailing List<br>
> > POST TO: spug-list@pm.org<br>
> > SUBSCRIPTION: http://mail.pm.org/mailman/listinfo/spug-list<br>
> > MEETINGS: 3rd Tuesdays, Location: Amazon.com Pac-Med<br>
> > WEB PAGE: http://seattleperl.org/<br>
> > <br>
> <br>
> <br>
> -- <br>
> Duane Blanchard<br>
> 206.934.5873<br>
> <br>
> There are 10 kinds of people in the world;<br>
> those who know binary and those who don't.<br>
> _____________________________________________________________<br>
> Seattle Perl Users Group Mailing List <br>
> POST TO: spug-list@pm.org<br>
> SUBSCRIPTION: http://mail.pm.org/mailman/listinfo/spug-list<br>
> MEETINGS: 3rd Tuesdays, Location: Amazon.com Pac-Med<br>
> WEB PAGE: http://seattleperl.org/<br>
</tt></font>