Parsing the ridiculously large DNC file – Perl Edition

Recently, one of our customers had a unique problem. The national Do Not Call (DNC) list they pay $15,000 (yes, that’s a comma and yes those are zeros after it) per year for access to exceeded the 2Gb limit imposed by older systems they were running. Specifically, fox pro couldn’t handle 2Gb+ files. So they asked if we could make something for them that would separate the file into smaller files that could be consumed by the out dated system.

So we did…
Continue reading

Power of Perl – Controlling and expanding Cpanel/WHM through the Cpanel/WHM API

When running a shared hosting environment, it is impossible to stay competitive without the use of some form of control panel. And in the world of linux shared web hosting, no control panel is as widely used as cPanel Inc‘s cPanel/WHM combo. The Cpanel team has put a lot of time and effort into the remote administration of WHM, and through that Cpanel. With a little ingenuity and not much work, really, this API can be extended to include any functions you can imagine, up to and including the system administration of the machine itself. So lets look at the basics thereof.
Continue reading

Debugging Perl on Linux – Just __END__ it now! it later.

The art of debugging differs, some, with each language and it’s specific tools. Perl provides an interesting challenge to programmers since it, like most linux-originating languages, has no real IDE wherein it can be debugged step by step with breakpoints and like methodologies. Instead, the perl programmer must resort to using print statements, logging mechanisms, and then there is the __END__.
Continue reading

Building Web Sites for Profit and Fun – Relevant References

The great paradox of the internet is information. The internet provides such a vast array of information that just about anyone can learn just about anything about just about any subject. On the other hand, without near infinite time to weed through it all, it becomes increasingly difficult to find reliable, pertinent, and quality information. The sheer volume has become both the benefit and the draw back. And with as many tech-savvy persons as there are out there, the amount of information pertaining to web design and development is astronomical. Throughout the years, I have gathered a list of sites I have tried and tested for valuable content and who I turn to for relevant references.
Continue reading

Perl on Linux – Greedy Regular Expressions and the Question Marks that Tame Them

In 1986, Larry Wall invented a scripting language to solve the problems of generating reports for system administrators on unix. He called it the Practical Extraction and Reporting Language since that was its function. And it does do that. In a Unix based OS where everything is output in text, Perl has dominated somewhat because it so easy to use but mostly because of its powerful and easily used regular expression capabilities.
Continue reading

Perl on Linux – Formatting Text and Reports

Surely one of the most annoying things about working in a non-gui environment is convenient formatting. We have all had output that was off due to tabs or new lines or variables that overran their boundaries in the output area, etc. Provisioning for such things can be tedious, time consuming, and highly annoying. Luckily for us, perl provides a text formatting feature that is built in and fairly easy to use.
Continue reading

Perl on Linux – Bitwise Manipulations

Today’s attention is directed at one of the less well known and certainly one of the least understood and used areas of perl. Although direct manipulation of bits is the only thing that a computer really does, programmatic manipulation thereof has been abstracted out for all but the tasks that can only be solved by its use. Still, there are situations and times when it becomes necessary and proper for one bit to dissolve the logical bonds which hold them to the byte and to assume, amongst the operators and variables of the language, an equal station.
Continue reading

Perl on Linux – Anonymous Hashes, Hash References, and Passing Them to Subroutines.

There comes a time in every perl programmers life when they have to master the hash. Anyone who has programmed in Perl for very long has run into problems such as subroutine arguments getting confusing, lagging programs due to hash tables being copied over and over, and searched for a simpler way to maintain and access data. All this and more can be achieved by the simple use of anonymous hash tables and the passing of hash table references to subroutines for processing.
Continue reading

Perl on Linux – Making a Daemon

It's me!One if the nice advantages to linux is the ability to create daemons relatively quickly and get them to do your brute and routine work for you. For this example, I am going to use perl to create the daemon, since perl is the glue that holds the bricks of linux together. Its regex functionality combined with fast and easy syntax makes it almost too easy to use for quick and dirty programming in the text based realm of linux. So without further adieu, the daemon:
Continue reading