Skip to content

Instantly share code, notes, and snippets.

@typester
Created December 10, 2009 12:32
Show Gist options
  • Save typester/253298 to your computer and use it in GitHub Desktop.
Save typester/253298 to your computer and use it in GitHub Desktop.
From 09089d23ab31fa249f18e21966d8f92fed9af1d6 Mon Sep 17 00:00:00 2001
From: Daisuke Murase <typester@cpan.org>
Date: Thu, 10 Dec 2009 21:31:27 +0900
Subject: [PATCH] use isa instead of ref
---
lib/FormValidator/Lite/Upload.pm | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/FormValidator/Lite/Upload.pm b/lib/FormValidator/Lite/Upload.pm
index 4392648..b3470ca 100644
--- a/lib/FormValidator/Lite/Upload.pm
+++ b/lib/FormValidator/Lite/Upload.pm
@@ -21,9 +21,9 @@ sub new {
Carp::croak("missing parameter \$name") unless $name;
my $pkg = do {
- if (ref $q eq 'CGI') {
+ if ($q->isa('CGI')) {
'CGI';
- } elsif (ref $q eq 'HTTP::Engine::Request') {
+ } elsif ($q->isa('HTTP::Engine::Request')) {
'HTTPEngine';
} else {
if ($q->can('upload') && (my $u = $q->upload($name))) {
--
1.6.0.2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment