in reply to Re: I am geting an unhelpful error message. Not sure how to debug it.
in thread I am geting an unhelpful error message. Not sure how to debug it.

Can I reverse each line if I store them in scalers? The exersize requires that I reverse each line before I print them. The only mechanism that I have for doing that only works with arrays (or so I believe.)
  • Comment on Re^2: I am geting an unhelpful error message. Not sure how to debug it.

Replies are listed 'Best First'.
Re^3: I am geting an unhelpful error message. Not sure how to debug it.
by NetWallah (Canon) on Jun 15, 2012 at 05:30 UTC
    Yes "reverse" works with scalars as well.(When maintained in a scalar context)

    It all depends on what you want to end-up with. Reverse on a scalar reverses the letters (Make sure you do this in a SCALAR context). On an array, it reverses the order of the elements.

    One way to achieve reversal would be to take the scalar, 'split' it into an array, and reverse the array.

                 I hope life isn't a big joke, because I don't get it.
                       -SNL

Re^3: I am geting an unhelpful error message. Not sure how to debug it.
by ww (Archbishop) on Jun 15, 2012 at 12:39 UTC
    perl -e "my $str='abcdef'; print scalar (reverse ($str));"