≡ Menu

Perl

How do I replace a string with another string in all files? For example, ~/foo directory has 100s of text file and I'd like to find out xyz string and replace with abc. I'd like to use sed or any other tool to replace all occurrence of the word.
[click to continue…]

Q. I'm using lighttpd under CentOS 5 and getting the following error:
...can't handle '$HTTP[url] =~ …' as you compiled without pcre support.

My question is What is pcre support, and how do I solve this problem?

A. Pcre is nothing but Perl-compatible regular expression library. PCRE has its own native API, but a set of "wrapper" functions that are based on
the POSIX API are also supplied in the library libpcreposix. You must compile lighttpd with pcre to support lighttpd regex style config option. pcre-devel package provides the development files (Headers, libraries for static linking, etc) for pcre. Install the following package and rebuild your lighttpd:
# yum install glib2-devel openssl-devel pcre-devel bzip2-devel gzip-devel

Now change directory to lighttpd source code and recompile Lighttpd with pcre option:
# make clean
# ./configure
# make
# make install

Now restart lighttpd and it should support pcre style config options.

Q. How do I find out my IP address assigned to eth0 or ra0 interface using perl?

A. If you need to know the IP address of the UNIX / Linux machine you are running on, use the following perl one liner. Perl don't have any inbuilt facility but combination of ifconfig command ans shell pipes you can craft something as follows to display your system IP address:

Find my IP address using Perl One liner and shell pipes

Type the following command at a shell prompt:

ifconfig -a | perl -ne 'if ( m/^\s*inet (?:addr:)?([\d.]+).*?cast/ ) { print qq($1\n); exit 0; }'

Linux Send Email From Console

How do I send an email using command line under Linux?
[click to continue…]

According to wikipedia "A content management system (CMS) is a computer software system for organizing and facilitating collaborative creation of documents and other content. A content management system is frequently a web application used for managing websites and web content, though in many cases, content management systems require special client software for editing and constructing articles. The market for content management systems remains fragmented, with many open-source and proprietary solutions available."

Most CMS systems are written in PHP/Perl and MySQL database software. According to us following are the best open source content management system:

For more information and in depth comparisons of CMS see:

  • http://www.opensourcecms.com/ - You can try various open source CMS software before install. Includes both admin and user page access.
  • http://www.cmsmatrix.org/ - You can discuss, rate, and compare the various CMS software systems available on the market today including open source CMS systems.