|
I'm not sure if you're basing your question off of what satest4 said, but 'eq' is not so slow as to make it unwise to use. Use eq and == where appropriate, ie, eq for strings and == for integers, and don't worry about the performance implications of either.
|
# ¿ Jan 20, 2009 23:23 |
|
|
# ¿ May 21, 2024 17:40 |
|
Erasmus Darwin posted:Close. You want a dollar-sign in front of test, not a percent. So it's: Older versions of ActivePerl were buggy when using this syntax (referencing nested hashes without the arrow operator). Because of that, and the inconsistent (to new developers) quoting rules for hash keys, I find it's better to write $false_thing = $test{'little_hash'}->{'foo'}, though it may never matter for you.
|
# ¿ Aug 13, 2009 08:02 |
|
TheHeadSage posted:what issues would I run into? Locking all tables from writes every 15 minutes to insure consistency? Are you using innodb with transactions? Edit: Er, sorry, I'm assuming you're using mysql, is that correct? Ninja Rope fucked around with this message at 07:02 on Sep 21, 2009 |
# ¿ Sep 21, 2009 06:54 |
|
I don't recall if this was covered already, but can someone give me a rundown of the various web frameworks? CGI::Application/Titanium, Maypole, Catalyst, Jifty, etc? I've been putting together a simple site for a non-work project and I figured it would be a good excuse to learn a framework but it seemed like none of them integrated well with fastcgi, and the ones that did would take too long to learn. They're all probably too large for something simple like what I'm working on, but I'd still like recommendations for what to look at for the next time a big project comes along.
|
# ¿ Jun 3, 2010 15:52 |
|
My biggest problem with the logo is this:perl6.org posted:Hi, my name is Camelia. I'm the spokesbug for Perl 6, the spunky little sister of Perl 5. I think personifying a logo and having it "talk" to users is too childish, perhaps even creepy. Programming languages don't need to be playful or fun and I think it gives off the wrong impression. Text like the above impedes access to the information users actually want by making them filter through unrelated chatter from the "spokesbug". It also makes promoting perl6 as a serious language alternative harder when the logo looks like something targeted towards children and the websites feature text "written" in first person by a butterfly. A programming language doesn't need a logo, but if it has one it should be unintrusive and only really used to help users identify information related to that language. I don't need to play with it.
|
# ¿ Jun 27, 2010 22:26 |
|
You may want to try replacing calls to sysread with recv and see if that makes a difference.
|
# ¿ Jul 13, 2010 06:55 |
|
mister_gosh posted:Are there any considerations to make with this script on W7? It works fine on my XP machine but does not work in W7 on a particular machine. The permissions appear to be open for the user (I believe they are an admin, in fact): Isn't that just Windows 7 keeping the user from writing to the root of the drive? It's not enough to be "an admin", you have to run the interpreter as "an admin", ie, via right-clicking it and saying "Run as administrator". Alternately, make that open() || die $! so you at least get an error message?
|
# ¿ Dec 15, 2010 23:11 |
|
There are also a million date manipulating modules you could use. Date::Time, Date::Manip, and Date::Calc come to mind.
|
# ¿ Apr 26, 2011 04:25 |
|
The time it takes new to return is going to depend on a lot of things, including how the remote end responds (or doesn't respond) to closed or blocked ports and the number of retries configured. TCP is guaranteed to return eventually from connect(), but the amount of time depends on a lot of things.
|
# ¿ Oct 7, 2011 02:03 |
|
Can you expand on "don't pre-declare variables"? Ever? Or just in this instance? For variables used a bunch of times throughout a function, I find it better to pre-declare them.
|
# ¿ Nov 28, 2011 12:14 |
|
OriginalPseudonym posted:You can, but it's finicky. Or you can try sending a Content-Disposition header.
|
# ¿ Dec 9, 2011 04:03 |
|
syphon posted:I'm sure people are gonna hate me for saying this... but I've used CGI + HTML::Template + CGI::Ajax for smaller webapps with great success before. I keep trying to get into Catalyst or Plack (this was before I knew about Dancer) and the added overhead just seemed tremendous for what I was trying to do. Or CGI::Stateless, CGI::Session, CGI::Cookie, HTML::Template, and AnyEvent::FCGI?
|
# ¿ Jan 18, 2012 22:31 |
|
I like a lot of control and don't really trust stuff like DBIx::Class. What's the best web framework to use that lets me write my own SQL, account management, etc?
|
# ¿ Jan 19, 2012 06:02 |
|
Or strace and look for calls to open/connect/whatever unix sockets use?
|
# ¿ Mar 8, 2012 23:27 |
|
I don't understand what you're asking. After you open a file you can append to it by seek()'ing to the end before writing. If you want to re-read that file from the start with the data you appended, seek() to the beginning before reading.
|
# ¿ May 16, 2012 07:51 |
|
Lots of resumes, all terrible.
|
# ¿ Aug 4, 2012 03:01 |
|
I've started asking for code examples. Everyone who makes it to round 2 gets an example spec and is expected to write a unix daemon that implements that spec. Doesn't matter what language, I figure a good programmer can learn Perl faster than we can turn a bad programmer into a good one. Similarly, if anyone wants a Perl job in the Bay Area. I think we re-locate, but I'm not sure.
|
# ¿ Aug 4, 2012 22:52 |
|
GTGastby posted:I'm trying to kill a particular process (foo) from within a perl script (bar). It could be the $2 being interpolated due to the double quotes, but you should probably re-write it to use something like Proc::ProcessTable and kill().
|
# ¿ Aug 15, 2012 04:13 |
|
uG posted:I'm sure there is a reason its not a good idea, but why can't I use system/exec calls to run code inside a thread (to avoid running out of memory)? Threads share address space, so any memory they allocate is counted against you too. But from the way you formed that question I'm guessing that if you give a better description of what you're trying to do we can come up with a better solution.
|
# ¿ Oct 6, 2012 21:15 |
|
I like The Regex Coach but the newer versions are Windows only. Edit: It's free.
|
# ¿ Oct 23, 2012 00:13 |
|
Roseo posted:You can open a file with a scalar filehandle, which gives it implicit scope. You don't bneed to close it, for example, it'll do so when it goes out of scope. Though you are using three arg open, that's good. Doesn't it get closed when Perl GC's the variable? Which doesn't necessarily have to happen right as it goes out of scope, it could happen later (or possibly not until the program exits?). In practice it will close the filehandle pretty much right after it goes out of scope but I don't believe that's a guarantee. If you need the handle closed it's best to close it explicitly.
|
# ¿ Nov 1, 2012 06:40 |
|
Haarg posted:variables are guaranteed to be cleaned up immediately when they go out of scope Not that I don't believe you, but can you show me where it's documented? I'd like to know more.
|
# ¿ Nov 1, 2012 23:29 |
|
In addition to that, many modules are pure perl.
|
# ¿ Dec 8, 2012 20:35 |
|
|
# ¿ May 21, 2024 17:40 |
|
Pollyanna posted:Okay, so the input parameter is not getting passed for some reason. Is it because of the way I wrote it? If I try print $cgi->textarea({-style=>"height: 200px; width: 300px;", -name=>"input"});... The (curly) braces make a big difference. The braces indicate that a new hash table should be created containing the keys/values inside the braces and than that hash table should be passed to the textarea() method. The text area method doesn't want a hash table, so passing it one causes things not to work. CGI is a little confusing about what methods want hash tables and what don't, so it helps to check the perldoc often.
|
# ¿ Dec 17, 2013 05:18 |