SPUG: PERL technical interview

Yitzchak Scott-Thoennes sthoenna at efn.org
Sun Jan 22 21:48:13 PST 2006


On Sat, Jan 21, 2006 at 11:04:59PM -0800, Creede Lambard wrote:
> Come up with a good way to reverse a string. I get asked that about two out
> of three interviews, it seems like. Oh, and no one seems to like 
> 
>   print join ('', reverse( split (//, $string)));
> 
> which seems unfair to me. I mean, if they're going to expect me to use Perl,
> I should be able to use Perl, not use Perl in a particular way they mandate
> (they seem to always want something that uses substr).

So they want something like

substr$string,0,0,substr$string,-1,1,""for 1..length$string

?


More information about the spug-list mailing list