I am writing an editor using Scintilla.
I am already using a lexer to do automatic syntax highlighting but now I'd like to mark search results. If I want to mark only one hit I can set the selection there but I'd like to mark (e.g. with yellow background) all the hits.
I writing this in Perl but if you have suggestions in other languag...
I am currently developing a website using basic cgi to turn out pages. I would like the website to be changed to have a better (read dynamic) interface.
What techniques (if not AJAX) and/or tutorials would you recommend to get me started?
...
How do I make an array shorter in Perl? I read some webpages indicating that I can assign:
$#ARRAY = 42;
I read that the use of $# is deprecated. I need a solution that will work for an array of arrays, too. This didn't work:
$#$ARRAY[$i] = 42;
...
Given a date/time as an array of (year, month, day, hour, minute, second), how would you convert it to epoch time, i.e., the number of seconds since 1970-01-01 00:00:00 GMT?
Bonus question: If given the date/time as a string, how would you first parse it into the (y,m,d,h,m,s) array?
...
Let's say I have an array, and I know I'm going to be doing a lot of "Does the array contain X?" checks. The efficient way to do this is to turn that array into a hash, where the keys are the array's elements, and then you can just say if($hash{X}) { ... }
Is there an easy way to do this array-to-hash conversion? Ideally, it should be v...
Is there any way to use a constant as a hash key?
For example:
use constant X => 1;
my %x = (X => 'X');
The above code will create a hash with "X" as key and not 1 as key. Whereas, I want to use the value of constant X as key.
...
sub foo {[$#{$_[!$||$|]}*@{$_[!!$_^!$_]}?@{$_[!$..!!$.]}[$_[@--@+]%
@{$_[$==~/(?=)//!$`]}..$#{$_[$??!!$?:!$?]},($)?!$):!!$))..$_[$--$-]%@{
$_[$]/$]]}-(!!$++!$+)]:@{$_[!!$^^^!$^^]}]}
update: I thought the word "puzzle" would imply this, but: I know what it does - I wrote it. If the puzzle doesn't interest you, please don't waste any ti...
AFAIK one of the objectives of Stack Overflow is to make sure anyone can come here and find good answers to her Perl related questions. Certainly beginners would ask what is the best online source to learn Perl but others might just want to ask a question.
Probably the friendliest place is the Monastery of Perl Monks. It is a web site w...
What is the most important module you pull off of CPAN to add to a stock Perl install?
One module only per response, please.
Please explain why you think the module is best-of-breed
...
What are the best continuous integration frameworks/projects for Perl and why?
...
More information from the Perl 6 Wikipedia entry
Junctions
Perl 6 introduces the concept of junctions: values that are composites of other values.[24] In the earliest days of Perl 6's design, these were called "superpositions", by analogy to the concept in quantum physics of quantum superpositions — waveforms that can simultaneously oc...
I'm trying to understand someone else's Perl code without knowing much Perl myself. I would appreciate your help.
I've encountered a Perl function along these lines:
MyFunction($arg1,$arg2__size,$arg3)
Is there a meaning to the double-underscore syntax in $arg2, or is it just part of the name of the second argument?
...
Doesn't work with other modules, but to give an example. I installed Text::CSV_XS with a CPAN setting:
'makepl_arg' => q[PREFIX=~/lib],
When I try running a test.pl script:
$ perl test.pl
#!/usr/bin/perl
use lib "/homes/foobar/lib/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi";
use Text::CSV_XS;
print "test";
I get
...
I am currently in the process of designing a database-driven website to manage various personal data and some business data. This is primarily a personal app, however it will be used by a few clients to retrieve and update information. Is Perl still a viable language to code a website with the newer .NET options, Python, etc. available...
I already know the obvious answer to this question: "just download <insert favorite windows grep or grep-like tool here>". However, I work in an environment with strict controls by the local IT staff as to what we're allowed to have on our computers. Suffice it to say: I have access to Perl on Windows XP. Here's a quick Perl script I ...
I have a Perl script where I maintain a very simple cache using a hash table. I would like to clear the hash once it occupies more than n bytes, to avoid Perl (32-bit) running out of memory and crashing.
I can do a check on the number of keys-value pairs:
if (scalar keys %cache > $maxSize)
{
%cache = ();
}
But is it possible to c...
Is it possible to run an external process from Perl, capture its stderr, stdout AND the process exit code?
I seem to be able to do combinations of these, e.g. use backticks to get stdout, IPC::Open3 to capture outputs, and system() to get exit codes.
How do you capture stderr, stdout, and the exit code all at once?
...
Has anybody found a good solution for lazily-evaluated lists in Perl? I've tried a number of ways to turn something like
for my $item ( map { ... } @list ) {
}
into a lazy evaluation--by tie-ing @list, for example. I'm trying to avoid breaking down and writing a source filter to do it, because they mess with your ability to debug t...
I've tried cpan and cpanp shell and I keep getting:
ExtUtils::PkgConfig requires the pkg-config utility, but it doesn't
seem to be in your PATH. Is it correctly installed?
What is the pkg-config utility and how do I install it?
Updates:
OS: Windows
This module is a prerequisite for the File::Extractor module
...
The one-liner should:
solve a real-world problem
not be extensively cryptic (should be easy to understand and reproduce)
be worth the time it takes to write it (should not be too clever)
I'm looking for practical tips and tricks (complementary examples for perldoc perlrun).
...