<?xml version="1.0" encoding="windows-1252"?>
<node id="1017390" title="Perl bug ?" created="2013-02-06 06:40:46" updated="2013-02-06 06:40:46">
<type id="115">
perlquestion</type>
<author id="837263">
vsespb</author>
<data>
<field name="doctext">
&lt;code&gt;
#!/usr/bin/perl

use strict;
use warnings;

my $errors = undef;

sub ok
{
    my( $test, $name ) = @_;
    print "[[[$test]]] [[[$name]]]\n";
};

ok( ($errors &amp;&amp; ($errors-&gt;[0] =~ /Journal file not found/i)), "some text 1 $errors-&gt;[0]" );
ok( ($errors &amp;&amp; ($errors-&gt;[0] =~ /Journal file not found/i)), "some text 2 $errors-&gt;[0]" );
&lt;/code&gt;

prints the following:

&lt;code&gt;
Use of uninitialized value in concatenation (.) or string at poc.pl line 14.
[[[ARRAY(0x137cd48)]]] [[[some text 1 ]]]
Use of uninitialized value in pattern match (m//) at poc.pl line 15.
Use of uninitialized value in concatenation (.) or string at poc.pl line 15.
Use of uninitialized value $name in concatenation (.) or string at poc.pl line 11.
[[[some text 2 ]]] [[[]]]
&lt;/code&gt;

and by the way this code (with modified 'some text' strings)
&lt;code&gt;
#!/usr/bin/perl

use strict;
use warnings;

my $errors = undef;

sub ok
{
    my( $test, $name ) = @_;
    print "[[[$test]]] [[[$name]]]\n";
};

ok( ($errors &amp;&amp; ($errors-&gt;[0] =~ /Journal file not found/i)), "some text 1" );
ok( ($errors &amp;&amp; ($errors-&gt;[0] =~ /Journal file not found/i)), "some text 2" );
&lt;/code&gt;

prints correct result:

&lt;code&gt;
Use of uninitialized value $test in concatenation (.) or string at poc.pl line 11.
[[[]]] [[[some text 1]]]
Use of uninitialized value $test in concatenation (.) or string at poc.pl line 11.
[[[]]] [[[some text 2]]]
&lt;/code&gt;

perl 5.10.1 under Linux
</field>
</data>
</node>
