Archive for the 'Scripting' Category

The Benefits of Using Perl for Your Site

Originally released in 1987, the Perl programing language is not only ideal for creating dynamic web pages, but also performing a variety of system management task.  Unlike other languages, this one was designed to be efficient, easy to use and complete rather than tiny, elegant and limited.  If you want to know how Perl can aid your website, check out the scroll of benefits listed below:

Cleaner Code - With the introduction of Perl 5, it became possible to write code that is far more readable.  Once cryptic variable names can now be replaced with mnemonic identifiers.  Even the error messages are more informative and comprehensive while the optimal warnings will detect many of the mistakes made by novice developers.

Modularity and Reusability - The Perl 5 library is defined in terms of modules, components that can be easily shared between various packages.  A package can be made to import all or just a piece of a module’s published interfaced.  Pragmas, the compiler directives, can be defined and used by the same mechanism.

Object-orientated Programing - Perl supports dynamic inheritance and virtual methods in a simple and straightforward manner with very little new syntax.  Packages can function as classes and filehandlers can be treated as objects.

Highly Compatible and Extensible - Perl 5 can easily be embedded into C or C++ applications and can call or be called by routines through a documented interface.  Thanks to the provided IX preprocessor, you can easily glue C and C++ routines into the framework.  Dynamic module loading is supported and even Perl itself can be transformed into a dynamic library.

POSIX Compliant -The POSIX module is one of the latest Perl modules.  It provides access to all available POSIX definitions and routines via object classes when necessary.

Multi-Simultaneous DBM Implementation - A Perl program can simultaneously access DBM, GDBM, NDBM and SDBM from the same script.  Its DBMOpen interface has been modified in a manner that allows any variable to be connected to an object class that defines its access methods.

Auto Subroutine Upload - Aside from uploading, Perl’s AutoLoad mechanism allows you to define arbitrary semantics for any undefined subroutine call.

Regular Expression Enhancements - Perl 5 allows you to write regular expressions with embedded whitespace as well as comments for better readability.  The added extensibility mechanism is upwardly compatible with older regular expressions.

Innumerable Unbundled Modules - If you read the perlmodlib.manpage, you will discover that The Comprehensive Perl Archive Network contains a large number of plug-and-play modules containing reusable Perl code.

Compilable - Although a fully functioning Perl-to-C compiler does not exist, Perl 5 is capable of generating portable byte code, simple C or optimized C code.

Lexical Scoping - Perl 5 variables can be declared within a lexical scope, similar to auto variables in the C language.  Not only is this feature more efficient, but it also enables better privacy for your programming environment.

You can enjoy all the benefits Perl has to offer by downloading the free software package at the official Perl website or finding a web hosting provider with the language installed on their server.


Website Automation Programming Scripts

Today it seems that every other website owner is looking for ways to implement automated features into their site.  After all, these type of sites tend to be far more effective than those which are non-dynamic and simply present boring text.  Automated features cannot only make your site easier to use for visitors, but easier for you to manage as well.  There are many ways to achieve automation and almost all of them require the use of client-side or server-side scripting.

Common Usage

When it comes to web programming and development, there are a number of specially designed scripts written a language specific to their underlying software packages.  Many client-side scripts such as web browsers are written in Java, which is one of the most widely used programming languages.  CGI, Perl and PHP are some of the most popular server-side technologies.  While CGI offers many features that can provide your site with automation, Perl and PHP are newer languages, and thus faster and higher demand by website owners and developers.  Some of the functionality these scripts offer include:

Shopping Carts - Some of the best e-commerce shopping carts are written in CGI.  This technology is capable of communicating with popular databases like MySQL and as well as MS SQL and Access, making it compatible with Linux, Unix, Windows and Mac OS X platforms.  Other languages used to create shopping cart programs include PHP, Python and ASP (Active Server Pages), a server-side programming framework created by Microsoft.

Form Managers - Many of the forms you view on a website are powered by CGI.  This includes those filled out by customers when they make a purchase.  In most cases, this is a very seamless process as all the customer does is enter their details into the form and click the “submit” button.  From there, CGI goes into action, sending the data to an email address or database where it can be accessed by the website owner.

