summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbin/mqtt-multipub6
1 files changed, 4 insertions, 2 deletions
diff --git a/bin/mqtt-multipub b/bin/mqtt-multipub
index 4c9b2dc..c079d6f 100755
--- a/bin/mqtt-multipub
+++ b/bin/mqtt-multipub
@@ -14,8 +14,10 @@ my $mqtt = Net::MQTT::Simple->new( '172.23.225.193' );
sub parse_content_string {
my ($raw_content) = @_;
if ($raw_content =~ m{ ^ / [^/] }x) {
- my $content = read_file($raw_content);
- chomp $content;
+ my $content = read_file($raw_content, { err_mode => 'carp' });
+ if (defined $content) {
+ chomp $content;
+ }
return $content;
}
return $raw_content;