in reply to Re: Problem with "use constant" and UDP socket connection
in thread Problem with "use constant" and UDP socket connection
As others are very quick to point out that constants are for constants, using "use constant REMOTE_HOST" is not my choice. It's necessary because Socket wants its information that way. What seems unnecessary is not being able to specify a server name through a variable.
I feared "use Socket" would immediately pull it in, but thought I read somewhere I could do an 'if' around it. Guess not.
With your example "use constant REMOTE_HOST => shift(@ARGV)", this works at compile time because @ARGV is known at compile time?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Problem with "use constant" and UDP socket connection
by TedYoung (Deacon) on Oct 21, 2005 at 13:14 UTC |