Basically I have a database where I get $lastname, $firstname, $rid, $since, $times and $ip from.
Using a Perl script, I format the data to send it via e-mail. Since the $lastname and $firstname can contain special chars (for instance ä, ü, ß, é,...) I first decode the strings.
my $fullname = decode("utf8", $lastname) . ', ' . decode("...
I want to do VACUUM at a certain time on a SQLite database under Perl, but it always says
DBD::SQLite::db do failed: cannot VACUUM from within a transaction
So how do I do this?
my %attr = ( RaiseError => 0, PrintError => 1, AutoCommit => 0 );
my $dbh = DBI->connect('dbi:SQLite:dbname='.$file'','',\%attr)
or die $DBI::errstr;...
A Perl script (which I do not control) appends lines to the end of a text file periodically.
I need my PHP script (which will run as a cron job) to read the lines from that file, process them, and then remove them from the file. But, it seems like the only way to remove a line from a file with PHP is to read the file into a variable, re...
I have this simple part of the program that should send an email to a specified user.
But it has an error that says "Can't call method "MailMsg" on an undefined value"
if ($sender->MailMsg({smtp => 'mail.myISP.com',
from => 'suezy.ourdomainhere.com',
to =>'[email protected]',
subject => 'this is a test',
msg => "testing...
I have been given a few Perl scripts to deploy.
What is the easiest way to find and install all modules used by these scripts?
EDIT:
From what I can find there are no conditional includes or includes in evals.
...
I'm trying to use the Net::OAuth module to authorise with the Yammer API and I have the following code snippet, pretty much taken from the Synopsis on CPAN.
$Net::OAuth::PROTOCOL_VERSION = Net::OAuth::PROTOCOL_VERSION_1_0A;
my $q = new CGI;
my $request = Net::OAuth->request("request token")->from_hash($q->Vars,
request_...
I have a Perl script which does this: It generates a ssh authentication key on my system and then copies this key to a remote Linux system for passwordless ssh connects. The code is as below:
# Generate an rsa key and store it in the given file
system("ssh-keygen -t rsa -N '' -f /root/.ssh/id_rsa 1>/dev/null");
# Copy the generated ke...
The XML file I need to create is like
<file>
<state>$state</state>
<timestamp>$time</timestamp>
<location>$location</location>
....
</file>
I don't want to use several print to create the needed XML file, what I'm expecting is to have a template, which defines both the structure and format of the XML.
Then w...
I have a loop on the rows returned by an SQL SELECT statement, and, after some processing on a row's data, I sometimes want to UPDATE the row's value. The processing in the loop's body is non-trivial, and I can't write it in SQL. When I try to execute the UPDATE for the selected row I get an error (under Perl's DBD::SQLite::st execute ...
Does anyone one know how not to get the "world writables" fail message from PAUSE when I upload a module to PAUSE?
I packed it with make dist on Windows. I haven't got access to a Linux box at work and I need to work it out on Windows.
...
I sit behind a proxy and have HTTP and WWW::Mechanize working OK locally.
But advice || pointers as to how to get through a proxy please.
Regards
Ian
...
Update:
I can make this a simpler problem to solve:
I want to figure out what the correct regex would be to substitute any single occurrence of a back slash with two back slashes.
I want to turn this:
vlc.plugin.path = C:\Program Files\JekyllV0.9.2\\VLC_1.0.0\\plugins
into:
vlc.plugin.path = C:\\Program Files\\JekyllV0.9.2\\VLC_1....
I fairly new to regular expressions and need some help. I need to filter some lines using regex in Perl. I am going to pass the regex to another function so it needs to be done in a single line.
I want to select only lines that contain "too long"and that don't begin with "SKIPPING"
Here are my test strings:
SKIPPING this bond sinc...
I'm using an open source Perl package named "webmin" on several servers. It's mostly Perl on the inside.
I found a weird behavior on a new 64-bit server: files were getting created empty.
I've traced it down to a "Permission Denied" error in Perl's builtin function open
which is pretty unusual, since the application is running as root....
I have this sub to initialize my logger:
sub initLogfiles{
Log::Log4perl->easy_init($INFO); # We log all debug, info, warn, error and fatal messages.
my $userlogappender = Log::Log4perl::Appender->new(
"Log::Log4perl::Appender::File",
filename => USERLOGFILE,
mode => "append",
recreate => ...
How would I write a function that accepts something like the map function does?
Example:
$func = sub { print $_[0], "hi\n" };
&something($f);
sub something
{
my $func = shift;
for ($i = 0; $i < 5; $i++)
{ $func->($i); }
}
works fine.
but then if I did
&something( { print $_[0], "hi\n" } );
it wont work and says ...
Here is client Side code:
jQuery(document).ready(function(){
jQuery("#list").jqGrid({
url:'example.php',
datatype: 'xml',
mtype: 'GET',
colNames:['Inv No','Date', 'Amount','Tax','Total','Notes'],
colModel :[
{name:'invid', index:'invid', width:55},
{name:'invdate', index:'invdate', width:90},
{...
What is the most cross platform way to execute a pPerl script from ant?
Windows does not like the Perl script as the executable. Is there any way other than just running Perl using an OS specific executable and passing the Perl script in as an argument?
...
Is there a defined behavior for how regular expressions should handle the capturing behavior of nested parentheses? More specifically, can you reasonably expect that different engines will capture the outer parentheses in the first position, and nested parentheses in subsequent positions?
Consider the following PHP code (using PCRE reg...
I am trying to insert a variable $font1 below. The variable $font1 is the name of the font e.g. arial. I really want it to return $arial (or whatever $font is) as a variable.
When $arial is called, it gets the arial.ttf from a folder on my server via get_fonts.pl.
I have tried everything \$$font '"$font"' and every possible variation ...