Juerd <[EMAIL PROTECTED]> writes: > substr($string, 2 but graphemes, 4 but bytes); > > I think "but" even makes sense, if substr defaults to something.
That could be combined with a smart substr that only needs the units once (err, only needs a position object for one of the args) and knows how to conver the other number to the same units (err, same type of position object): substr($string, 2, 4 but bytes); This would still allow for specifying units on both if you for some reason wanted them different (which, as Dan S points out, sounds like a bad idea, on the face of it). :bytes is shorter than but bytes, though. -- $;=sub{$/};@;=map{my($a,$b)=($_,$;);$;=sub{$a.$b->()}} split//,"[EMAIL PROTECTED]/ --";$\=$ ;-> ();print$/