diff options
author | jeff <jeff> | 2009-02-12 19:48:24 +0000 |
---|---|---|
committer | jeff <jeff> | 2009-02-12 19:48:24 +0000 |
commit | 38c9750a1c91c591b2c6df5c5dbcfa60dd8eb682 (patch) | |
tree | d6ece9b1eb48a23103119d0de1a2147a04fe333d /FS/FS/tax_rate.pm | |
parent | 07a313acb1d91488c6aa6044771f3136d5a6fe11 (diff) |
proper match arguments help
Diffstat (limited to 'FS/FS/tax_rate.pm')
-rw-r--r-- | FS/FS/tax_rate.pm | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/FS/FS/tax_rate.pm b/FS/FS/tax_rate.pm index d468e60..291e2d5 100644 --- a/FS/FS/tax_rate.pm +++ b/FS/FS/tax_rate.pm @@ -913,10 +913,12 @@ sub process_batch_import { UNLINK => 0, #meh ) or die "can't open temp file: $!\n"; + my $insert_pattern = ($format eq 'cch-update') ? qr/"I"\s*$/ : qr/I\s*$/; + my $delete_pattern = ($format eq 'cch-update') ? qr/"D"\s*$/ : qr/D\s*$/; while(<$fh>) { my $handle = ''; - $handle = $ifh if $_ =~ /"I"\s*$/; - $handle = $dfh if $_ =~ /"D"\s*$/; + $handle = $ifh if $_ =~ /$insert_pattern/; + $handle = $dfh if $_ =~ /$delete_pattern/; unless ($handle) { $error = "bad input line: $_" unless $handle; last; |