Re: [Boston.pm] $/ and pattern matching

2002-09-24 Thread darren chamberlain
* Erik Price [EMAIL PROTECTED] [2002-09-23 17:30]: Anyone know of a way to get a regular expression to respect the input record separator ( $/ ), so that $ represents the end of a line as defined by $/ ? I'd do it a little differently: local $/; my $mileage; my @milage = split /

Re: [Boston.pm] $/ and pattern matching

2002-09-24 Thread Erik Price
On Tuesday, September 24, 2002, at 08:18 AM, darren chamberlain wrote: I'd do it a little differently: local $/; my $mileage; my @milage = split //, DATA; # -- the string with your data for (@milage) { if (m/(\d+\.\d{1,2})$/) { $mileage += $1; } }

[Boston.pm] $/ and pattern matching

2002-09-23 Thread Erik Price
Anyone know of a way to get a regular expression to respect the input record separator ( $/ ), so that $ represents the end of a line as defined by $/ ? Here's my code: #!/usr/bin/perl -w use strict; $/ = '';# my input data is not newline separated, #