Hi Team, Tested code that prints a value for !$state when $state is initialized with my $state = ();
#!/usr/local/bin/perl # #set $state to () to find out what !$state is use strict; use warnings; my $state =(); print "\!\$state is:\t", !$state, "\n\n\n"; print "\$state is:", $state, "\n\n\n"; #end tested code so to investigate this further, I want to look at what perl takes as "Truth". I want to nail down for my own benefit the differences between uninitialized, undef, initialized as a reference to an empty hash or array or whatever. How these compare with the return value of undef() etc. Quick, to the Fine Manual! perldoc perldoc tells me all about formatting and gives me the actually useful switches for the purposes of finding documentation: -f if I want documentation on a function -q to 'grep' the perl faqs Question: How do I get an index or a table of contents? How do I find out how to search the perldocs for "control structures" I've tried: perldoc perldoc perldoc -f if perldoc -q control perldoc -q index perldoc -q contents perldoc -q perldoc eg perldoc perltoot gets me what looks like a nice OO tutorial, but how would I know it is there unless I'd seen it in a post on a website someplace. Thanks in advance. Tim Johnson said: > >$state evaluates as true (I think that's what you're asking). > >#################################### > >$state = {}; > >if($state){ > print "\$state is true: $state\n"; >}else{ > print "\$state is false"; >} > >#################################### > >$state is true because it's not empty. >It's a reference to a hash that is empty. > > > > > >-----Original Message----- >From: David Arnold [mailto:[EMAIL PROTECTED] >Sent: Thursday, July 15, 2004 7:24 PM >To: [EMAIL PROTECTED] >Subject: !$state > >All, > >If: > >$state={}; > >Then, what is: > >!$state > > >-- >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] ><http://learn.perl.org/> <http://learn.perl.org/first-response> > -- Kind regards, Hal Ashburner -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>