WebProWorld Dev Forum

where field in() problem
I need to select some information that are in a database..I have category field that contain the numbers of some categories, this field is a text field
Click to read more...

Is there a "within" function in MySQL?
I'm writing some PHP/MySQL code to do affiliate tracking based on the referral URL. Each affilate has already supplied the baseURL of their website. An affilate that has their own domain name would have a baseURL of...
Click to read more...

CGI Feedback Script Download
Does anyone know where to get a good CGI script for feedback forms? I would greatly appreciate it if anyone had any sugestions.
Click to read more...



Recent Articles

PERL Extensibility Enhancements
OpenService announced the availability of NerveCenter 4.0, Open's network fault management and real-time correlation technology. This release adds the first major platform addition to the NerveCenter product line in years - support for Red Hat Enterprise Linux - as well as significant performance enhancements to NerveCenter's industry-standard PERL extensibility for all supported platforms.

New Updated Perl Book
Commonly used for CGI programming and extracting and translating data, Perl is the workhouse of the Internet. With its no-frills, get-the-job-done attitude, Perl is the trusted source behind many websites, two high-profile examples being Amazon.com and slashdot.com.

More Perl Sorting
Perl has an easy to use "sort" function. For example, you might have an array like this: @month=("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December");

Writing COM Components in Perl Part 1
When you strip away all the layers of marketing hype and industry jargon, Microsoft's Component Object Model (COM) is simply a technology that allows you to create an object in the language of your choice, and to make the functionality of that object available to any other object, or any other application, regardless of the language that the other object or application is written in.

Writing COM Components in Perl Part 2
How do I package my PERL code as a COM component? And so, on to the PDK itself. As we said above, the PDK is the development environment you use to create Perl COM objects. The kit itself can be downloaded from activestate.com

Useful Perl Scripts With Regular Expressions
Most computer users, especially software engineers, have had a need to modify multiple files to either add a line of text, modify a line of text, or completely remove a line of text. The problem is that there never seems to be a piece of software out there that can help you with this problem. Some programs let you get close to doing what you want but in my experience none ever let you do exactly what you want; so a few hours are spent opening each file and editing them manually.

10.28.04

Handling Missing Data In Inputs

By A.P. Lawrence

Missing data can be very annoying to a programmer. In fact, it is so annoying that very often we'll write separate programs to clean up data and eliminate unpleasant conditions so that the main program doesn't have to deal with it. Here, I'll show some examples of the kind of problems we see.

Let's take a comman data format, a TAB delimited file. A simplistic Perl program to read such a file might be:



An equivalent shell script might be



The Perl script works, but the shell script doesn't. Here's the output if the imput file looks like this



The Perl script produces

Increase your Link Popularity across major search engines. Get your Free linking popularity report.



but the shell script messes up:



If this were a problem with Perl, we'd handle it like this:



But things can be worse. For example, if we are processing what was once a report format, we may have no delimiters, just empty space. We might see something like this:



You can't process that with delimiters, but you can use unpack:

Read the Rest of the Article.

*Originally Published at http://www.aplawrence.com


About the Author:
A.P. Lawrence provides SCO Unix and Linux consulting services http://www.pcunix.com

About PerlProNews
PerlProNews is a collection of news and commentary designed to keep you in step with the ever evolving landscape of Perl environments. News and Advice for Perl Professionals

PerlProNews is brought to you by:

SecurityConfig.com NetworkingFiles.com
NetworkNewz.com WebProASP.com
PerlProNews.com SQLProNews.com
SysAdminNews DevWebPro.com
LinuxProNews.com WirelessProNews.com
CProgrammingTrends.com ITCertificationNews.com

-- PerlProNews is an iEntry, Inc. publication --
iEntry, Inc. 880 Corporate Drive, Lexington, KY 40503
2004 iEntry, Inc.  All Rights Reserved  Privacy Policy  Legal

archives | advertising info | news headlines | free newsletters | comments/feedback | submit article

Database Forum News and Advice for Perl Professionals PerlProNews News Archives About Us Feedback PerlProNews.com About Article Archive News Downloads WebProWorld Forums iEntry Advertise Contact Jayde