Currently I am trying to execute a macro in Microsoft Access through Perl OLE
I am wondering how to properly make the call to run a macro. I have tried
1) $oDatabase -> DoCmd.RunMacro("Macro1");
2) $oDatabase -> DoCmd -> RunMacro("Macro1");
But they throw me "Can't call method "DoCmd" on an undefined value" or "useless use of concaten...
I need to load a file from an umounted TrueCrypt disk into memory. Is there any way to do this programatically? Does TrueCrypt offer an API?
The way I believe is best for attempting this would be to mount the volume (prompting the user for a password, of course), open the file, and then unmount the volume. Is there a way to do this a...
The L<name> formatting code allows you to set the display text for the link if you're linking to other POD, as in L<Display Text|link_dest>, but this isn't allowed for L<scheme:...> links, such as
L<http://perldoc.perl.org/strict.html>
How do I specify a display text for such links? Alternatively, how do I manually write such a li...
I have a textfile encoded in UTF-16. Each line contains a number of columns separated by tabs. For those who care, the file is a playlist TXT export from iTunes. Column #27 contains a filename.
I am reading it using Perl 5.8.8 in Linux using code similar to:
binmode STDIN, ":encoding(UTF-16)";
while(<>)
{
chomp;
my @cols = s...
How can I take a Perl array like this
@categories = ( ["Technology", "Gadgets"], ["TV & Film"] );
and generate this XML snippet?
<itunes:category text="Technology">
<itunes:category text="Gadgets"/>
</itunes:category>
<itunes:category text="TV & Film"/>
I can change the array if there's an easier way to get to the same ...
My webapp is hosted on a unix server using MySQL as database.
I wrote a Perl script to run backup of my database. The Perl script is inside the cgi-bin folde and it is working. I only need to set the cronjob and run the Perl script once a day.
The backups are stored in a folder named db_backups,. However, I also want to add a command i...
I have a Perl script that launches another Perl script in a new console through Win32::Process as follows:
Win32::Process::Create($ProcessObj,
"C:\\Perl\\bin\\perl.exe",
"$path_to_other_perl_script",
0,
NEW_CONSOLE,
".");
$Proc...
I'm trying to create an array of hashes, but I'm having trouble looping through the array. I have tried this code, but it does not work:
for ($i = 0; $i<@pattern; $i++){
while(($k, $v)= each $pattern[$i]){
debug(" $k: $v");
}
}
...
I am able to stream multiple files together using:
$AGI->exec('Background',"file1&file2&file3&file4")
However, this doesn't return the key pressed by the user when the files are being played. So, I used $AGI->stream_file, which returns the key pressed, but only plays a single file.
I need to be able to play multiple files together, t...
Why doesn't the first print statement output what I expect:
first = This is a test string, sec = This is a test string
Since both * and + are greedy, why does the the inner * i.e. inside the "((" in the first match not consuming the entire string?
use strict;
use warnings;
my $string = "This is a test string";
$string =~ /((.*)*)/; ...
So I have a Perl class. It has a sort() method, and I want it to be more or less identical to the built-in sort() function:
$object->sort(sub ($$) { $_[0] <=> $_[1] });
But I can't do:
$object->sort(sub { $a <=> $b });
Because of scoping. But the List::Util module does this with reduce(). I looked at the List::Util module, and they...
I have a log that gets created from a bunch of cron jobs. My task now is to send specific logs (e.g. error outputs) as an email. What is the best way to get content from a file and send it as an email?
I have already figured out how to send email in perl. I just need to figure out how to read in the file and put it as the text of the em...
The perldoc page for length() tells me that I should use bytes::length(EXPR) to find a Unicode string in bytes, or and the bytes page echoes this.
use bytes;
$ascii = 'Lorem ipsum dolor sit amet';
$unicode = 'Lørëm ípsüm dölör sît åmét';
print "ASCII: " . length($ascii) . "\n";
print "ASCII bytes: " . bytes::length($ascii) . "\n";
prin...
In my app I have 2 table, books and tags, and the link table book_tags. The link table also contains the number of times the book was tagged with this particular tag. I can add a tag by doing
$book->add_tag($tag, { tag_count => 10 });
However when I retrieve the tags for a book
@tags = $book->tags();
it does not seem to return the ...
If you have a path to a file (for example, /home/bob/test/foo.txt) where each subdirectory in the path may or may not exist, how can I create the file foo.txt in a way that uses "/home/bob/test/foo.txt" as the only input instead of creating every nonexistent directory in the path one by one and finally creating foo.txt itself?
...
I have the following sparse matrix A.
2 3 0 0 0
3 0 4 0 6
0 -1 -3 2 0
0 0 1 0 0
0 4 2 0 1
Then I would like to capture the following information from there:
cumulative count of entries, as matrix is scanned columnwise.
Yielding:
Ap = [ 0, 2, 5, 9, 10, 12 ];
row indices of entries...
Can anyone help me how to convert this date format "Mon, 24 Aug 2009 17:00:44 +0800" into something like this, "2009-08-24 17:00:44" in Perl? I've been browsing in CPAN for modules, but still I wasn't able to find what I was looking for. The first format is retrieved from an email account using Mail::POP3Client. The other one is from a q...
I want to (need to) start a sub-process from a perl script that checks certain environment variables. In one instance the environment variable needs to be there but empty.
$ENV{"GREETING"} = "Hello World"; # Valid
$ENV{"GREETING"} = ""; # also valid
I can set $ENV{"GREETING"} = ""; and in that perl script $E...
I'm in the processing of converting a program from Perl to Java. I have come across the line
my ($title) = ($info{$host} =~ /^\s*\(([^\)]+)\)\s*$/);
I'm not very good with regular expressions but from what I can tell this is matching something in the string $info{$host} to the regular expression ^\s*(([^)]+))\s*$ and assigning the mat...
Hi,
I have a XML file of the format:
<outer1>
<inner1>
<name>Stonecold</name>
<profession>warrior</profession>
<org>wwf</org>
</inner1>
<inner1>
<name>Shanebond</name>
<profession>Bowler</profession>
<org>newzealand</org>
</inner1>
<inner1>
<name>brain schemidit</name>
<profes...