Suchergebnisse mit Tag „perl“
How to convert a hash to a string? Perl is TIMTOWTDY but which way is the fastest? I need a checksum (hash, digest) for the hash, so the string must be the same for the same hash every time. Hash keys are not sorted, even a simple join('', keys(%hash)) may be different for each call (if the hash has at least two keys).
Some people always complain, even about the language they've been working with for years while they has other options. One of them recently complained that Perl cleans up objects in unpredictable order during global destruction (after exit; and all END blocks). Here is what happend, how we tracked it down and solved it.
Data is getting bigger and bigger as technology advances. We didn't even think about using something inefficent like XML when I started writing sourcecode on a Datapoint 6600 or even in MS-DOS world, but today? A meg more or less doesn't matter today. But sometimes space is still premium and so it is for my current project. I'm working with short strings (text plus some extra chars, about 6 bit per char) and they should be compressed.
The Perl CGI module is commonly used, but it's heavy. CGI::Simple is more lightweight but lacks some features. Here is a feature not supported by CGI but by CGI::Simple.
Web scripts usually do one thing at a time which is quite good as long as there is not too much to do. But serving thousands of request per minute with thousands of source code lines per request starts getting challenging. Bon Jovi asked for help for web scripts some time ago by writing his song "(Whos gonna) work for the working man".
Well, there are little chances that he had something else in mind, but who cares.
Typical Perl scripts (and others running as CGI-scripts) run and exit once they're done, but this isn't very efficient with medium or high request counts. Persistent solutions like FCGI and ModPerl avoid the additional interpreter loading and compiling phases, but start being challenging if any source file is changed.
SQL hat viele Nachteile, aber einer der größten ist die Unsinnige Aufteilung zwischen der Erstellung und Veränderung eines Datensatzes. mySQL macht es dem genervten Programmiere mit MyISAM auch nicht leichter, denn Row-Locks oder Transaktionen werden nicht unterstützt. Aber ich schweife ab...
Huston, we have a problem. Our company's headquarter isn't in Huston, but anyway... we got inconsistent data between some mySQL tables. There is a cron job fixing such problems but usually only very few records need assistance, much less than 10 a week. Updating the script to find the newly discovery differences was less than a hour, but running it turned out impossible.
OOP in Perl is pretty simple: Every reference may become an object. But trying to use a reference instead of an object for an OOP call results in Can't call method on unblessed reference.
What is profiling?Each script should care of resources (time, memory or CPU time) being used, but some don't. Profiling is a detailed analysis of your script's behavior while it's running.
A profiler notices every processed line, it's callers and called functions and time required to process it.