I'm sure there is a good reason why this works the way it does.
If I set a local variable inside a ternary operator like:
print ( my $foo = bar() ? $foo : "unknown" )
It works very closely to my expectations (which I'm sure are off). If bar returns any flavor of false, it will print the "unknown" value. And if bar return true it will call the correct part of the operation. But the local variable assignment will not be set so the output will be an empty string.
Anyone know why? Is this a scope thing?
P.S. Yes, I know there are other ways to do this with string printing. In my real world case, I have a much more delicate assignment and would like to cleanly assign and evaluate in one line. Plus I'm curious
I think this adds everything for the XXX into the tree
Unfortunatly, the I thought incorrectly
It also strikes me as yet another good reason to code test cases. Quick feedback to help cement learning.
The article is well worth a read over on the Times site.
There doesn't seem to be any studies looking at solving the same problem with different tools. And if there were any studies, how would you determine the effectiveness of each one? Would it be lines of code, ability to scale, speed of development, simplicity to maintain, or ? It seems that we (coders, developers, engineers,
How does Perl compare itself with java, python, prolog, etc... ? By language attributes (static typing vs. dynamic) but are these meaningful? By performance? By feature X or Y? Maybe 'compare' isn't the best word here... Maybe we should talk about what Perl is strongest at, or most effective at doing and what Java is most effective at. But what happens when you have three languages at all have the same effectiveness, does it turn to style then?
I would love to hear peoples thoughts about this. Or information about research projects going on. Or is it time to write a grant? (like I have any idea how to do that
Another very strange Mac IE rendering problem. I know, I know, I know stop supporting Mac IE already. Unfortunatly at $work nothing is quite that easy.
This time Mac IE's wonderful support (per half the blogs on the planet) for optgroup usage has bit me in the ass. It seems that when you use a multiple select with a size and style height:
<select size="6" multiple style="height=6em;" >
And then include a (or multiple) optgroups in that select. It cannot figure out what the correct option count to start displaying the scroll bar since it doesn't actually count the 'optgroup' element as a display element. An example:
<select size="6" multiple name="stuff" style="height: 6em;">
<optgroup label="Group 1">
<option value="one"> One </option>
<option value="two"> Two </option>
<option value="three"> Three </option>
<option value="four"> Four </option>
<option value="five"> Five </option>
Ah, it was a lovely week. My mac's drive died badly and without warning. My boss indicated that the app I'm in charge of should "consider" (read into that) using JSEE and JSP (I'm a mason, perl, etc... person). And I am dumb enough that I hadn't backed up the mac in fair too long (for my $month = 0; $month
Perl needs a JSEE like system but it needs to be faster and well less JSEE like. But it needs to dress up like J2EE so managers and CTO and ? think it really is J2EE... I know POE is similar but how do we fight the Java hype? Maybe we don't... Paul Graham did have a nice point about Java in his Start Up ideas (that people get paid well for it being a dead end...) But is that just wishful thinking? I can do J2EE but do I want to do it?
I have been listening to Mike Park for the last few weeks. He was in Skankin Pickle back in the third wave ska days but now he is writing really good folk music from a new perspective. He is Korean and his music is very enlighting for those of us not Asian. He addresses concerns that I'm sure many young Asian kids have with their own culture in America (and other places in world) like having loves that are not the same race and not having or wanting the same things in life that their parents do (that sounds pretty universal...). It is nice to hear some different voices in the music world. Give him a listen, buy his CD, support someone doing something different.
Here is a lesson for me. BACKUP your machine!
To start off, I'm not looking for a new job but that doesn't stop me from window shopping.
Working tonight I received this error message:
[Wed Sep 28 23:06:52 2005] [error] Can't locate object method "apache_req" via package "shit" (perhaps you forgot to load "shit"?) at
a bunch of truth in that error message. This is just one time in a million that I forgot to load shit.
BTW, I mistyped shift....