Net::WebSocket::Frame::text
NOTE: Before you instantiate this class directly, look at Net::WebSocket::Endpoint’s create_message() convenience method to make your life easier.
create_message()
my $frm = Net::WebSocket::Frame::text->new( #This flag defaults to on fin => 1, #For servers, this must be empty (default). #For clients, this must be four random bytes. mask => q<>, payload => $payload_text, ); $frm->get_type(); #"text" $frm->is_control(); #0 my $mask = $frm->get_mask_bytes(); my $payload = $frm->get_payload(); my $serialized = $frm->to_bytes(); $frm->set_fin(); #turns on
To install Net::WebSocket, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Net::WebSocket
CPAN shell
perl -MCPAN -e shell install Net::WebSocket
For more information on module installation, please visit the detailed CPAN module installation guide.