runs *way* faster than the $_ aliasing does in the map (at least by
my benches). I thought that was fun when I saw it.
Scott
--
Scott Wiersdorf
[EMAIL PROTECTED]
On Fri, Dec 13, 2002 at 05:31:35PM -0700, Scott Wiersdorf wrote:
> FWPers,
>
> Pretending your machine did not have e?grep, how concisely could you
> duplicate the GNUish "-q" (silent) functionality: stop scanning on
> first match and exit(0). If no match, exit(1).
>
t slurping the whole file?
Any takers?
Scott
--
Scott Wiersdorf
[EMAIL PROTECTED]
ted) is:
$a && $a-- && do {
do_something();
...
}
Two questions: a) can it be shortened to fewer characters? and b) is
there another way to do it better in general?
This has been a fun thread, btw (for me, anyway). Thanks.
Scott
--
Scott Wiersdorf
[EMAIL PROTECTED]
oned it, unless I'm missing something...
These statements unconditionally alter $a (unless _I'm_ missing
something). $a should only be set to 0/false iff $a is 1/true.
Scott
--
Scott Wiersdorf
[EMAIL PROTECTED]
On Wed, May 22, 2002 at 01:04:53PM -0600, Scott Wiersdorf wrote:
> My shortest try is this (10 characters w/o whitespace):
>
> if( $a%2 .. $a-- ) {
> do_something();
> ...
> }
Ok, this is also 10 characters:
if( $a=~s/.+// ) {
...
}
and has the (s
On Wed, May 22, 2002 at 01:04:53PM -0600, Scott Wiersdorf wrote:
> My shortest try is this (10 characters w/o whitespace):
>
> if( $a%2 .. $a-- ) {
> do_something();
> ...
> }
I put the ellipses in there after the do_something() because there'
strings or
any true/false values will work).
Good luck!
Scott
--
Scott Wiersdorf
[EMAIL PROTECTED]