Net::H...::User(3pm)

🌸 NAME 🌸

okay so bestie, this is Net::H...::User(3pm) β€” a page from the User Contributed Perl Documentation β€” and it's all about Net::Hotline::User, the user object that Net::Hotline::Client uses internally. lowkey iconic, highkey just a lil data holder πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

use Net::Hotline::User;

$user = new Net::Hotline::User;
$user->nick("joe blow");
$user->icon(128);

print "Nick: ", $user->nick(), "\n";
...

✨ DESCRIPTION ✨

Net::Hotline::User is a simple class for storing and retrieving user info. and fr fr β€” if you're using Net::Hotline::Client, you should never have to make your own Net::Hotline::User objects. Getting and setting attributes is literally all you should ever need to do. that's it, that's the whole job 🫢


πŸ¦‹ CONSTRUCTION πŸ¦‹

  • new SOCKET, NICK, LOGIN, ICON, COLOR β€” with no arguments, this creates a brand new Net::Hotline::User object with every single attribute set to undef. your other option is to hand it exactly 5 arguments, in that exact order, as listed above. no more, no less, bestie πŸ‘‘

πŸ’– METHODS πŸ’–

Every Net::Hotline::User method is a simple attribute get/set routine. give it an argument and it sets that attribute. and in all cases, it hands you back the current value of the attribute. set and get, get and set, we love a consistent queen ✨

  • color NUMBER β€” the color of the user in the userlist. values are numbers from 0 to 3. the hash HTLC_COLORS, defined over in Net::Hotline::Constants, holds the number-to-name color mappings (like, $HTLC_COLORS{2} is "red"). example:
use Net::Hotline::Constants qw(HTLC_COLORS);
...
print $user->nick(), " is ", $HTLC_COLORS{$user->color()}, "\n";
  • icon NUMBER β€” the user's icon number. negative values are accepted, so go wild πŸ“
  • info TEXT β€” user information, delivered as a block of "pretty-formatted" text.
  • login TEXT β€” the user's login name.
  • nick TEXT β€” the user's nickname in the userlist.
  • socket NUMBER β€” the user's unique socket number. users get assigned a socket number when they connect to a Hotline server. πŸ”Œ

πŸ‘‘ AUTHOR πŸ‘‘

John C. Siracusa (siracusa@mindspring.com)


Copyright(c) 1999 by John Siracusa. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.


and that's the whole page, bestie πŸ’œ this was Net::H...::User(3pm) as documented for perl v5.32.0, dated 2021-01-09 β€” slay, go forth and set some attributes βœ¨πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from