strtoul#

Parse an unsigned integer from the start of a string, in a given base.

תקציר#

use POSIX qw(strtoul);
my ($n, $unparsed) = strtoul("255 end", 10);

מקרי קצה#

  • Invalid base: returns (undef, undef) and sets $! to EINVAL.

  • Negative input: parsed and two’s-complement-cast to unsigned, matching C strtoul.

הבדלים מן ה-upstream#

Fully compatible with upstream POSIX.

ראו גם#

  • strtol - signed variant.