From cb1380c637a38e3148ffc0ef2cb1a57e9f8cfbe6 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Wed, 12 Dec 2012 10:41:05 -0500 Subject: [PATCH] Bug 9263 - Followup - Improve speed of substitution. References: http://perldoc.perl.org/perlfaq4.html#How-do-I-strip-blank-space-from-the-beginning%2fend-of-a-string%3f http://stackoverflow.com/questions/2313879/why-is-s-s-s-g-so-much-slower-than-two-separate-substitutions --- offline_circ/service.pl | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/offline_circ/service.pl b/offline_circ/service.pl index 30789f3..9b6d447 100755 --- a/offline_circ/service.pl +++ b/offline_circ/service.pl @@ -39,9 +39,11 @@ if ($status eq 'ok') { # if authentication is ok $timestamp = $cgi->param('timestamp') || ''; $action = $cgi->param('action') || ''; $barcode = $cgi->param('barcode') || ''; - $barcode =~ s/^\s+|\s+$//; + $barcode =~ s/^\s+//; + $barcode =~ s/\s+$//; $cardnumber = $cgi->param('cardnumber') || ''; - $cardnumber =~ s/^\s+|\s+$//; + $cardnumber =~ s/^\s+//; + $cardnumber =~ s/\s+$//; if ( $cgi->param('pending') eq 'true' ) { # if the 'pending' flag is true, we store the operation in the db instead of directly processing them $result = AddOfflineOperation( -- 1.7.2.5