in reply to Alternative to bytes::length()
Sometimes, I wish for a boolean context... (It would be great for grep too.) Or maybe the character length should be stored in string variables?
I can't think of any replacement short of turning off the flag, calling length, then restoring it.
What's the problem with the current solution?
require bytes; sub emptystr(_) { no warnings 'uninitialized'; return !bytes::length($_[0]); }
By the way,
use bytes; no bytes;
is equivalent to
use bytes ();
There's also similar
require bytes;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Alternative to bytes::length()
by creamygoodness (Curate) on Dec 23, 2009 at 01:38 UTC | |
by ikegami (Patriarch) on Dec 23, 2009 at 02:02 UTC | |
by ikegami (Patriarch) on Dec 23, 2009 at 02:15 UTC | |
by creamygoodness (Curate) on Dec 23, 2009 at 02:25 UTC | |
by assemble (Friar) on Dec 23, 2009 at 14:15 UTC | |
by ikegami (Patriarch) on Dec 23, 2009 at 15:02 UTC | |
by assemble (Friar) on Dec 23, 2009 at 15:47 UTC | |
by ikegami (Patriarch) on Dec 23, 2009 at 16:04 UTC | |
|