perl random hex

perl random hex
printf "%x\n", rand(16);
Or, perhaps the somewhat more easy to read, depending on who you are:
my @hex = ( 0 .. 9, 'a' .. 'f');
print $hex[rand@hex], $/;
[close] Permanent link · http://querylog.com/q/perl+random+hex

Suggested HTML for linking:
Link preview: perl random hex
29 August 2005 · Internet & computing
The page found by the original query:
Code snippets in Perl and JavaScript
Browse by the page—15 Q&R each
« previous | more »