Hi Dave,

thanks for your reply. Yes, this would work (of course), but if
the scalar was just 'declared' but no value assigned using
  our $foo;
this doesn't work. It would show up in the symbol table, but
it wouldn't be 'defined'.
Perhaps I shouldn't have used the word 'defined' in my
original question. I think I should rather have sayed 'declared'.

Any other ideas?

Thanks&Regards,
---------------------------------------------------------------------------------------
Gerhard Petrowitsch                                Tel.: +49 8151 270 126
Philips Semiconductors                         Fax:  +49 8151 270 200
Petersbrunnerstr. 17                Home Office: +49 821 9069 741
82319 Starnberg, Germany      SERI: [EMAIL PROTECTED]
---------------------------------------------------------------------------------------
Be like the ant.  When the ant gets a mixture of sand and sugar,
it selects only sugar; it neglects sand. See only good in others.
Pay no attention to the bad.                                (Sathya Sai Baba)
--------------------------------------------------------------------------------------------


                                                                                       
                                                                                       
         
                                                                                       
                                                                                       
         
                                                                      To:   Gerhard 
Petrowitsch/STN/SC/[EMAIL PROTECTED]                                                   
                
                                                                      cc:   [EMAIL 
PROTECTED]                                                                  
                                                                       [EMAIL 
PROTECTED]                                                                 
                                                                      Subject:    Re: 
Distinguish SCALAR from ARRAY, CODE, HASH in the symbol table of a typeglob            
          
               [EMAIL PROTECTED]                                                       
                                                                                       
  
                                                                      Classification:  
                                                                                       
         
               Sent by:                                                                
                                                                                       
         
               [EMAIL PROTECTED]                                                       
                                                                      
               .com                                                                    
                                                                                       
         
                                                                                       
                                                                                       
         
               23.10.2003 18:52                                                        
                                                                                       
         
                                                                                       
                                                                                       
         
                                                                                       
                                                                                       
         





if (defined($foo)) { dosomething }?

                                                                                       
                                                                                       
                                                                                
      [EMAIL PROTECTED]                                                                
                                                                                       
                                                                  
      Sent by: [EMAIL PROTECTED]                                            To:        
[EMAIL PROTECTED]                                                                      
                          
                                                                                       
                   cc:                                                                 
                                                                                
                                                                                       
                   Subject:        Distinguish SCALAR from ARRAY, CODE, HASH in the 
symbol table of a typeglob                                                         
      10/23/2003 01:14 AM                                                              
                                                                                       
                                                                                
                                                                                       
                                                                                       
                                                                                






Hi all,

I've got a very tricky question:

If in the main name space I define an array @foo or a hash %foo or a
subroutine &foo I can test for it's existence by checking, if *main::foo{ARRAY},
*main::foo{HASH} or *main::foo{CODE} is defined. Unfortunately, for each of
these three also *main::foo{SCALAR} is defined. Therefore, I cannot determine
if a scalar $foo is also defined or not, when one of @foo, %foo or &foo is defined.
Is there any way to find this out?

(I want to do this in a program where I 'eval' user code into a namespace and I
would like to report name clashes with code of other users.)

Thanks & Regards
Gerhard
---------------------------------------------------------------------------------------
Gerhard Petrowitsch                                Tel.: +49 8151 270 126
Philips Semiconductors                         Fax:  +49 8151 270 200
Petersbrunnerstr. 17                Home Office: +49 821 9069 741
82319 Starnberg, Germany      SERI: [EMAIL PROTECTED]
---------------------------------------------------------------------------------------
Be like the ant.  When the ant gets a mixture of sand and sugar,
it selects only sugar; it neglects sand. See only good in others.
Pay no attention to the bad.                                (Sathya Sai Baba)
--------------------------------------------------------------------------------------------


_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs







_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to