|
Triple Tech posted:Uhh, what? That sounds way too confusing. Or, if you don't want to have to learn about Ajax, the first HTTP request can just kick it off and send you to a page that monitors the status of the job, with auto-refreshes every so often.
|
# ¿ Nov 17, 2007 03:31 |
|
|
# ¿ Apr 30, 2024 22:06 |
|
Triple Tech posted:I vaguely remember reading this in Perl Hacks or some such, but would it be good to focus on coding a type of Perl that didn't generate as many ops as say another method? Well, I wouldn't exactly call myself a Perl expert, but if the operations required to do A are a subset of the operations required to do B, then A is going to be faster. In this case, you have string scalar assignment versus string scalar interpolation (basically a strcpy()) and then string scalar assignment. Otherwise, it depends on the operations themselves. In regards to the value of teaching one way or another... it depends. In your example I find method 2 to be less indicative of what's going on, so I certainly wouldn't suggest it. But just because one method isn't as fast as another doesn't mean you shouldn't use it -- unless it's causing you noticeable performance problems, I would stick with the way that makes your code the clearest. I've found this especially important in Perl, where it's easy to get yourself into the habit of writing executable line noise.
|
# ¿ Dec 7, 2007 17:39 |
|
Triple Tech posted:I guess I could make up a couple reasons. Well, it's shorter. Perl people love their terse. It's ... traditional, sort of. Also, it's not really an assignment. I'm not saying that the auto flush concept is "incrementable" but it doesn't really support arbitrary assignment, so the equals sign may be implying too much. Whatever, they're both equally bad, but one is less bad than the other. I noticed this too, and my first thought was that, if any nonzero value of $| means autoflush, then maybe $|++ and $|-- are preferred to give stack semantics: code:
|
# ¿ Dec 7, 2007 22:20 |
|
Sartak posted:Nope. $| is deeply magical. $|++ is equivalent to $| = 1. $|-- is equivalent to $| = 1 - $|. Ok, then I have no idea, other than terseness. What's the reasoning for that semantic?
|
# ¿ Dec 7, 2007 22:41 |
|
Triple Tech posted:Oh good, good you can tell me about how Catalyst works then. When I access a URL of a website that's running on Catalyst, what is the server actually hitting? Do all the URLs get submitted as an argument to a dispatcher, or are there individual .cgi files laying around? All I know about Catalyst is that I went to school with the author of this book and he's the crazy shut-in nerd type who's so much smarter than you or any of his professors that he doesn't need to do his work because it's below him, which is why going to school is dumb and they SHOULD just kick him out for failing all his classes.
|
# ¿ Feb 7, 2008 22:56 |
|
Cock Democracy posted:Not quite sure what's going on here... after I make the initial connection, it looks like the printer is trying to open a new connection with me every second or so. Maybe the printer isn't trying to use your socket, but instead connect back? This may require you to keep a listening socket open to accept connections from the printer after the command has been sent. edit: ok, I'll be honest, I didn't actually look at the screenshot, so ignore that. more falafel please fucked around with this message at 16:43 on May 20, 2008 |
# ¿ May 20, 2008 15:53 |
|
Ninja Rope posted:Add use warnings; right before use strict; or you're fired. Out of a cannon. Into the sun. I thought the generally accepted canon was code:
|
# ¿ Jul 23, 2008 16:55 |
|
SpeedFrog posted:perl -w enables warnings globally, which you might not want. use warnings is lexical, and only affects the current file/sub/block. Ah, good point.
|
# ¿ Jul 23, 2008 17:08 |
|
|
# ¿ Apr 30, 2024 22:06 |
|
I've never been much of a Perl expert, but what's the philosophical reason behind Perl flattening lists?
|
# ¿ Aug 27, 2008 03:12 |