Code Comments
Programming Forum and web based access to our favorite programming groups.> also
> "or die" is more preferable than "|| die"
Why is that? :) I was actually going to post a question about ambiguity
syntax later, but here it is anyway. Are the following 4 equivalent?
1)
if ($b) {
$a = $b;
}
else {
$a = $c;
}
2)
$a = $b or $c;
3)
$a = $b || $c;
4)
$a = $b ? $b : $c;
Also there was an example on the web that completely threw me off. Although
this works:
local ($/);
,I have no idea how it undefs $/. Points to a good reading on the
subject are equally appreciated.
Thanks
Peter
Post Follow-up to this messageOn Wed, Apr 27, 2005 at 09:06:39AM -0500, Peter Rabbitson wrote: > Also there was an example on the web that completely threw me off. Althoug h > this works: > > local ($/); > Sorry about this last one, I undrestand the idea of local for globs, I just thought that local $/; and local ($/); differ. While reading your answers I realised that it's the same as saying: my ($a); which is equivalent to my $a; It is pretty weird to have equivalent operators ( 'or' / '||' ) with different precedence. I guess this is where TIMTOWTDI bites back really bad... learning something new every day :)
Post Follow-up to this message
Show a Printable Version
Email This Page to Someone!
Receive updates to this thread
Powered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.