$outputb = "\t$resultarray[3]";
####
#!/usr/bin/env perl -l
use strict;
use warnings;
my @resultarray;
my $outputb;
$resultarray[3] = 0;
$outputb = "\t$resultarray[3]";
print '$resultarray[3] = |', $resultarray[3], '|';
print '$outputb = |', $outputb, '|';
check_for_match_zero('$resultarray[3]', $resultarray[3]);
check_for_match_zero('$outputb', $outputb);
sub check_for_match_zero {
my ($name, $value) = @_;
if ($value =~ /^0$/) {
print "$name (with value: '$value') MATCHES zero.";
}
else {
print "$name (with value: '$value') DOES NOT MATCH zero.";
}
}
####
$resultarray[3] = |0|
$outputb = | 0|
$resultarray[3] (with value: '0') MATCHES zero.
$outputb (with value: ' 0') DOES NOT MATCH zero.