Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Python/zsh/perl [was: named directory expansion on strings]



On Sun, Mar 14, 2004 at 03:57:00PM -0600, Vincent Stemen wrote:
> As wonderful of a language as Perl is, that is the one limitation I
> have found that gives Z shell an advantage, even over Perl, in
> situations where that lower level control is needed.  In Perl, it is
> far to much unnecessary overhead to split a string on every character,
> into a two dimensional array of strings, using the null delimiter, just
> gain access to a specific byte of the array.  Then, if you modify the
> array, you must re-join the data back into a single string.  All that,
> as opposed to just being able to say "$array[$i] = 'x'".
> 
> This is about the only complaint I can think of I have ever really had
> with Perl.

lizzy:~% perl -le 'my $a = "abc"; substr($a, 1, 1) = "z"; print $a;' 
azc
lizzy:~% 

-- 
Jos Backus                       _/  _/_/_/      Sunnyvale, CA
                                _/  _/   _/
                               _/  _/_/_/
                          _/  _/  _/    _/
jos at catnook.com        _/_/   _/_/_/          require 'std/disclaimer'



Messages sorted by: Reverse Date, Date, Thread, Author