TIP: Click on subject to list as thread! ANSI
echo: binkd
to: Michael Dukelsky
from: Oli
date: 2021-09-08 16:43:00
subject: Perl on_handshake(): @me

Michael wrote (2021-09-08):

 Ol>> HELP! ;)
 Ol>> I'm trying to use the @me array in on_handshake(), but no matter
 Ol>> what I do I always get the error:

 Ol>> "Perl on_handshake(): @me contains no valid addresses"

 Ol>> even with this simple sub:

 Ol>> sub on_handshake
 Ol>> {
 Ol>>   @me;
 Ol>> }

 MD> I've never used this hook but as far as I understand you have to put the
 MD> AKAs you want to present to the @me array. The array in your sub contains
 MD> no addresses, so you receive the error message.

Hi Michael,

your right. It does work when I use

@me = ("5:6/7");

I was sure I've already tried it like this. Maybe it was a typo, which I didn't see.

I also thought the variable is pre-filled with the AKAs, like it is with $hosts etc. And then the unusual behavior of Perl confused me. I didn't expect that a variable can be created without explicit declaration or assignment. So Log(3, $me[0]) initialized an empty array @me. Most other languages would complain about an non existent variable.

Thanks :)

---
                                                       
* Origin: 1995| Invention of the Cookie. The End. (2:280/464.47)

SOURCE: echomail via QWK@pharcyde.org

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.