tcf03 has asked for the wisdom of the Perl Monks concerning the following question:
perl -Mstrict -e'my $num = 1; print 1 if $num >= 1; print 2 if $num => + 1;'
which outputs#!/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 }
but when I change line 35 to$VAR77 = 'abcde'; $VAR78 = { 'extents' => 14 }; $VAR79 = 'abcdef'; $VAR80 = { 'extents' => 33 }; $VAR81 = 'abcdefg'; $VAR82 = { 'extents' => 93 }; $VAR83 = 'abcdefgh'; $VAR84 = { 'extents' => 17 };
I get all table extents returned.next unless $count => 8;
Just curious as to the why of this.$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' };
This is perl, v5.8.3 built for x86_64-linux-thread-multi
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: odd =>behavior
by Fletch (Bishop) on Dec 04, 2007 at 17:23 UTC | |
by tcf03 (Deacon) on Dec 04, 2007 at 17:29 UTC | |
by Fletch (Bishop) on Dec 04, 2007 at 17:36 UTC | |
|
Re: odd =>behavior
by toolic (Bishop) on Dec 04, 2007 at 17:32 UTC | |
by tcf03 (Deacon) on Dec 04, 2007 at 17:38 UTC | |
|
Re: odd =>behavior
by grep (Monsignor) on Dec 04, 2007 at 17:24 UTC | |
|
Re: odd =>behavior
by jrsimmon (Hermit) on Dec 04, 2007 at 17:26 UTC | |
by Fletch (Bishop) on Dec 04, 2007 at 17:32 UTC | |
by chromatic (Archbishop) on Dec 04, 2007 at 17:53 UTC | |
by Fletch (Bishop) on Dec 04, 2007 at 17:57 UTC | |
by chromatic (Archbishop) on Dec 04, 2007 at 19:15 UTC | |
|