in reply to Re^2: hex numbers
in thread hex numbers
I'm certainly aware that many modules even do this:
our $VERSION = "1.2.3_001"; $VERSION = eval $VERSION;
As documented in perlmodstyle, I think. The specific code I used in the example isn't unsafe. But the evaluation of a string can be unsafe if the string's source isn't well controlled. And if the original poster were able to hard code hex, he could do so using 0x literals. Since he's not using 0x literals, I assume that's because the hex strings are coming from somewhere external. And at that point the caveats about evaluating strings apply.
But you're correct. What I posted isn't inherently unsafe. The practice is inherently easy to make unsafe, though.
Dave
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: hex numbers
by shmem (Chancellor) on Jan 14, 2021 at 19:50 UTC | |
by davido (Cardinal) on Jan 14, 2021 at 20:17 UTC |