CRM Newsletter
 
NEWSLETTERS
 

CIO.com updates, insights and advice on technology, management and your career.

 CIO BlackBerry News and Tips
 CIO Research and Analysis
 CIO Microsoft
 CIO Insider
 
 
 
LEADERSHIP
 
CIO Executive Programs
The Leader in Face-to-Face Education for Senior Executives

Offering regional and national programs, CIO (and CSO) events bring together some of the most respected names and thought leaders in information technology and security. Presented by CIOs and other senior level executives, these invitation-only programs offer timely topics and strong networking. Learn More »

 
CIO Executive Council
A Peer-Advisory Service and Professional Association for CIOs

Public Council Teleconference: Application Rationalization — Hidden Costs and Smart Decisions

November 17 at 11:00 am US/Eastern (GMT-5)

Join Honorio Padrón, of The Hackett Group, who will share the drivers for companies to tackle application rationalization and the results of research that define the hidden cost of complexity. Additionally, we will discuss key decision milestones—to start or not, holding the course steady and fulfilling expectations.

Virtual Desktop Cost-Benefit Analysis — Michael Jacobs, Catlin Group

The analysis contained in this presentation measures the cost of everything from the machines and licenses to the infrastructure for virtual vs. traditional desktop environments.

Honor your best senior team members - Apply for the CIO Ones to Watch Award

Get well-earned public recognition for your top up-and-coming team members, your IT organization and your enterprise. Award winners will be announced, publicized and feted in May 2010, great timing to help attract new IT recruits to your company.

More / Register »

Learn more about the CIO Executive Council »



 
 
RESOURCE CENTER
 
 
 
 

You Used Perl to Write WHAT?!

Every programming language has its strengths...and its weaknesses. We identify five tasks for which perl is ideally suited, and four that...well, really, shouldn't you choose something else?

 

PAGE 2

Not So Good: Beware

Just like there are places where perl is a great fit, there are some uses that just aren't right. Here are a few potential applications that should make you run screaming into the night.

  1. Real-time or high-performance applications: Perl is an interpreted language. In general, interpreted languages are not known to be speed demons. In researching this article, the most glaring example I found of someone who took perl to a place it didn't want to go was a gentleman who decided to implement a ray-tracing program for 3-D computer graphics in perl. Even he admits it was a perverse thing to do!

    When looking at a potential application, if it seems to be characterized by a lot of tight loops over intensive calculations, you should probably be looking elsewhere.

    Similarly, if the application is dependent on real-time response (especially life-critical or mission-critical response), perl won't give you those kind of performance assurances, at least out of the box.

  2. As a replacement for shell scripts: "But wait!" you scream, "You just told me I should be using perl to replace shell scripts." And you should—if you do it right. Consider these two sample scripts:

    @files = `ls .`;
    for $file (@files) {
       system("cp $file $file.bak");
    }

    versus:

    use File::Copy;

    opendir(DIR, ".");
    @files = readdir(DIR);
    close(DIR);

    for $file (@files) {
       if ($file =~ /.doc$/) {
            copy($file, "$file.bak");
       }
    }

    There's no question that the second version is longer. However, the first version will fork a subshell to do the ls, and then a subshell every time it moves a file. The second version never needs to fork a shell (which is memory- and performance-wasteful). I've seen perl scripts that are nothing but a series of system calls to shell commands.

    Sometimes you can't get around using a system or backtick command in a perl script, but whenever possible, use the native functionality that mimics the shell call you'd otherwise make. This has the additional benefit of making the script portable. The first version of our sample script won't run on Windows, while the second one works on both Linux and Windows.

  3. As a Web scripting language: One of the earliest usages of perl, as the Web evolved, was for CGI programming webpages. As a result, perl has some pretty strong packages for dealing with Web forms. There is also support for embedding perl into HTML in the same way the Java is embedded into JSP pages.

    However, I would argue that more modern Web scripting languages, such as PHP and Ruby on Rails, offer more out-of-the-box Web support and a cleaner integration into the webpage experience. You should especially avoid using perl for traditional CGI-style form processing; this code tends to be hard to read and maintain because the HTML ends up inlined inside the perl code.

  4. In an obfuscated fashion: Larry Wall, creator of perl, famously stated, "Perl is designed to give you several ways to do anything." As a result, some developers have adopted the style of writing their code as compact and "elegantly" as they can. The results can sometimes be programs that look more like dialup line noise than supportable code.

    Remember that the full version of Wall's quote states, "Perl is designed to give you several ways to do anything, so consider picking the most readable one." Break up long lines into several statements, store intermediate values rather than passing them down a long chain of functions and use comments and whitespace to make the code clear.

 
 
