Is there an ExtUtils::* or Module::Build (or other) analog to Ruby's mkmf.have_struct_member?
I'd like to do something like (in the manner of a hints/ file):
....
if struct_has_member("msghdr", "msg_accrights") {
$self->{CCFLAGS} = join(' ', $self->{CCFLAGS}, "-DTRY_ACCRIGHTS_NOT_CMSG");
}
...
Config.pm doesn't track the spec...
I am trying to install the Perl module Font::FreeType on a CentOS linux box using cpan. I run sudo cpan and inside the cpan shell I run install Font::FreeType. However make fails as follows:
Writing Makefile for Font::FreeType
cp lib/Font/FreeType.pm blib/lib/Font/FreeType.pm
cp lib/Font/FreeType/Face.pm blib/lib/Font/FreeType/Face.pm
c...
Hi, I'm writing this Perl script that gets two command line arguments: a directory and a year. In this directory is a ton of text files or html files(depending on the year). Lets say for instance it's the year 2010 which contains files that look like this <number>rank.html with the number ranging from 2001 to 2212. I want it to open e...
Looking for a simple way to HTML encode a string/object in perl. the least amount of additional packages used the better.
...
When using the new() method on a DBIx::Class ResultSource to create a (potentially temporary) variable, it doesn't seem to populate attributes with the default values specified in the DBIC schema (which we have specified for creating tables from that schema).
Currently, we are creating one default value for one such class (the first cas...
I am very new to Perl and I wonder how to run it on webservers and all. (or if it can)
...
How do I improve my Perl regex to handle the __DATA__ below?
my ($type, $value) =~ /<(\w+)\s+(.*?)\(\)>/;
__DATA__
<dynamic DynamicVar>
<dynamic DynamicVar > # not need attache the blackspace to $value when return
<dynamic DynamicFun()>
<dynamic DynamicFun() > # not need attache the blackspace to $value when return
I want to return...
Hi. Is there any method to execute foo2.pl from foo1.pl in Perl, and append the foo2.txt to the foo1.txt then create foo3.txt? thanks.
i.e.
foo1.pl
print "Hello"; # output to foo1.txt;
foo2.pl
print "World"; # output to foo2.txt;
How to create foo3.txt file based on foo1.pl.
foo3.txt
Hello
World
Something like append foo2....
I know that it is easy to match anything except a given character using a regular expression.
$text = "ab ac ad";
$text =~ s/[^c]*//g; # Match anything, except c.
$text is now "c".
I don't know how to "except" strings instead of characters. How would I "match anything, except 'ac'" ? Tried [^(ac)] and [^"ac"] without success.
Is it ...
I have CSV file which has timestamp in the first column as shown below sample:
Time,head1,head2,...head3
00:00:00,24,22,...,n
00:00:01,34,55,...,n
and so on...
I want to filter out the data with specific time range like from 11:00:00 to 16:00:00 with the header and put into an array. I have written the below code to get the header in ...
Is there a standard way to code a module to hold global application parameters to be included in every other package? For instance: use Config;?
A simple package that only contains our variables? What about readonly variables?
...
My Perl application uses Rose::DB, Rose::DB::Object (ORM) and Tk on Windows XP. I need to check whether the database connection information (host, port, database name, user, password) leads to a valid connection. If I call $db->connect and use e.g. a nonexistant host for testing, Rose::DB says:
DBI connect('dbname=my_db;host=192.168.70.8...
I've made a wxPerl application which presents just a simple frame which only contains a wxMenuBar, wxPanel, wxTextCtrl and a wxStaticBitmap. The development and deployment platform is Windows XP and beyond.
The image is added to the form like this:
my $logoData = Wx::Bitmap->new(App::Resource::Images::getLogoPath(), wxBITMAP_TYPE_BMP);...
Error: Can't load '/home/oracle/.cpan/build/DBD-Pg-2.16.1/blib/arch/auto/DBD/Pg/Pg.so' for module DBD::Pg: libpq.so.5: cannot open shared object file: No such file or directory at /usr/lib/perl5/5.8.8/i386-linux-thread-multi/DynaLoader.pm line 230.
Did anyone have similar error while instaling DBD::Pg perl module ? what can I do to fi...
UPDATE:
Let me go into more details (as requested)
I have 2 Perl files, the first one generates a XML request/POST (No file is made).
The second file is new and intended to add another element inside of the XML on certain conditions. The problem I'm having is the first file already checks for the conditions but the second file is need...
I have a 32-bit perl installer. Using this I need to be able to install and uninstall both 32- and 64-bit applications.
Installing 32- and 64-bit is fine. Uninstalling 32-bit is also ok.
However, I have a problem while uninstalling 64-bit applications.
The application just knows the name of the application as seen in Add Remove progra...
I have a bunch of numbers represented as hexadecimal strings in logfiles that are being parsed by a Perl script, and I'm relatively inexperienced with Perl. Some of these numbers are actually signed negative numbers, ie 0xFFFE == -1 when represented as a 16-bit signed integer. Can somebody please tell me the canonical way of getting the...
I have not done Perl for about 8 years and now I'm going into project that's heavily utilizing object-oriented Perl so I need to resharpen my Perl skills and do it quickly. During these past years I mainly did all sorts of Java development and some PHP. I'm very good at OO and I'm not a novice programmer by any remote extent.
So here c...
While searching for a solution to a python regular expression problem I found this page which demonstrates that [some version of] perl allows variables within regular expressions.
e.g. a perl regex something like:
^(?{ local $d=0}\((?{ $d++ }.*?\)(?d--)
Where variable $d is incremented and decremented depending on which part of the ...
i need to implement a program to count the occurrence of a substring in a string in perl. i have implemented it as follows
sub countnmstr
{
$count =0;
$count++ while $_[0] =~ /$_[1]/g;
return $count;
}
$count = countnmstr("aaa","aa");
print "$count\n";
now this is what i would normally do. however, in the implementation above ...