Acme-UNIVERSAL-new

 view release on metacpan or  search on metacpan

lib/Acme/UNIVERSAL/new.pm  view on Meta::CPAN

use strict;
use warnings;

use vars '$VERSION';
$VERSION = '0.01';

sub UNIVERSAL::new
{
	my $class = get_class();
	my $ref   = get_ref();
	bless $ref, $class;
}

sub get_class
{
	my ($root, $prefix) = @_;

	unless ($root)
	{
		$root   = \%main::;
		$prefix = '';

lib/Acme/UNIVERSAL/new.pm  view on Meta::CPAN

There are a few other functions:

=head2 C<get_class( $symbol_table, $name_prefix )>

Returns a random class name, after finding everything that looks like a class
beneath the given C<$symbol_table> reference named C<$name_prefix>.  If you
pass neither argument, this starts in the main symbol table.

=head2 C<get_ref()>

Returns a random blessable reference.

=head2 C<has_constructor( $class_name )>

Returns true if the given class has a constructor named C<new()> that is I<not>
C<UNIVERSAL::new()>.

=head2 C<get_symbols( $symbol_table )>

Returns a hash of symbol tables and their plain names.



( run in 1.339 second using v1.01-cache-2.11-cpan-de7293f3b23 )