On Sep 14, 2:15 pm, Gary Herron <[EMAIL PROTECTED]> wrote:
> Mr.SpOOn wrote:
> > Gary Harron:
>
> >> I believe you are mixing up class *inheritance* and *abstract* classes.
>
> >> Class inheritance (with Python has has for years) is how one class 
> >> inherits >behavior/properties/attributes from another class.  The class 
> >> being inherited from is >called the base class.  This is probably what you 
> >> want.
>
> > Well, I know the difference between an abstract class and an inherited
> > one. The idea was to create a main class Note, with abstract methods,
> > and implement these methods in the other classes.
>
> > On Sun, Sep 14, 2008 at 7:56 PM, Roy Smith <[EMAIL PROTECTED]> wrote:
>
> >> What properties or behaviors does SharpNote have which NaturalNote doesn't?
> >> Unless there is some new behavior, you don't need subclasses.
>
> > Well, from a SharpNote I can obtain the relative  of our recent volunteers, since the code would be pure Perl.

>Also, the test will fail without an exception for src/dynpmc/rotest.pmc.
> I don't know if a test should be written for this PMC or not.

>I'm working in the script.

>Igor

I have a working script(with testing variables only).

I have to filter de input (there are other types of files), and improbe the 
reporting part.

I don't know if I forgeting something.

Igor

The script is:

#!/usr/bin/perl -w

# Copyright (C) 2007-2008, The Perl Foundation.
# $Id: Match.pl 2008-09-10  igor $

=head1 NAME

Match.pl 

=head1 DESCRIPTION

Reports if doesn't mach a pmc file with a test file, there is not test file

=cut

sub find_files {
    my ($base_dir,$dirpmc,$dirtest) = @_;
    opendir(DIRPMC, $base_dir.$dirpmc);
    opendir(DIRTEST,$base_dir.$dirtest);

    my @filespmc = grep { $_ ne '.' and $_ ne '..' } readdir DIRPMC;
    my @filest   = grep { $_ ne '.' and $_ ne '..' } readdir DIRTEST;

    my @pmc_values = @{strip_ext([EMAIL PROTECTED])};
    my @t_values = @{strip_ext([EMAIL PROTECTED])};

    my %hash_t = map { $_ => $_ } @t_values;

    for (0 .. $#pmc_values) {
        if ( exists $hash_t{ $pmc_values[$_] } ) {
            print "element exist     ".$pmc_values[$_]."\n";
        } else {
            print "element do not exist  ".$pmc_values[$_]."\n";
        }
    }

}

sub strip_ext {
    my @ref_t = @{$_[0]};
    my @arr_stripped = ();
    for (my $i=0;$i<$#ref_t+1; $i++) {
        if ($ref_t[$i] =~ m/(\w+)[.]\w+/) {  #Obtain names of files without 
extension
            $arr_stripped[$i] = $1;
        } else {
            print "error";
        }
    }
    return [EMAIL PROTECTED];
}

my $base_dir = "/home/raf/parrot/";
my $dirpmc   = "src/dynpmc/";
my $dirtest  = "t/dynpmc/";

#find_files($base_dir,$dirpmc,$dirtest);
               





__________________________________________________
Correo Yahoo!
Espacio para todos tus mensajes, antivirus y antispam ¡gratis! 
Regístrate ya - http://correo.yahoo.com.mx/ 

__________________________________________________
Correo Yahoo!
Espacio para todos tus mensajes, antivirus y antispam ¡gratis! 
Regístrate ya - http://correo.yahoo.com.mx/ 

Reply via email to