diff --git a/lib/CharmBoard.pm b/lib/CharmBoard.pm index abdb9fa..5a7e183 100644 --- a/lib/CharmBoard.pm +++ b/lib/CharmBoard.pm @@ -3,7 +3,8 @@ package CharmBoard; use utf8; use strict; use warnings; -use experimental qw(try smartmatch); +use experimental qw(try); +use feature ':5.20'; use Mojo::Base 'Mojolicious', -signatures; use CharmBoard::Model::Schema; @@ -37,11 +38,11 @@ sub startup { # ? this could maybe be a given/when { my ($_dsn, $_unicode); - if ($self->config->{database}->{type} ~~ 'sqlite') { + if (lc($self->config->{database}->{type}) eq 'sqlite') { $_dsn = "dbi:SQLite:" . $config->{database}->{name}; $_unicode = "sqlite_unicode" - } elsif ($self->config->{database}->{type} ~~ 'mariadb') { + } elsif (lc($self->config->{database}->{type}) eq 'mariadb') { $_dsn = "dbi:mysql:" . $config->{database}->{name}; $_unicode = "mysql_enable_utf" diff --git a/lib/CharmBoard/Controller/Index.pm b/lib/CharmBoard/Controller/Index.pm index 43c39db..8658f9a 100644 --- a/lib/CharmBoard/Controller/Index.pm +++ b/lib/CharmBoard/Controller/Index.pm @@ -3,7 +3,8 @@ package CharmBoard::Controller::Index; use utf8; use strict; use warnings; -use experimental qw(try smartmatch); +use experimental qw(try); +use feature ':5.20'; use Mojo::Base 'Mojolicious::Controller', -signatures; use Tree::Simple; diff --git a/lib/CharmBoard/Controller/Login.pm b/lib/CharmBoard/Controller/Login.pm index 1d9a978..63d1b66 100644 --- a/lib/CharmBoard/Controller/Login.pm +++ b/lib/CharmBoard/Controller/Login.pm @@ -3,7 +3,8 @@ package CharmBoard::Controller::Login; use utf8; use strict; use warnings; -use experimental qw(try smartmatch); +use experimental qw(try); +use feature ':5.20'; use Mojo::Base 'Mojolicious::Controller', -signatures; use CharmBoard::Model::Crypt::Password; diff --git a/lib/CharmBoard/Controller/Logout.pm b/lib/CharmBoard/Controller/Logout.pm index 61c461b..3e24b9f 100644 --- a/lib/CharmBoard/Controller/Logout.pm +++ b/lib/CharmBoard/Controller/Logout.pm @@ -3,7 +3,8 @@ package CharmBoard::Controller::Logout; use utf8; use strict; use warnings; -use experimental qw(try smartmatch); +use experimental qw(try); +use feature ':5.20'; use Mojo::Base 'Mojolicious::Controller', -signatures; diff --git a/lib/CharmBoard/Controller/NewThread.pm b/lib/CharmBoard/Controller/NewThread.pm index 9db6b1c..89f330f 100644 --- a/lib/CharmBoard/Controller/NewThread.pm +++ b/lib/CharmBoard/Controller/NewThread.pm @@ -3,7 +3,8 @@ package CharmBoard::Controller::NewThread; use utf8; use strict; use warnings; -use experimental qw(try smartmatch); +use experimental qw(try); +use feature ':5.20'; use Mojo::Base 'Mojolicious::Controller', -signatures; diff --git a/lib/CharmBoard/Controller/Register.pm b/lib/CharmBoard/Controller/Register.pm index 5b9e86c..8ac5d8a 100644 --- a/lib/CharmBoard/Controller/Register.pm +++ b/lib/CharmBoard/Controller/Register.pm @@ -3,7 +3,8 @@ package CharmBoard::Controller::Register; use utf8; use strict; use warnings; -use experimental qw(try smartmatch); +use experimental qw(try); +use feature ':5.20'; use Mojo::Base 'Mojolicious::Controller', -signatures; use CharmBoard::Model::Crypt::Password; @@ -54,6 +55,7 @@ sub register_do { $emailCheck = $self->schema->resultset('Users') ->search({ email => $email })->single; + # TODO: compress this into something less redundant ($userCheck && $emailCheck) eq undef or die "Username already in use.\nemail already in use."; ($userCheck) eq undef diff --git a/lib/CharmBoard/Controller/ViewSubf.pm b/lib/CharmBoard/Controller/ViewSubf.pm index e65aed5..738dd4d 100644 --- a/lib/CharmBoard/Controller/ViewSubf.pm +++ b/lib/CharmBoard/Controller/ViewSubf.pm @@ -3,7 +3,8 @@ package CharmBoard::Controller::ViewSubf; use utf8; use strict; use warnings; -use experimental qw(try smartmatch); +use experimental qw(try); +use feature ':5.20'; use Mojo::Base 'Mojolicious::Controller', -signatures; diff --git a/lib/CharmBoard/Model/Crypt/Password.pm b/lib/CharmBoard/Model/Crypt/Password.pm index 810f5ae..8ca80c4 100644 --- a/lib/CharmBoard/Model/Crypt/Password.pm +++ b/lib/CharmBoard/Model/Crypt/Password.pm @@ -3,7 +3,8 @@ package CharmBoard::Model::Crypt::Password; use utf8; use strict; use warnings; -use experimental qw(try smartmatch); +use experimental qw(try); +use feature ':5.20'; use Authen::Passphrase::Argon2; use CharmBoard::Model::Crypt::Seasoning; diff --git a/lib/CharmBoard/Model/Crypt/Seasoning.pm b/lib/CharmBoard/Model/Crypt/Seasoning.pm index 3da074f..20965e2 100644 --- a/lib/CharmBoard/Model/Crypt/Seasoning.pm +++ b/lib/CharmBoard/Model/Crypt/Seasoning.pm @@ -3,7 +3,8 @@ package CharmBoard::Model::Crypt::Seasoning; use utf8; use strict; use warnings; -use experimental qw(try smartmatch); +use experimental qw(try); +use feature ':5.20'; use Math::Random::Secure qw(irand); diff --git a/lib/CharmBoard/Model/Schema.pm b/lib/CharmBoard/Model/Schema.pm index 97c6542..a7f3ff0 100644 --- a/lib/CharmBoard/Model/Schema.pm +++ b/lib/CharmBoard/Model/Schema.pm @@ -3,7 +3,8 @@ package CharmBoard::Model::Schema; use utf8; use strict; use warnings; -use experimental qw(try smartmatch); +use experimental qw(try); +use feature ':5.20'; use base qw(DBIx::Class::Schema); diff --git a/lib/CharmBoard/Model/Schema/Set/Categories.pm b/lib/CharmBoard/Model/Schema/Set/Categories.pm index bdaac40..dd5dbaa 100644 --- a/lib/CharmBoard/Model/Schema/Set/Categories.pm +++ b/lib/CharmBoard/Model/Schema/Set/Categories.pm @@ -3,7 +3,8 @@ package CharmBoard::Model::Schema::Set::Categories; use utf8; use strict; use warnings; -use experimental qw(try smartmatch); +use experimental qw(try); +use feature ':5.20'; use base 'DBIx::Class::ResultSet'; diff --git a/lib/CharmBoard/Model/Schema/Set/Subforums.pm b/lib/CharmBoard/Model/Schema/Set/Subforums.pm index d6daa77..f8797ab 100644 --- a/lib/CharmBoard/Model/Schema/Set/Subforums.pm +++ b/lib/CharmBoard/Model/Schema/Set/Subforums.pm @@ -3,7 +3,8 @@ package CharmBoard::Model::Schema::Set::Subforums; use utf8; use strict; use warnings; -use experimental qw(try smartmatch); +use experimental qw(try); +use feature ':5.20'; use base 'DBIx::Class::ResultSet'; diff --git a/lib/CharmBoard/Model/Schema/Set/Threads.pm b/lib/CharmBoard/Model/Schema/Set/Threads.pm index 82cf26b..70c5e1f 100644 --- a/lib/CharmBoard/Model/Schema/Set/Threads.pm +++ b/lib/CharmBoard/Model/Schema/Set/Threads.pm @@ -3,7 +3,8 @@ package CharmBoard::Model::Schema::Set::Threads; use utf8; use strict; use warnings; -use experimental qw(try smartmatch); +use experimental qw(try); +use feature ':5.20'; use base 'DBIx::Class::ResultSet'; diff --git a/lib/CharmBoard/Model/Schema/Source/Categories.pm b/lib/CharmBoard/Model/Schema/Source/Categories.pm index 6caef19..07432cd 100644 --- a/lib/CharmBoard/Model/Schema/Source/Categories.pm +++ b/lib/CharmBoard/Model/Schema/Source/Categories.pm @@ -3,7 +3,8 @@ package CharmBoard::Model::Schema::Source::Categories; use utf8; use strict; use warnings; -use experimental qw(try smartmatch); +use experimental qw(try); +use feature ':5.20'; use base qw(DBIx::Class::Core); diff --git a/lib/CharmBoard/Model/Schema/Source/Posts.pm b/lib/CharmBoard/Model/Schema/Source/Posts.pm index acb96a4..02c42ca 100644 --- a/lib/CharmBoard/Model/Schema/Source/Posts.pm +++ b/lib/CharmBoard/Model/Schema/Source/Posts.pm @@ -3,7 +3,8 @@ package CharmBoard::Model::Schema::Source::Posts; use utf8; use strict; use warnings; -use experimental qw(try smartmatch); +use experimental qw(try); +use feature ':5.20'; use base qw(DBIx::Class::Core); diff --git a/lib/CharmBoard/Model/Schema/Source/Session.pm b/lib/CharmBoard/Model/Schema/Source/Session.pm index b19412f..2ba578a 100644 --- a/lib/CharmBoard/Model/Schema/Source/Session.pm +++ b/lib/CharmBoard/Model/Schema/Source/Session.pm @@ -3,7 +3,8 @@ package CharmBoard::Model::Schema::Source::Session; use utf8; use strict; use warnings; -use experimental qw(try smartmatch); +use experimental qw(try); +use feature ':5.20'; use base qw(DBIx::Class::Core); diff --git a/lib/CharmBoard/Model/Schema/Source/Subforums.pm b/lib/CharmBoard/Model/Schema/Source/Subforums.pm index ba0e786..37ceaf4 100644 --- a/lib/CharmBoard/Model/Schema/Source/Subforums.pm +++ b/lib/CharmBoard/Model/Schema/Source/Subforums.pm @@ -3,7 +3,8 @@ package CharmBoard::Model::Schema::Source::Subforums; use utf8; use strict; use warnings; -use experimental qw(try smartmatch); +use experimental qw(try); +use feature ':5.20'; use base qw(DBIx::Class::Core); diff --git a/lib/CharmBoard/Model/Schema/Source/Threads.pm b/lib/CharmBoard/Model/Schema/Source/Threads.pm index ee429f6..18fc353 100644 --- a/lib/CharmBoard/Model/Schema/Source/Threads.pm +++ b/lib/CharmBoard/Model/Schema/Source/Threads.pm @@ -3,7 +3,8 @@ package CharmBoard::Model::Schema::Source::Threads; use utf8; use strict; use warnings; -use experimental qw(try smartmatch); +use experimental qw(try); +use feature ':5.20'; use base qw(DBIx::Class::Core); diff --git a/lib/CharmBoard/Model/Schema/Source/Users.pm b/lib/CharmBoard/Model/Schema/Source/Users.pm index 8198d76..efb0db8 100644 --- a/lib/CharmBoard/Model/Schema/Source/Users.pm +++ b/lib/CharmBoard/Model/Schema/Source/Users.pm @@ -3,7 +3,8 @@ package CharmBoard::Model::Schema::Source::Users; use utf8; use strict; use warnings; -use experimental qw(try smartmatch); +use experimental qw(try); +use feature ':5.20'; use base qw(DBIx::Class::Core); diff --git a/script/CharmBoard b/script/CharmBoard index 443cfc4..62347e8 100755 --- a/script/CharmBoard +++ b/script/CharmBoard @@ -3,7 +3,8 @@ use utf8; use strict; use warnings; -use experimental qw(try smartmatch); +use experimental qw(try); +use feature ':5.20'; use Mojo::File qw(curfile); use lib curfile->dirname->sibling('lib')->to_string;