Pass Protection - Some website owners require that users enter a user name and password before they access a particular area of their site.  This could be the criteria for several motives such as tracking new visitors for marketing purposes, allowing site members to participate in a community forum, or confirming that a customer has completed a purchase to access downloadable products.  The use of CGI scripts is one of the most common ways site owners setup registration that requires users to login with a user name and password.

What’s Your Language?

Scripting languages are abundant and you have several to choose from.  Aside from the scripts mentioned in this article, you can also get automated features with technologies such as Ruby on Rails, Cold Fusion, Server-Side Javascript and many others.  CGI scripts are among the easiest to use as they are pre-scripted and generally come installed and ready use on the hosting provider’s server.  While languages such as PHP and Perl are more difficult to use, they also offer more power and functionality.  Whatever language you choose, you are sure to enjoy a feature-rich website that gives you an edge over the competition.


Four Ways to Improve Perl 5

Perl recently celebrated its 21st anniversary in December of 2008.  And although Perl 5 has seen many changes in its 14 year history, the language still leaves much room for improvement.  Perl 6.0 is sure to change the landscape for server-side programming but is there any way for version 5 to stay relevant?  By adding a few essential elements, Perl 5 can be easier to use, faster and more productive.

Frequent Releases

The Parrot framework is currently in its 24th consecutive monthly release.  This succession of releases has allowed the team to find a nice development rhythm, proving that they can meet commitments while identifying and recovering from mistakes that simply come along with the territory.  While such a cycle for Perl may be difficult and painful to achieve, it could also take the stress out of development by knowing improved functionality and features will soon be delivered in the next version.

Autobox, Moose and Mouse

Autobox is one of the most beloved features of the Ruby programming language, a function that is capable of calling methods on primitives just like they were objects.  Even though Smalltalk’s “everything is an object” theory conflicts with Perl pragmatics, this concept can occasionally eliminate some of the complexity of its code.

While Perl 5 took from Python’s object-orientated system, the nature of its default objects are aimed at flexibility, not simplicity.  Moose and Mouse offer an enhanced default object system that would make Perl 5 much better, scaling upward in functionality for developers that require more power.  With these models subsumed into the core, those utilizing version 5.12 would have an easier path to the object system projected for Perl 6.

ctypes

Perl’s extension system is baroque to say the least, requiring far too much knowledge of its internals to simply pass and return values to and from your shared libraries.  Python’s ctypes library offers a smarter, more practical approach opposed to writing and compiling C code to simply map between Perl’s and C’s calling conventions.  While ctypes isn’t perfect, the concept is sound and therefore, desperately needed in Perl 5.

mod_perlite

Mod_perl is a useful technology but it demands a lot from system administrators.  It can also take over the server and consume vital resources if you’re not careful.  The language could perform a lot better on the web with mod_perlite, which is the equivalent mod_php for Perl, implemented by default.  Serious developers may always have a use for mod_perl but inexperienced users and others who don’t enjoy high-traffic sites could excel with a tool that is easier to use and lighter on resources than CGI.

Conclusion

Recently, many debates have been initiated on the topic of how Perl 5 can be improved.  Other than the consideration of Autobox, Mouse and Moose, it doesn’t seem as if the open-source community has paid any other improvements much, if any attention at all.  While ctypes and mod_perlite might be somewhat outside of the scope of the core developers, Perl has some gaps and deficiencies that make it less desirable than other options on the open-source market.


Popular Options for Dynamic Web Pages

Today’s web hosting services give you a plethora of options in the feature department.  You typically get to choose the utility you want to build your site with, two to three options for webmail and your choice of the available shopping cart applications.  In a Windows package, you may also have the choice of utilizing a Microsoft database such as MS SQL or Access or open-source varieties such as MySQL or Postgre SQL.  Another aspect of web hosting that tends to offer a great deal of variety is scripting technologies.  With these programming languages installed on their server, a host provides a great deal of power by allowing you to create feature-rich, interactive websites.  Of course, there are numerous programming languages but here are some of the most popular options used to create dynamic websites.

ASP.NET

Now a main attraction of many Windows hosting solutions, ASP.NET is a server-side language that has characteristics of Microsoft’s classic Active Server Page technology and the .NET Framework.  This new version offers far more power than its predecessor, decreasing code density in a manner that makes web development faster and much easier.  ASP.NET shares many similarities to open-source languages such as PHP as its code can be implemented into HTML tags.  The major difference is that the technology was specifically designed to run on the IIS web server and Windows operating system.

