http://www.perlmonks.org?node_id=790149


in reply to Re^2: DNA Reverse Complement
in thread DNA Reverse Complement

The above sub does not work

Replies are listed 'Best First'.
Re^4: DNA Reverse Complement
by Your Mother (Archbishop) on Aug 20, 2009 at 17:57 UTC

    Of course it does. I'm guessing you called it in scalar context and got the count of the transform; e.g., 1.

    print revcompl("CGTAGTC"), $/; # GACTACG print scalar revcompl("CGTAGTC"), $/; # 1

    There was just a post on this issue this morning: Mini-Tutorial: Scalar vs List Assignment Operator.