On Sep 5, Elliot Tobin said: >If my constructor takes four arguments, ala: > >my ($instanceName, $instanceHost, $instanceUser, $instancePass) = @_; > >What's an eloquent way of looping through those four and setting their >value to "" if there are no arguments passed?
Well, I take it you mean you can send either the name, the name and host, the name and host and user, or the name and host and user and password. If that's the case, you can be ultra-sneaky and do: my ($name, $host, $user, $pass) = (@_, "", "", "", ""); or even shorter: my ($name, $host, $user, $pass) = (@_, ("") x 4); -- Jeff "japhy" Pinyan [EMAIL PROTECTED] http://www.pobox.com/~japhy/ RPI Acacia brother #734 http://www.perlmonks.org/ http://www.cpan.org/ ** Look for "Regular Expressions in Perl" published by Manning, in 2002 ** <stu> what does y/// stand for? <tenderpuss> why, yansliterate of course. [ I'm looking for programming work. If you like my work, let me know. ] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]