Loading...
 
WHITE PAPERS

Top 10 Business Drivers

The restructuring of Wall Street that took place in 2008 will have a major impact on the investment management business in 2009.
 

How is open source changing the face of enterprise software?

Learn how open source and business intelligence ignite enterprises to reach new levels of performance excellence.
 

Red Hat Open Source Security

The rapid innovation and collaboration of open source development helps Red Hat provide industry-leading security tools and processes.
 

Now is the Time for Open Source

In today's economy, we are all trying to do more with less. Another modern business necessity is flexible, mobile data and systems-complex IT.
 

Bridging the IT Visibility Gap in Complex Composite Applications

Composite Application Management
 

Enhance the Performance of your Data Center

Enhancing performance through Virtualization realizes operational efficiencies and offers reliability.
 

WEBCASTS

IT Consolidation Made Easy

The Primary IT Initiative for Reducing Costs
 

CIOs Weigh In On Virtualization

Date: November 19, 2009 Time: 2:00 PM EST

Gary Beach, publisher emeritus of CIO magazine,...
 

Webcast- Vantage 11: Redefining Application Performance Management

Redefining Application Performance Management
 

Architecting Business Intelligence Applications for Change: The Open Solution

Architecting BI Applications for Change
 

Taking a Seat at the Executive Table: The Reality of Virtualization

This year, for the first time, the number of virtual machines is on track to exceed the number of physical machines...
 

Who Are the Data Center Leaders?

Today's data center is still very much a heterogeneous environment. Gabriel Consulting recently surveyed over 250 d...
 

Resource Alerts

Get instant email notifications by topic when white papers, webcasts, and case studies are added to our library.

 
FEATURED SPONSORS
 
 
 
SPONSORED LINKS
 

Disciplined Autonomy: Resolving the Tension Between Flexibility and Control

Enterprise Capture: Your Onramp to Business Process Automation

Seven Technologies for Advanced Mail Protection

Server Consolidation: Leveraging the Benefits of Virtualization

Join us at the US-Brazil IT-BPO Summit, on November 10th in New York.

Unified Communications: Thoughts, Strategies and Predictions. Join the discussion

Read the RSA report: Security for Business Innovation

Webcast: Looking to the Cloud for Email and Collaboration Services

64-page prescriptive guide to security, compliance, and IT operations.

Keep your IT expertise up to date. Join the Intel Premier IT Professionals.

A new fleet of PCs with a total ROI in 10 months. Find your ROI.

eZine: A Roadmap to Reducing IT Complexity

Reduce risk, gain agility. See how Progress can help your business.

Virtualization Technology as a Business Solution

eZine: A Roadmap to Reducing IT Complexity

World-class trading technology solutions from NYSE Technologies.

If You're Paying for Telecom, You're Paying Too Much. Contact Asentinel Today.

Trade-In your old printer and save up to $1,000 plus free recycling!

infoBOOM! - The Mid-Sized Company CIO's Exclusive Community

Live Webinar: Applying Business Analytics. Click here to learn more

White Paper: 4 Customer Service Myths

Mobile Security: The Essential Ingredient for Today's Enterprise

White Paper: Improve Agility with Operational Responsiveness

White Paper: 5 Best Practices for Smartphone Support

Global Research: CIOs Weigh In On Virtualization

Tolly Group Lab Test Results: Cisco vs. ShoreTel

SETLabs: The Impact of Performance Engineering

Top to Bottom Performance Management Excellence at the City of Chicago

See how AT&T can help protect your network.

Top Five CIO Challenges

Streamline IT Costs. Boost Performance with WAN Optimization.

Want to know how you can maximize employee productivity?

Build your 1st app FREE with Force.com

TDWI checklist helps define data readiness for analytics. Download report.

Increase UPS efficiency without sacrificing protection.

A Clear View Toward Virtualization

Virtualization Technology as a Business Solution

The rules of infrastructure management just changed.

A Clear View Toward Virtualization

Interactive Q&A helps you discover key ways to maximize IT assets.

Ready to virtualize tier one applications? Check your virtualization maturity.

Think you can't afford a Cisco Switch? Cisco Catalyst Switches are now more affordable.

Five minute business analytics assessment. Immediate results.

The Case for Investing in Business Analytics Technology. Read white paper.

White Paper: Right-Sizing Your Power Infrastructure

Webcast: Unleashing the Power of Customer Data

White Paper: Managed Security for a Not-So-Secure World

SharePoint - Unchecked growth of content is unsustainable.

White Paper: Legacy Tools: Not Built for the Helpdesk

Taking a Seat at the Executive Table: The Reality of Virtualization