Bob, et al --
...and then bob ackerman said...
%
% On Sunday, July 7, 2002, at 05:47 AM, David T-G wrote:
%
...
% > # $_[0] =~ /tcsh/ && $setenv = "setenv" ;
% > # $_[0] =~ /tcsh/ && { $setenv = "setenv" ; } ;
% > # $_[0] =~ /tcsh/ && { $setenv = 'setenv' ; } ;
% > # if $_[0] =~ /tcsh/
% > # {
% > # $setenv = "setenv" ;
% > # $equals = " " ;
% > # }
...
% >can you please tell me why the various commented formats don't work? I'm
% >going to need to set multiple things, so the last commented version is
% >best, but even more I just plain don't like "action if test" format :-)
% >
%
% you need to use 'and' instead of '&&' because of precedence.Ah. Hmmm... Guess I'll need to go back and read up more on that, though I do specifically remember the "or vs ||" example and why the binding of the English-style versions is of lower precedence... I just didn't get how it applied here. So that's doing a $_[0] =~ ( /tcsh && $setenv = "setenv" ) or the like? % using 'w' option would have showed problem: I "use warnings" instead, but it was there. % Can't modify logical and (&&) in scalar assignment at ./tst line 5, near % ""yes\n" ;" (in my own test) Well, it did, but I didn't understand it :-) % % also, the 'if' statement needs parens around the condition. I had *just* realized that myself as I was looking this over again. Duh! Anyway, I've pulled down Switch.pm and I'm quite happy with it :-) % % pob Thanks & HAND :-D -- David T-G * It's easier to fight for one's principles (play) [EMAIL PROTECTED] * than to live up to them. -- fortune cookie (work) [EMAIL PROTECTED] http://www.justpickone.org/davidtg/ Shpx gur Pbzzhavpngvbaf Qrprapl Npg!
msg27094/pgp00000.pgp
Description: PGP signature
