in reply to Re^2: Scalar refs, aliasing, and recursion weirdness.
in thread Scalar refs, aliasing, and recursion weirdness.
Still probably not what you are looking for (i.e. no refs), but closer maybe? (at least no regex)
-- All code is 100% tested and functional unless otherwise noted.
#!/usr/bin/perl -slw use strict; my $str = 'aaaaaaaaaa'; print recur($str); sub recur { my $s = shift; return "" if length($s)==0; substr($s,1,-1) = recur(substr($s,1,-1)); return "($s)"; }
-- All code is 100% tested and functional unless otherwise noted.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^4: Scalar refs, aliasing, and recursion weirdness.
by BrowserUk (Patriarch) on Feb 05, 2005 at 01:45 UTC |
In Section
Seekers of Perl Wisdom