|
^^ I think you don't even need do, wouldn't just curly brackets suffice? a little gem I recently stumbled over: How to sort a subset by a given ordered superset: code:
code:
|
# ¿ Oct 30, 2007 19:15 |
|
|
# ¿ Apr 30, 2024 04:59 |
|
by the way, this also works: code:
|
# ¿ Dec 18, 2007 18:54 |
|
Someone posted a module that, when ncluded, would change all string literals to pirate speak or something like that, does someone remember the link?
|
# ¿ Apr 3, 2008 18:34 |
|
how aboutcode:
|
# ¿ Apr 7, 2008 19:28 |
|
^^^ might look a bit hackish, but maybe ($col1, $col2, ..., $col160) performs faster? I would really like to see a simple benchmark of the various methods posted so far, including the regexp. I think the regexp wouldn't perform too badly, since it gets compiled once at compile time and should be reasonably fast after that. If you build it with fixed length matches of any character it won't have backtracking or complicated matching cases.
|
# ¿ Apr 8, 2008 15:03 |
|
code:
code:
What the sub probably expects is: code:
|
# ¿ May 23, 2008 19:38 |
|
LightI3ulb posted:Does anyone know of any modules that would allow me to receive mail and work with the attachments? The ones I've found on google are typically just for sending. How do you define "receiving"? opening a port and listening to it? You're better off with letting a proper mail demon handling the receiving and a perl module reading a mbox file or Maildir frequently.
|
# ¿ May 23, 2008 19:40 |
|
Triple Tech posted:So I want to call method from a super class that uses data defined in each sub class. Sort like... What type is your object? blessed hashref? inside-out object?
|
# ¿ Jun 26, 2008 16:21 |
|
Triple Tech posted:What's a compelling reason to use an INIT block versions just some code in main:: when making a module? My coworker says it's easier to tell how code in a module breaks if it's inside an INIT, versus main where it just says module use failed. I told him, you could see the error if you just ran the module as a script. Thoughts? You put initializaton and unloading code into INIT, BEGIN and END blocks when you're writing scripts that get compiled once and then used precompiled, like FastCGI and PersistentPerl edit: Irssi scripts, too. edit: not necessarily irssi scripts, but I think I had a case once when I used it. heeen fucked around with this message at 19:55 on Aug 14, 2008 |
# ¿ Aug 14, 2008 19:27 |
|
SubG posted:What's the syntax for POSTing a multiple SELECT input via LWP::UserAgent? If I remember correctly you have to submit foozle=>foo and foozle=>bar together. wait, that doesn't work here... try using an array instead of a hash: $ua->post('http://some_url',[foozle=>'foo', foozle=>'bar']); heeen fucked around with this message at 23:51 on Aug 22, 2008 |
# ¿ Aug 22, 2008 23:43 |
|
SpeedFrog posted:To be honest I can't really see any reasonable use for wantarray(). code:
return generateHugeListOf10_000_000elements() if wantarray; return $numberof10_000_000elements; heeen fucked around with this message at 18:57 on Aug 27, 2008 |
# ¿ Aug 27, 2008 18:49 |
|
Behold my palindrome test:code:
|
# ¿ Nov 11, 2008 12:03 |
|
whoops forgot to add start and end markers to the regexp.code:
|
# ¿ Nov 11, 2008 15:12 |
|
code:
|
# ¿ Nov 21, 2008 15:55 |
|
Riddle me this: why does php outperform perl in this nsieve test twelve-fold: http://shootout.alioth.debian.org/gp4/benchmark.php?test=nsieve&lang=perl&id=2 http://shootout.alioth.debian.org/gp4/benchmark.php?test=nsieve&lang=php&box=1 I converted the perl version from lists to strings like the php version, and it made it two seconds slower, so that can't be it.
|
# ¿ Apr 7, 2009 22:55 |
|
|
# ¿ Apr 30, 2024 04:59 |
|
Triple Tech posted:That implementation is gay. Looking at the C implementation, I'm going to assume these aren't out to prove how a certain data structure performs (array access), but to just solve the problem. You'd use a bit vector with vec(). (See Computing primes) There's a seperate version with bitsets for each language.
|
# ¿ Apr 7, 2009 23:13 |