kotoroshinoto has asked for the wisdom of the Perl Monks concerning the following question:

This node falls below the community's threshold of quality. You may see it by logging in.

Replies are listed 'Best First'.
Re: Having a problem with my code!
by Anonymous Monk on Dec 22, 2010 at 18:25 UTC
    This is my first time using packages for object orientation extensively, so there could be any kind of error in here

    See all those global variables in package MirDeepParse;? They should be part of your object

    Did you know miRDeep is perl software? :)

      Oh and yes I was quite aware that it is perl software. I'm the one that ran it for my lab after all. I tend to prefer C/C++ & Java but perl has its niceties, especially as it comes to parsing like this.
      I think i found the problem, simple one really, i forgot to initialize the data variable in the else block before using it.
      Thanks for that info, I somewhat suspected that already, but my main point was just to get it to work first. I'm pretty sure they're not responsible for the error, because it happened after the program is finished with the parser.
        Thanks for that info, I somewhat suspected that already, but my main point was just to get it to work first. I'm pretty sure they're not responsible for the error, because it happened after the program is finished with the parser.

        I'm not sure about that. For example, I have no idea which variable this is

        %data->{$_} = $df; #store constructed data set
        $data or %data? One is local, one is global.

        I also can't get your program to produce any output, much less something with "star" or "mature" which would demonstrate your bug.

        I've made a simple modification below to avoid using Switch when possible (no need to use Switch if perl comes with given/when/default)

        I suggest you take this modification, do some more cleanup, reduce the line count (html/code, divide and conquer) and ask again :)