[Rt-commit] [rtir] 03/14: Avoid using $1 after a regex which may fail to match
Kevin Falcone
falcone at bestpractical.com
Wed Oct 8 18:11:57 EDT 2014
This is an automated email from the git hooks/post-receive script.
falcone pushed a commit to branch 3.4/perlcritic
in repository rtir.
commit b5806b73606a47423246386c224394cbf0efffe0
Author: Alex Vandiver <alexmv at bestpractical.com>
Date: Thu Jul 21 17:32:48 2011 -0400
Avoid using $1 after a regex which may fail to match
---
lib/RT/IR/Test/Web.pm | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/lib/RT/IR/Test/Web.pm b/lib/RT/IR/Test/Web.pm
index 0339f10..42f2a29 100644
--- a/lib/RT/IR/Test/Web.pm
+++ b/lib/RT/IR/Test/Web.pm
@@ -170,8 +170,8 @@ sub create_incident_for_ir {
Test::More::is ($self->status, 200, "Attempting to create new incident linked to child $ir_id");
- Test::More::ok ($self->content =~ /.*Ticket (\d+) created in queue.*/g, "Incident created from child $ir_id.");
- my $incident_id = $1;
+ my ($incident_id) = $self->content =~ /.*Ticket (\d+) created in queue.*/;
+ Test::More::ok ($incident_id, "Incident created from child $ir_id.");
# diag("incident ID is $incident_id");
return $incident_id;
@@ -270,8 +270,8 @@ sub merge_ticket {
$self->follow_link_ok({text => 'Merge', n => '1'}, "Followed 'Merge' link");
- $self->content() =~ /Merge ([\w ]+) #$id:/i;
- my $type = $1 || 'Ticket';
+ my ($type) = $self->content() =~ /Merge ([\w ]+) #$id:/i;
+ $type ||= 'Ticket';
# Check that the desired incident occurs in the list of available incidents; if not, keep
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the rt-commit
mailing list