360 karma · joined April 14, 2013
> 1. scalar
> 2. array
> 3. void
There's actually no such thing as "array context" in Perl; instead there's "list context". An array is a list that's been stored in a variable (this is a fairly common mistake).
See http://friedo.com/blog/2013/07/arrays-vs-lists-in-perl and http://perlmaven.com/scalar-and-list-context-in-perl for good examples/discussion.
EDIT:
Posted this before I finished the article. Understanding the difference between arrays and lists makes the following potential WTFs a lot clearer:
sub take_two_arrs (\@\@) {
print $_[0], $_[1] ;
}
take_two_arrs @a1, @b1 ; # prints ARRAY(0xAddr) ARRAY(0xAddr)
take_two_arrs ((1,2),(3,4)) ; # error: arrays must be named
The second doesn't work because the prototyped function takes array references, not lists. It would work if you called it like this: take_two_arrs ([1,2],[3,4])
I'll admit that this is baffling. sub what_are (++) {
print $_[0], " ", $_[1] ;
}
what_are ((1,2),(3,4)) # prints 2, then 4
(This is part of the reason that Perl programmers don't use prototypes very often.) perlsub warns:> When using the + prototype, your function must check that the argument is of an acceptable type.
The plus here forces scalar context on the arguments, which are lists (not arrays!), so they return their last elements. This would work how the author probably wants if called like this:
what_are ([1,2],[3,4]); # prints ARRAY(0xAddr), ARRAY(0xAddr)The benefit of studying the humanities is one of personal edification. Students who study art or music in school are likely to be more disciplined and score better on standardized tests than their non-musician/artist colleagues. Not to mention, young students who have a strong background in the humanities are often happier with their quality of life (I know that music was the highlight of my day/week when I was in school).
A patronage program would be great for this type of degree...if any VCs out there want a personal music theorist I'd be happy to apply! My argument is that it is traditionally universities which have been the patrons of these degrees. This goes back at least to the earliest universities in Europe, where students learned the seven liberal arts: grammar, logic, rhetoric, arithmetic, geometry, music, and astronomy. The idea of the university was not to churn out good economic workers (as it tends to be today) but to produce well-rounded human beings. We in the humanities still think this is a worthy goal (and consequently, tend to make much less than our STEM counterparts).
My particular field (music) tends to be much more expensive per student since private lessons must be taught one-on-one. One physics professor could teach 15 students for three hours a week, but a piano professor needs essentially needs 15 hours to teach each of those students for one hour a week. Some of this work can be done in small groups/classes, but higher music education is much more individual.
Some of my colleagues who have graduated now teach at liberal arts schools where their tenure requirement is essentially one presentation at a regional conference or one publication, with a strong record of teaching. Compare this to a large institution, where the expectation has traditionally been that you need a book deal in order to obtain tenure, whether or not you're much good as a teacher of undergraduates.
This seems to me like a pretty dim view of the humanities in general. Research in the humanities is not in the same category as research in Computer Science, for example; there is often little to no free-market value. People who enter the humanities tend to do so (at least in my experience) because knowledge for the sake of knowledge is something worth pursuing. Your next company might not make a fortune knowing more about agricultural practices of the ancient Macedonians, or the concept of fatherhood in the music of Robert Schumann, but people doing that research aren't doing it simply "to advance their career," and not necessarily just to teach new people how to research either.
It has traditionally been the function of universities to foster this sort of research, as a general goal of "making the world a better, more knowledgeable place." It's a societal goal that goes way back: people say that humanity was set back something like 1000 years when the library at Alexandria burned down. This type of research doesn't fit neatly into any of your categories, and it is (I think) a more trenchant problem. Disillusioned humanities PhD's often have problems finding work in the "real world," since companies aren't keen on hiring someone who knows everything there is to know about Macedonian agriculture.
-- a fairly disillusioned Ph.D. student in Music Theory
I was annoyed with manually moving files around, so obviously the solution was to spend many more hours than I ever would have spent doing that writing this instead.