I think Annihilannic is correct, I recently had a similar problem.
XML::LibXML is an interface for libxml2, so it needs to be installed on your system first.
see: http://www.xmlsoft.org/
I just type "xmllint --version" to see if it's been installed.
Thanks! I think the 9 query method should work fine. There's no need to make it too elegant. I'll probably never have to do this again
I agree, the structure is flawed. Your suggestion makes much more sense. It's just that it's a system that's been in place for over 10 years, and they've been...
Hi all,
I have a table with 9 fields that store email addresses: email1,email2,email3, etc. I need to add one new email address to several records. Since each record may have a different number of fields already filled, I need to put the new address in the next available field.
This is the...
Just a caveat regarding Damian Conway's Switch.pm module - I wouldn't use it in production code or anything important.
At work we had a large script that was using Switch.pm, and it started causing some bizarre problems when I was making some updates to the code. It took a while to figure out...
I'll put in another vote for Win32::GuiTest, I've used it for automation and it seemed to be the best option.
But... The application that you're controlling has to be brought to the foreground as if you were hitting F8 manually. (GuiTest can do this programatically) I had to use Win32::API to...
-P seems to be an old option from perl 4 -
-P
causes your script to be run through the C preprocessor before compilation by perl. (Since both comments and cpp directives begin with the # character, you should avoid starting comments with any words recognized by the C preprocessor such as...
I would think you'd get the number of bytes in there if it succeeded in finding an email. You don't have anything in there that would cause the code to abort before the "message is bytes..." print statment.
Try adding Debug => 1 to the constructor options per the documentation
I would suggest looking into the Text::CSV module
http://search.cpan.org/~alancitt/Text-CSV-0.01/CSV.pm
about your while loop.. your closing brace looks out of place :)
when you use m//g, a position is set at the offset within the string where the first match is found. The next match starts searching where the last one left off. Just remove the g's
see:
perldoc perlop
perldoc -f pos
you could do this with a hash of arrays or a hash of hashes. If duplicate values in the second column don't matter to you, I'd just use the hash of arrays method.
It can be tricky getting the values out of the data structure. See perldoc perldsc for examples.
The hash of hashes method will...
the script works for me whether I use a forward slash or backslash. I get the same error message if I enter a nonexistent filename.
(I don't think the backslash acts as an escape when entered through stdin.)
You do need chomp()'s on the other inputs like rharsh said.
what do you see if you add...
you could do something like this unless speed is important. Using $` and $' tend to slow things down.
# $` returns everything before the matched string. $' returns everything after the matched string.
$string = "id <xx> MM blah blah";
if ($string =~ /\bMM\b/ ) {
$before = $`;
$after =...
If this is outside of a subroutine, it's the same as:
$opt_H = shift @ARGV unless ($opt_H);
@ARGV is an array that contains the arguments that were passed to the script. So it's saying: unless $opt_H already contains a value, populate $opt_H with the first element of @ARGV
if this is in a...
No prob.. You should be able to just put it inside the while loop after you build $filename, or put it in a sub and pass $filename to it.
To check your return codes, I think you have to bitshift the result - $return_code = $return_code >> 8;
then something like:
if ($return_code != 0) { print...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.