* 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 /
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;
}
}
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,
#