Perl script to extract and present hex colors found in arbitrary text

The following script searches STDIN for 3 or 6 symbol hex values and prints a html structure that represents those values as colors on page. #!/usr/bin/perl -wuse Set::Scalar;$uniqueColors = Set::Scalar->new;while( defined( $_ = <STDIN> ) ){ while ( $_ =~/(#[a-fA-F0-9]{1,6})/g ){ $uniqueColors->insert( $1 ) }}print <<HEADER;<!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01//EN” “http://www.w3.org/TR/html4/strict.dtd”><HTML> <HEAD> <TITLE>Found HEX […]

Interesting remarks on using standard libraries

While searching for implementation of Sets in Perl bumped into these interesting arguments for using standard libraries on StackOverflow. Use one of the many Set modules on CPAN. Judging from your example, Set::Light or Set::Scalar seem appropriate. I can defend this advice with the usual arguments pro CPAN (disregarding possible synergy effects). How can we […]

Oracle SQL selects to get familiar with table naming standard and to find junk tables in scheme

Run following selects to discover prefix and suffix hierarchies and to get count of particular prefix/suffix occurrences. That will help you become familiar with naming standard and to find suspicious prefixes/suffixes that belong to tables that probably store junk data. with prefix_generator( prefix, p_prefix, object_name, lvl ) as ( select regexp_substr( object_name, ‘.*?_’ ) prefix […]