Aion-Spirit

 view release on metacpan or  search on metacpan

README.md  view on Meta::CPAN

A::x_2         # -> 2
(\&A::x_2)->() # -> 2.03

# Functions with parameters not cached:
A::y_1 .5  # -> 1.5
A::y_2 .5  # -> 2.53
```

# DESCRIPTION

A Perl program consists of packages, globals, subroutines, lists, and scalars. That is, it is simply data that, unlike a C program, can be “changed on the fly.”

Thus, this module provides convenient functions for transforming all these entities, as well as maintaining their integrity.

# SUBROUTINES

## aroundsub ($pkg, $re, $around)

Wraps the functions in the package in the specified regular sequence.

The package may not be specified for the current:

lib/Aion/Spirit.md  view on Meta::CPAN

A::x_2         # -> 2
(\&A::x_2)->() # -> 2.03

# Functions with parameters not cached:
A::y_1 .5  # -> 1.5
A::y_2 .5  # -> 2.53
```

# DESCRIPTION

A Perl program consists of packages, globals, subroutines, lists, and scalars. That is, it is simply data that, unlike a C program, can be “changed on the fly.”

Thus, this module provides convenient functions for transforming all these entities, as well as maintaining their integrity.

# SUBROUTINES

## aroundsub ($pkg, $re, $around)

Wraps the functions in the package in the specified regular sequence.

The package may not be specified for the current:

lib/Aion/Spirit.pm  view on Meta::CPAN

	# Perl cached subroutines with prototype "()" in main:: as constant. aroundsub should be applied in a BEGIN block to avoid this:
	A::x_2         # -> 2
	(\&A::x_2)->() # -> 2.03
	
	# Functions with parameters not cached:
	A::y_1 .5  # -> 1.5
	A::y_2 .5  # -> 2.53

=head1 DESCRIPTION

A Perl program consists of packages, globals, subroutines, lists, and scalars. That is, it is simply data that, unlike a C program, can be “changed on the fly.”

Thus, this module provides convenient functions for transforming all these entities, as well as maintaining their integrity.

=head1 SUBROUTINES

=head2 aroundsub ($pkg, $re, $around)

Wraps the functions in the package in the specified regular sequence.

The package may not be specified for the current:

t/aion/spirit.t  view on Meta::CPAN

::is scalar do {A::x_2}, scalar do{2}, 'A::x_2         # -> 2';
::is scalar do {(\&A::x_2)->()}, scalar do{2.03}, '(\&A::x_2)->() # -> 2.03';

# Functions with parameters not cached:
::is scalar do {A::y_1 .5}, scalar do{1.5}, 'A::y_1 .5  # -> 1.5';
::is scalar do {A::y_2 .5}, scalar do{2.53}, 'A::y_2 .5  # -> 2.53';

# 
# # DESCRIPTION
# 
# A Perl program consists of packages, globals, subroutines, lists, and scalars. That is, it is simply data that, unlike a C program, can be “changed on the fly.”
# 
# Thus, this module provides convenient functions for transforming all these entities, as well as maintaining their integrity.
# 
# # SUBROUTINES
# 
# ## aroundsub ($pkg, $re, $around)
# 
# Wraps the functions in the package in the specified regular sequence.
# 
# The package may not be specified for the current:



( run in 0.736 second using v1.01-cache-2.11-cpan-49f99fa48dc )