# MUMmer plot error. Line 884. What to do?

My third year comp sci friend got me this far, I hope you guys can help me with the last inch! For the record, I have practically no coding experience. I am using the 3.9.4 alpha version of MUMmer.

Here is the manual I have been following: http://mummer.sourceforge.net/examples/

I am at part 2.2.2 Running the Mummer plot, and I type in the final line to generate the plot.

I type:

mummerplot -x "[0,8666124]" -y "[0,9025688]" -postscript -p mummer mummer.mums

And the error is:

Can't use 'defined(%hash)' (Maybe you should omit the defined ()?) at /usr/bin/mummerplot line 884


Line at 884:

if ( defined (%$$rref) ) { #-- skip reference sequence or set atts from hash if ( !exists (rref->{idR}) ) { next; } else { (refoff, reflen, refdir) = @{rref->{$$idR}}; }


Its perl

• Hi could you please present your code inline, e.g. copy and paste? It is hard to read as an image. This looks like Perl, could you confirm this?
– M__
Dec 3 '20 at 8:26
• Cross-posted on biostars: biostars.org/p/476874 Dec 3 '20 at 16:36

I had the same error and I solved by removing defined and writing only if (%$rref) in the mummerplot code. You have to do this for all the lines that you have it. There should be six lines to correct in this way . You can find an explanation of why here, that tells that the function defined: Returns a Boolean value telling whether EXPR has a value other than the undefined value undef. If EXPR is not present,$_ is checked.

And then:

Use of defined on aggregates (hashes and arrays) is no longer supported. It used to report whether memory for that aggregate had ever been allocated. You should instead use a simple test for size: if (%a_hash) { print "has hash members\n" }

• @KamilSJaron thank you but to be honest the code is written in C and I am not really expert on this. Anyway, I tried to add more details that is what has helped to me . Jun 3 '21 at 12:16
• This is totally enough for people to get the idea that it's just an outdated part of the code, good job in figuring it out! Jun 3 '21 at 12:21