From ff4c91acb8c6a22cf7dd86fd14a0a2bb40ee8e35 Mon Sep 17 00:00:00 2001 From: Stig Sandbeck Mathisen Date: Sun, 5 Oct 2014 20:38:16 +0200 Subject: [PATCH] Place "use threads" within "eval" to make it pass syntax checks on travis-ci --- plugins/network/multi_tcp_ping | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/plugins/network/multi_tcp_ping b/plugins/network/multi_tcp_ping index a3e93732..1ab779a4 100755 --- a/plugins/network/multi_tcp_ping +++ b/plugins/network/multi_tcp_ping @@ -72,7 +72,14 @@ USA. use strict; use warnings; -use threads; + +# This evil "eval" is to make Travis CI able to test the plugin syntax +# without having a perl built with threads. +# +# Also: The use of interpreter-based threads in perl is officially +# discouraged. +eval 'use threads; 1;' or die 'Could not use threads'; + use Net::Ping; my (%defaults, @hosts, $cmd_arg);