/* constants (these are not literals to facilitate pointer comparisons) */
PERLVARIC(GYes, char *, "1")
PERLVARIC(GNo, char *, "")
-PERLVARIC(Ghexdigit, char *, "0123456789abcdef0123456789ABCDEFx")
+PERLVARIC(Ghexdigit, char *, "0123456789abcdef0123456789ABCDEF")
PERLVARIC(Gpatleave, char *, "\\.^$@dDwWsSbB+*?|()-nrtfeaxc0123456789[{]}")
PERLVAR(Gspecialsv_list[4],SV *) /* from byterun.h */
#!./perl
-# $RCSfile: oct.t,v $$Revision: 4.1 $$Date: 92/08/07 18:28:08 $
-
-print "1..8\n";
+print "1..9\n";
print +(oct('01234') == 01234) ? "ok" : "not ok", " 1\n";
print +(oct('0x1234') == 0x1234) ? "ok" : "not ok", " 2\n";
print +(hex('80000000') == 0x80000000) ? "ok" : "not ok", " 6\n";
print +(oct('1234') == 668) ? "ok" : "not ok", " 7\n";
print +(hex('1234') == 4660) ? "ok" : "not ok", " 8\n";
+print +(hex('0x1234') == 0x1234) ? "ok" : "not ok", " 9\n";
while (len-- && *s) {
tmp = strchr((char *) PL_hexdigit, *s++);
if (!tmp) {
- if (*(s-1) == '_')
+ if (*(s-1) == '_' || (*(s-1) == 'x' && retval == 0))
continue;
else {
dTHR;