Odd to me anyway...
perl -Mstrict -e'my $num = 1; print 1 if $num >= 1; print 2 if $num => + 1;'
Works as I'd expect. As does The following code does what Id expect.
#!/usr/bin/perl use strict; use warnings; use Carp; use DBI; use Data::Dumper; # Connection my $dsn = qq|dbi:Informix:sysmaster|; my $dbh = DBI->connect($dsn) or confess DBI->errstr(); $dbh->{'RaiseError'} = 1; $dbh->{'ChopBlanks'} = 1; # Hash to hold all info about tables... my %dbinfo; # Get info on extents... { my $query = qq|select count(*), tabname from sysextents group by tabname|; my $sth = $dbh->prepare($query) or confess DBI->errstr(); $sth->execute or confess DBI->errstr(); my ( $count, $table ); $sth->bind_col(1, \$count); $sth->bind_col(2, \$table); while ( $sth->fetchrow ) { next unless $count >= 8; $dbinfo{$table}{'extents'} = $count; } } print Dumper %dbinfo; END { $dbh->disconnect }
which outputs
__snip__
$VAR77 = 'abcde'; $VAR78 = { 'extents' => 14 }; $VAR79 = 'abcdef'; $VAR80 = { 'extents' => 33 }; $VAR81 = 'abcdefg'; $VAR82 = { 'extents' => 93 }; $VAR83 = 'abcdefgh'; $VAR84 = { 'extents' => 17 };
but when I change line 35 to
next unless $count => 8;
I get all table extents returned.
__snip__
$VAR2949 = 'abcdefgh'; $VAR2950 = { 'extents' => '4' }; $VAR2951 = 'abcdefghi'; $VAR2952 = { 'extents' => '1' }; $VAR2953 = 'abcdefghij'; $VAR2954 = { 'extents' => '1' }; $VAR2955 = 'abcdefghz'; $VAR2956 = { 'extents' => '1' }; $VAR2957 = 'abcdefghp'; $VAR2958 = { 'extents' => '1' }; $VAR2959 = 'abcde'; $VAR2960 = { 'extents' => '1' }; $VAR2961 = 'abcderr'; $VAR2962 = { 'extents' => '1' }; $VAR2963 = 'abcdewe'; $VAR2964 = { 'extents' => '1' };
Just curious as to the why of this.

perl is old ( nothing I can do about it either, upgrades are scheduled ), Output of perl -v is
This is perl, v5.8.3 built for x86_64-linux-thread-multi


updateupdated mis-spelled node title...

update2
The command line example is actually the odd behavior. So to restate my question, why does that output 12?

update3If I could only -- myself, I would, on this one. Whats the point of use warnings; if you don't read them?
Ted
--
"That which we persist in doing becomes easier, not that the task itself has become easier, but that our ability to perform it has improved."
  --Ralph Waldo Emerson

In reply to odd =>behavior by tcf03

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.