SPUG: declarations

David H. Adler dha at panix.com
Sat Dec 30 19:39:48 CST 2000


On Sat, Dec 30, 2000 at 11:27:18AM -0800, Joe Devlin wrote:
> my %in;#separate command for declaration, not in same line
> my $one_server= $in{'server};
> 
> #alternately as global variable in the first few lines of the program
> 	use vars qw( %in $other_var1 $other_var2 $other_var3 %other_hash);
> 
> ----------
> From: 	Brittingham, John[SMTP:john.brittingham at attws.com]
> Sent: 	Saturday, December 30, 2000 11:00 AM
> To: 	spug-list at pm.org
> Subject: 	SPUG: declarations
> 
> How do you declare $in in the following line?
> my $one_server= $in{'server'};

My question is, why would you even have a line of code like this in a
program at a point where %in wouldn't already exist?  And if you
localize it as at top, you're effectively just assinging a value of
undef to $one_server.

Am I missing something?

dha
-- 
David H. Adler - <dha at panix.com> - http://www.panix.com/~dha/
"That's one of the tragedies of this life:  that the men most in need
of a beating up are always enormous." - John D. Hackensacker III

 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
     POST TO: spug-list at pm.org       PROBLEMS: owner-spug-list at pm.org
      Subscriptions; Email to majordomo at pm.org:  ACTION  LIST  EMAIL
  Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address
 For daily traffic, use spug-list for LIST ;  for weekly, spug-list-digest
  Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/





More information about the spug-list mailing list