GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Agent::Message(3) User Contributed Perl Documentation Agent::Message(3)

Log::Agent::Message - a log message

 require Log::Agent::Message;

 my $msg = Log::Agent::Message->make("string");
 $msg->prepend("string");
 $msg->append("string");
 my $copy = $msg->clone;

 print "Message is $msg\n";     # overloaded stringification

The Log::Agent::Message class represents an original log message (a string) to which one may prepend or append other strings, but with the special property that prepended strings aggregate themselves in FIFO order, whilst appended strings aggregate themselves in LIFO order, which is counter-intuitive at first sight.

In plain words, this means that the last routine that prepends something to the message will get its prepended string right next to the original string, regardless of what could have been prepended already. The behaviour is symetric for appending.

The following routines are available:
append($str)
Append suppled string $str to the original string (given at creation time), at the head of all existing appended strings.
append_last($str)
Append suppled string $str to the original string (given at creation time), at the tail of all existing appended strings.
clone
Clone the message. This is not a shallow clone, because the list of prepended and appended strings is recreated. However it is not a deep clone, because the items held in those lists are merely copied (this would matter only when other objects with overloaded stringification routines were supplied to prepend() and append(), which is not the case today in the basic Log::Agent framework).
make($string)
This is the creation routine.
prepend($str)
Prepend supplied string $str to the original string (given at creation time), at the tail of all existing prepended strings.
prepend_first($str)
Prepend supplied string $str to the original string (given at creation time), at the head of all existing prepended strings.
stringify
This is the overloaded "" operator, which returns the complete string composed of all the prepended strings, the original string, and all the appended strings.

Raphael Manfredi <Raphael_Manfredi@pobox.com>

Log::Agent(3).
2021-04-12 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.