in reply to Reverse the String
The solution is to convince reverse you want a scalar, not an array. There are many ways to do this:
# 1. Assign it to a scalar: $a=reverse("monks"); # 2. Use the keyword "scalar": print scalar reverse("monks"); # 3. Use some kind of scalar-based manipulation print reverse("monks")."\n"; # 3a: do almost the same: print reverse("monks").""; # 3b: (reverses 100 to 001, then adds 1, printing "2". print reverse(100)+1;
|
|---|