Discussion Locked

Use double bar operator to set values

0 helpful
1 reply
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Set default values the easy way:

The April 8, Perl TechMail discusses the setting of default values. Have you used the || operator in Perl to set default values for variables in your applications? Share your technique with other members.

1 reply

by billmac3

Although I have been using the double bars for setting default values for awhile, I've never really thought of using series of them for multiple possibilities. Also the ||= was an operator I was not familiar with either. That will come in very handy.
Thanks.

This discussion is closed to new replies.