Welcome Guest!
 chicago-pm
 Previous Message All Messages Next Message 
null list values  Andy_-@wiwb.uscourts.gov
 Mar 02, 2004 10:32 PST 

We were looking at an odd call to a sub, normally it'd be:
my $res = unload($select, $from, $where);

but I found a couple of:
my $res = unload($select,, $from, $where);

Note the ",," 2 commas in the 2nd. I gather its got to do w/ the null
entries being smooshed out of existance:
sub unload
{
        my ($Field,$Table,$Where) = @_;
        print "($Field,$Table,$Where) = \n@_ ($#_)\n";
}
print "1: \n";
unload("one","two","three");
print "2: \n";
unload("one",,"two","three");
print "3: \n";
unload("one",,,,"two","three");
print "4: \n";
my @data = ("one", , , ,"two","three");
print "data: @data ($#data)\n";
unload(@data);

gets:
1:
(one,two,three) =
one two three (2)
2:
(one,two,three) =
one two three (2)
3:
(one,two,three) =
one two three (2)
4:
data: one two three (2)
(one,two,three) =
one two three (2)

but, er, bug? feature? likely to go away in perl 6?

a


Andy Bach, Sys. Mangler
Internet: andy_-@wiwb.uscourts.gov
VOICE: (608) 261-5738 FAX 264-5030

"[the heck w/ it] lets go bowling"
	
 Previous Message All Messages Next Message 
  Check It Out!

  Topica Channels
 Best of Topica
 Art & Design
 Books, Movies & TV
 Developers
 Food & Drink
 Health & Fitness
 Internet
 Music
 News & Information
 Personal Finance
 Personal Technology
 Small Business
 Software
 Sports
 Travel & Leisure
 Women & Family

  Start Your Own List!
Email lists are great for debating issues or publishing your views.
Start a List Today!

© 2001 Topica Inc. TFMB
Concerned about privacy? Topica is TrustE certified.
See our Privacy Policy.