In object-oriented Perl, the invocant method (the object on which the method was called, either the class or an instance of the class) is passed to the subroutine as the first parameter.
Parameters for routines are found in the special @_ array. shift removes the first element of the array and returns it. If you did not specify an explicit shift argument, it works by @_ by default.
The usual pattern for OO methods is to do things like
# foo method sub foo { my $self = shift;
What happens here is simply to use a shortcut to avoid creating the $self variable and calling the state method on invocant as returned directly from shift . So your method is equivalent:
sub shared { my $self = shift; $self->state( broadcast => @_ ); }
source share