sdyates has asked for the wisdom of the Perl Monks concerning the following question:
I have a text file that contains variables that looks like this:
255.255.255.255 domain.com smtp.domain.com user name <user\@domain.com> sendto <sendto\@sendto.domain.com></p? I use:
open (VARIABLES, "<variables.dat"); @Variables=<VARIABLES>; close VARIABLES;
to read the variables into an array. However, when I try and take user name <user\@domain.com> which is $Variable3 to send an email, only user name is recognised. I am losing <user\@domain.com>. What is wrong here?
Should I be using placeholders? Is there a better way to read variables with special characters into an array? Are the variables being loaded properly, but I need to handle them differently in the script?
I did not think that < and > were special charaters, and adding a \ infront fo them does not help my script. Any thoughts on which way I should direct my learnings?
Please advise,
Simon
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: reading scalars from text file
by perlplexer (Hermit) on May 16, 2002 at 14:32 UTC | |
| |
|
Re: reading scalars from text file
by mrbbking (Hermit) on May 16, 2002 at 16:38 UTC | |
|
Re: reading scalars from text file
by broquaint (Abbot) on May 16, 2002 at 14:33 UTC |