|%d||Decimal integer, with optional plus or minus sign.|
|%u||Decimal unsigned integer, with optional plus sign.|
|%x||Hexadecimal unsigned integer, with optional 0x or 0x in front.|
|%o||Octal unsigned integer.|
|%e %f %g||
(The [efg] work identically.)
Decimal floating point number, with optional plus or minus sign, in any of these formats:
The exponent has an optional plus or minus sign, and the e may also be E.
The various borderline cases like Inf and Nan are not recognized.
|%s||A non-whitespace string.|
|%c||A string of characters. An array reference is returned containing the numerical values of the characters.|
|%%||A literal %.|
The %s and %c have an optional maximum width, e.g. %4s, in which case at most so many characters are consumed (but fewer characters are also accecpted).
The numeric formats may also have such a width but it is ignored.
The numeric formats may have [hl] before the main option, e.g. %hd, but since such widths have no meaning in Perl, they are ignored.
Non-format parts of the parameter string are matched literally (e.g. : matches as :), expect that any whitespace is matched as any whitespace (e.g. matches as \s+).
The numeric formats match only something that looks like a number, they do not care whether it fits into the numbers of Perl. In other words, 123e456789 is valid for sscanf(), but quite probably it wont fit into your Perls numbers. Consider using the various Math::* modules instead.
Jarkko Hietaniemi <firstname.lastname@example.org>
Copyright (c) 2002,2004 Jarkko Hietaniemi. All rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
|perl v5.20.3||STRING::SCANF (3)||2004-05-07|