For Programmers: Free Programming Magazines  


Home > Archive > PERL Beginners > January 2006 > Where is the source code?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Where is the source code?
Siegfried Heintze

2006-01-10, 4:02 am

I'm trying to understand the algorithm for generating uuids or guids. I was
hoping to use my perl debugger to single step thru the algorithm that
creates guids/uuids. So I downloaded the tar.gz files at

http://search.cpan.org/src/AGOLOMSH...ID-0.11/UUID.pm
http://search.cpan.org/~phenson/DCE...21/UUID/UUID.pm
http://search.cpan.org/~braam/UUID-0.02/UUID.pm


I cannot find the source code for the algorithm. I was surprised to learn
that some or all of these called C. I would think a simple algorithm like
this could be implemented easily in perl.

Well, C source code is fine too but I still cannot find the algorithm in C
source code either. There are .xs files that look like C with a lot of
macros but no algorithm.

Can someone help me understand where the source code to the algorithm is
(preferably in perl)?

Also, I as assuming there was a standard algorithm for guids/uuids. Any
information on this will be welcomed (but it might be a little off topic).

Thanks,
Siegfried

Siegfried Heintze

2006-01-10, 4:02 am

Sorry, I lied. I guess there is source code for Data::UUID but I cannot get
it to work on windows.

I tried ppm install Data::UUID and it could not find it.

I tried downloading and following the instructions in the README me but that
produced a lot of syntax errors.

Can someone suggest how I might make Data::UUID install? This happens to me
a lot.

I'm running activestate perl 5.8.7 on Win2003 Server.

Thanks,
Siegfried


$ make
cp UUID.pm blib/lib/Data/UUID.pm
AutoSplitting blib/lib/Data/UUID.pm (blib/lib/auto/Data/UUID)
/usr/bin/perl.exe /usr/lib/perl5/5.8/ExtUtils/xsubpp -typemap
/usr/lib/perl5/5.
8/ExtUtils/typemap -typemap typemap UUID.xs > UUID.xsc && mv UUID.xsc
UUID.c
gcc -c -DPERL_USE_SAFE_PUTENV -fno-strict-aliasing -pipe
-I/usr/local/include
-DUSEIMPORTLIB -O3 -DVERSION=\"0.11\" -DXS_VERSION=\"0.11\"
"-I/usr/lib/perl5
/5.8/cygwin/CORE" -D_STDIR=\"/var/tmp\" -D__cygwin__ -D_DEFAULT_UMASK=0007
UUID
..c
UUID.xs: In function `get_system_time':
UUID.xs:110: error: `LARGE_INTEGER' undeclared (first use in this function)
UUID.xs:110: error: (Each undeclared identifier is reported only once
UUID.xs:110: error: for each function it appears in.)
UUID.xs:110: error: parse error before "time"
UUID.xs:115: error: request for member `QuadPart' in something not a
structure o
r union
UUID.xs:116: error: parse error before "__int64"
UUID.xs:117: error: parse error before "__int64"
UUID.xs:118: error: parse error before "__int64"
UUID.xs:120: error: request for member `QuadPart' in something not a
structure o
r union
UUID.xs: In function `get_random_info':
UUID.xs:134: error: parse error before "MEMORYSTATUS"
UUID.xs:134: warning: no semicolon at end of struct or union
UUID.xs:135: error: `SYSTEM_INFO' undeclared (first use in this function)
UUID.xs:136: error: `FILETIME' undeclared (first use in this function)
UUID.xs:137: error: `LARGE_INTEGER' undeclared (first use in this function)
UUID.xs:138: error: `DWORD' undeclared (first use in this function)
UUID.xs:140: error: `MAX_COMPUTERNAME_LENGTH' undeclared (first use in this
func
tion)
UUID.xs: At top level:
UUID.xs:141: warning: data definition has no type or storage class
UUID.xs:149: error: parse error before "r"
UUID.xs:149: warning: data definition has no type or storage class
UUID.xs:151: error: parse error before '&' token
UUID.xs:151: error: conflicting types for 'MD5Init'
md5.h:82: error: previous declaration of 'MD5Init' was here
UUID.xs:151: error: conflicting types for 'MD5Init'
md5.h:82: error: previous declaration of 'MD5Init' was here
UUID.xs:151: warning: data definition has no type or storage class
UUID.xs:154: error: parse error before '&' token
UUID.xs:154: warning: data definition has no type or storage class
UUID.xs:155: error: parse error before '&' token
UUID.xs:155: warning: data definition has no type or storage class
UUID.xs:156: error: parse error before '&' token
UUID.xs:156: warning: data definition has no type or storage class
UUID.xs:157: error: parse error before '&' token
UUID.xs:157: warning: data definition has no type or storage class
UUID.xs:158: error: parse error before '.' token
UUID.xs:160: error: parse error before '.' token
UUID.xs:160: warning: data definition has no type or storage class
UUID.xs:167: error: parse error before '&' token
UUID.xs:168: error: parse error before '&' token
UUID.xs:168: error: conflicting types for 'MD5Final'
md5.h:85: error: previous declaration of 'MD5Final' was here
UUID.xs:168: error: conflicting types for 'MD5Final'
md5.h:85: error: previous declaration of 'MD5Final' was here
UUID.xs:168: warning: data definition has no type or storage class
make: *** [UUID.o] Error 1

Administrator@king-mark /c/temp/3/Data-UUID-0.11
$ cd /c/perl/bin

Administrator@king-mark /c/perl/bin
$ ./ppm
PPM - Programmer's Package Manager version 3.2.
Copyright (c) 2001 ActiveState Corp. All Rights Reserved.
ActiveState is a division of Sophos.

Entering interactive shell. Using Term::ReadLine::Perl as readline library.

Type 'help' to get started.

SetConsoleMode failed, LastError=|6| at c:/Perl/site/lib/Term/ReadKey.pm
line 26
5.
ppm> install Data::UUID
Searching for 'Data::UUID' returned no results. Try a broader search first.
ppm>


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2009 codecomments.com