Perl config file Help

HI

I have a config file (ip.config)that has the following fields with colon as delimeter.

yahoo.com:1919 ( host and port number)
rediffmail.com:2020
gmail.com:2121

How to read it in a perl script. I need to parse the host and port number in the perl script using split function ...Please Help

my ($host, $port) = split /:/;

If the input line still has a trailing newline at this point, you want to chomp it first.

I am newbee in perl i want to open this configfile in a perl script. so how to read this config file from a perl script and get the host and port number..
plz help

here you go:

#!/usr/bin/perl
# read_config.pl
my $filename = shift;
my %host_info = ();
open (CONF_FILE, '<', $filename)  or  die "Failed to read file $filename : $!";
while (<CONF_FILE>) {
    chomp;
    next  if (m/^$/);        # Skip empty lines
    next  if (m/^\s*#/);    # Skip comments
    if (m/^(.*?):(\d+)/) {
        $host_info{$1} = $2;
    }
}
close (CONF_FILE);

HI Yogesh

my $filename = shift;
my %host_info = ();

These two syntax giving error..
How i could give my $filename = shift;????

what error do you see?

Hi Yogesh it worked.. Thanks a lot....