I just started to mess around with Perl because I desperatly need to learn a language for small scripts. The first script I need to write is a program that uploads a few files to an ftp server. I wanted to create a .conf file that would store all the variables. The conf file looks like this:
Code:
# What is the address of the ftp server you want to connect to?
# EXAMPLE: www.domain.org
$WebAddress = www.domain.org
# What is the username for the ftp server?
# EXAMPLE: username
$UserName = username
# What is the password for the user?
# EXAMPLE: password
$Password = password
# What file(s) would you like to upload to the server?
# EXAMPLE: webcam_image.jpg
$WebcamImage = shiner.jpg
$WebcamImageThumbnail = thb_shiner.jpg
Now I know how to do all the ftp stuff in the program but I'm unsure how to read this .conf file in the Perl program. Basically I want the program to read the .conf file and ignore everything that begins with # and all the blank lines.
How would you do this?