Skip to content

Instantly share code, notes, and snippets.

@vti
Created July 22, 2010 11:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vti/e0da0fd2b6128a296f97 to your computer and use it in GitHub Desktop.
Save vti/e0da0fd2b6128a296f97 to your computer and use it in GitHub Desktop.
diff --git a/lib/Mojo/Base.pm b/lib/Mojo/Base.pm
index 47302aa..2969bb7 100644
--- a/lib/Mojo/Base.pm
+++ b/lib/Mojo/Base.pm
@@ -41,7 +41,7 @@ sub attr {
no strict 'refs';
# Create attributes
- $attrs = ref $attrs eq 'ARRAY' ? $attrs : [$attrs];
+ $attrs = [$attrs] unless ref $attrs eq 'ARRAY';
my $ws = ' ';
for my $attr (@$attrs) {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment