Created
February 13, 2018 09:26
-
-
Save robinsmidsrod/f8d5ab88dfe383f3aca40155ccec7d32 to your computer and use it in GitHub Desktop.
Fix issue with given/when experimental in newer Perl versions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/util/niclist.pl b/src/util/niclist.pl | |
index 0600c823..f6e70e5b 100755 | |
--- a/src/util/niclist.pl | |
+++ b/src/util/niclist.pl | |
@@ -50,23 +50,20 @@ Column names (default order): | |
EOM | |
# Only load runtime requirements if actually in use | |
-given($format) { | |
- when( /csv/ ) { | |
- eval { require Text::CSV; }; | |
- die("Please install Text::CSV CPAN module to use this feature.\n") | |
- if $@; | |
- } | |
- when( /json/ ) { | |
- eval { require JSON; }; | |
- die("Please install JSON CPAN module to use this feature.\n") | |
- if $@; | |
- } | |
- when( /html/ ) { | |
- eval { require HTML::Entities; }; | |
- die("Please install HTML::Entities CPAN module to use this feature.\n") | |
- if $@; | |
- } | |
- default { } | |
+if ( $format =~ /csv/ ) { | |
+ eval { require Text::CSV; }; | |
+ die("Please install Text::CSV CPAN module to use this feature.\n") | |
+ if $@; | |
+} | |
+if ( $format =~ /json/ ) { | |
+ eval { require JSON; }; | |
+ die("Please install JSON CPAN module to use this feature.\n") | |
+ if $@; | |
+} | |
+if ( $format =~ /html/ ) { | |
+ eval { require HTML::Entities; }; | |
+ die("Please install HTML::Entities CPAN module to use this feature.\n") | |
+ if $@; | |
} | |
# Scan source dir and build NIC list |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment