in reply to Conversion of C code to Perl-ese.

My copy of C Pocket Reference: C Syntax and Fundamentals, by Peter Prinz and Ulla Kirch-Prinz (translated by Tony Crawford). O'Reilly Books, 0-596-00436-2, shows the following information:

int strtol (const char *s, char **pptr, int base );

Defined as:

Converts a string to a number with type long. The third parameter is the base of the numeral string, and may be an integer between 2 and 36, or 0. If base is 0, the string s is interpreted as a numeral in base 8, 16, or 10 depending whether it begins with 0, 0x or one of the digits 1 to 9.

The analogous functions of converting a string to unsigned long, long long(*) or unsigned long long(*) are strtoul()(*), strtoll()(*) and strtoull()(*).

char strncpy (char *s1, const char *s2 size_t n );

Defined as:

Copies the first n characters of s2 to the char array s1. The string terminator character '\0' is not appended.

Update: fix formatting.

--hsm

"Never try to teach a pig to sing...it wastes your time and it annoys the pig."