Help for this page

Select Code to Download


  1. or download this
    # up at the top:
    use My::Format::Foo;
    ...
          my $parser_class = 'My::Format::' . ucfirst $self->{'FILETYPE'};
          my $data = $parser_class->parse($_);
    
  2. or download this
    # Up top
    use Module::Load;
    ...
    my $module_name = 'My::Format::' . ucfirst $self->{'FILETYPE'};
    load $module_name;
    my $data = $module_name->parse($_);
    
  3. or download this
    my $module_filename = 'My/Format/' . ucfirst($self->{'FILETYPE'}) . '.
    +pm';
    require $module_filename;
    my $module_classname = 'My::Format::' . ucfirst($self->{'FILETYPE'};
    $module_classname->import();
    my $data = $module_classname->parse($_);