CGI Scripts

CGI (Common Gateway Interface) scripts are pre-installed tools based on the executable CGI files that are typically stored in the CGI-bin on your web host’s server.  They allow you to incorporate simple features such as clocks and hit counters onto the web page of your choosing.  With CGI, all you have to do is add a line of code into the HTML tag of your web page and a request of the desired action is executed when a web browser loads the page.  Many hosting packages come with a full library of CGI scripts that require absolutely no manual coding.  While easier to use than other dynamic technologies, CGI scripts are notorious for draining resources and causing pages to open slower.

Up and Coming Frameworks

PHP is perhaps the most widely used server-side language while ASP and ASP.NET are becoming dominant as enterprise-level solutions.  However, there are few scripting languages that are gaining ground quickly in both environments: Ruby on Rails, SMX and Lasso.  The Ruby on Rails framework is based on the Ruby programming language, serving a purpose to make to data-driven websites faster and more efficient.  Considered a macro-processing language, SMX is often overshadowed but has actually been around from the beginning.  This tool is quite similar to ASP and PHP, making it a perfect choice for creating HTML or XML web pages.  Lasso makes another great option for building a dynamic website.  This language produces clean code, works fast, and offers a flexibility that allows it to run on virtually any server be it Windows, Linux or Mac OS X.

Conclusion

When it comes to dynamic content, there is certainly no shortage of available tools.  The key is choosing a technology you feel comfortable working with.  You may also want to find one that can serve as a building block that enables you to scale up to more powerful languages in the future.


ASP vs. ASP.NET

First released in 1996, Microsoft’s ASP server-side scripting language has taken the programming world by storm, used for everything from creating dynamic websites to complex corporate applications.  Since its inception, this technology has undergone major changes and been tailored made to support applications of all sorts.  There are mainly two versions of ASP: Classic ASP and ASP.NET.  While there are a few similarities, this article will explain why ASP.NET is far more superior than its predecessor.

Greater Stability

Classic ASP runs under “inetinfo.exe”, an IIS process that makes applications susceptible to crashes.  This occurs because the server must be stopped and restarted on a frequent basis.  The ASP.NET process is separate from inetinfo.exe, resulting in stable applications that are far less susceptible to crashes.

Optimal Code Compiling

Since ASP Classic interprets Jscript or VBScript at runtime, performance may falter due to the process of line by line interpretation.  This basically means that there could be some inefficiencies in regard to the interpretation of pages.  ASP.NET compiles code the first time it is accessed and allows subsequent page requests to be serviced with code that was compiled previously.  This ultimately results in pages that load faster and deliver a better experience to the end-user.

Enhanced Scalability

In Classic ASP applications, components tend to be more difficult to replace, update and maintain.  Typically, updating components in a running application requires that IIS is first shut down, the component is modified and IIS is finally restarted.  ASP.NET was specially designed to enable scalability through efficient application updates.  The built-in “xcopy” deployment model allows pages and components to be replaced in real-time all without the web server needing to be restarted.  If updates are required, programmers can simply perform the modification while the infrastructure accounts for the change the next time a request is made to the page or component that was modified.  This essentially means that updates, bug fixes and enhancements can be made to ASP.NET applications with little to no impact on the end-user.

Greater Language Support

One of the greatest advantages of ASP.NET is that it supports other server-side scripting technologies outside of traditional programming languages.  Classic ASP only integrates with VBScript and Javascript.  With ASP.NET, you can take a number of common program languages such as C# and VB.NET and use them in the same application.  The seamless integration with various server-side programming languages allows the use of more complex frameworks that results in feature-rich applications with deeper programmatic support.

Conclusion

Often referred to as the next generation of web development, ASP.NET has introduced a whole new programming model with the ability to combine server-side controls and data binding with a wide variety of web services.  This language is compatible with all .NET languages and when compared to Classic ASP, the battle isn’t even close.  Anyone familiar with this robust development tool will agree that ASP.NET is just another phase in the saga of Microsoft’s Active Server Pages.  The best is yet to come because ASP will only improve as time goes on.


Next »