NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.
All the Perl that's Practical to Extract and Report
Stories, comments, journals, and other submissions on use Perl; are Copyright 1998-2006, their respective owners.
Exporting Objects (Score:2)
The reason for not discussing that is that generally, you shouldn't mix exported functions and methods. That's because a method really expects to be called with an object as its first argument, which is less likely to happen correctly if you say method($obj) instead of $obj->method(). Also, you don't get inheritance because you're not going through method dispatch.
I'm sure there are a few cases where you might want to export things, but generally, I'd think twice before pulling in Exporter.
-Dom
Re:Exporting Objects (Score:2)
Wha?? (Score:2)
Some objects are written such that when you use them, you have to import the methods you'll be using, like:
use My::Module qw/ method1 method2
And others are written so you can just say:
use My::Module;
And then you automatically have access to the methods.
Jason
Re:Wha?? (Score:2)
I think you're getting confused between ordinary functions and OO code (methods). If you don't call it with an arrow, it's not a method, it's a function (with the annoying exception of the indirect method call syntax, but don't worry about that yet).
When you use a module, you're actually using OO behind the scenes, even though the results aren't usually OO. What happens is that Perl ends up calling the import() method of the named class and passing it the list that you have supplied.
What makes it a me
Re:Wha?? (Score:2)
If I could, I would mod this up.
Presentations (Score:2)
You might want to look at S5 [meyerweb.com]. It's all html, css & javascript.
-Dom
eating healthily in the UK (Score:2)
Drink fresh fruit juice instead of fizzy drinks, avoid places like macdonalds and instead go to places like Beetroot in soho or any Felafel restaurant. Even the average pub grub in london is fairly well balanced, just so long as you have carbs in the day and protein in the evening. The hotel you stayed in would have provided continental breakfast so thats the day sorted.
Also avoid s
@JAPH = qw(Hacker Perl Another Just);
print reverse @JAPH;
Re:eating healthily in the UK (Score:2)
-Dom
Re:eating healthily in the UK (Score:2)
Re:eating healthily in the UK (Score:2)
And in whose footsteps did we follow this trend..? The home of fast food, the United States.
Fortunately the government acknowledges the problem and is doing something (although, as always, just a token effort rather than really making a difference).
It isn't hard to eat healthily though, most of the obesity isn't because there isn't access of healthy food (very very few people, and certainly a tiny minority of the overweight are more than a mile from the nearest affordable source of fresh vege
@JAPH = qw(Hacker Perl Another Just);
print reverse @JAPH;
Re:eating healthily in the UK (Score:2)
Unhappily so.
Supermarkets aren't quite so prevalent here (at least in Pittsburgh) because they tend to be larger and most people drive instead of walk for their groceries. (Boo!) But it's actually much easier to eat healthier almost everywhere you go now -- even many fast food places have one or two items that, while you might not want it for every meal, will do in a pinch. (Salads and such.) I don't think it's a coincidence that it's also much easier to get at least decent bee
Re:eating healthily in the UK (Score:2)
It's similiar to being in a restaurent when somebody chooses the "healthier" fish option without realising that the sauce contains more fat content than the rest of the menu combined.
-Dom
Re:eating healthily in the UK (Score:2)
Well, then as lazy programmers, we are all doomed!
Seriously, this is really the bottom line - we have grown too comfortable with ignoring the nutritional value (or lack thereof) of what we eat. We've also "outsourced" our decisions to companies who really don't care about us, but about their profits. Put 'em together and it's a bad situation where we're creating a demand for Bad Food and it will only get worse.
The South Beach Diet may be a fad, but at least it's creating awar
Re:eating healthily in the UK (Score:2)
You can get low-carb food in any health food shop or pharmacy along with the usual snake oil and trendy gimmicks.
The brits are on the whole aware of what we consume, its just that many of us consume too much and have a drinking culture that adds even more weight.
oh and laziness, the information and the decent food (even organic, lo
@JAPH = qw(Hacker Perl Another Just);
print reverse @JAPH;