Hello,
I'm trying to execute a simple Perl program that uses XML::Simple to print out the data from an XML file.
However, the error I'm getting is :
no element found at line 15, column 0, byte 308 at /usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi/XML/Parser.pm line 185
The XML file is as follows :
<?xml version="1.0"?>
<c...
I've stumbled upon the MooseX::Declare documentation, and I have to say "WOW!". That looks really nice! I think it's the cleanest OOP syntax Perl has.
use MooseX::Declare;
class BankAccount {
has 'balance' => ( isa => 'Num', is => 'rw', default => 0 );
method deposit (Num $amount) {
$self->balance( $self->balance + $a...
Summary
I've got a table of items that go in pairs. I'd like to self-join it so I can retrieve both sides of the pair in a single query. It's valid SQL (I think), the SQLite engine actually does accept it, but I'm having trouble getting DBIx::Class to bite the bullet.
Minimal example
package Schema;
use parent 'DBIx::Class::Schema';...
I'm an experienced programmer but I haven't tried using Perl before. Can anyone please give me a link to a good tutorial of the Perl language? Thank you very much.
...
Is there a way to get a sub-hash? Do I need to use a hash slice?
For example:
%hash = ( a => 1, b => 2, c => 3 );
I want only
%hash = ( a => 1, b => 2 );
...
I'm processing some XML files (specifically .vcproj files) in Perl and I want to unescape the special characters. The escaped characters I've encountered so far are:
"



Obviously I can do this myself but it seems that there should be a standard (or CPAN) module to do this but a naive search brings up nothing relevan...
I have a long-ish Perl script that runs just fine, but always gives this warning:
Can't find string terminator '"' anywhere before EOF at -e line 1
I've read elsewhere online that this is because of a misuse of single or double quotes and the error generally stops the script from running, but mine works. I'm pretty sure I've used my ...
Hi,
I would like to get the dimensions (coordinates) for all the HTML elements of a webpage as they are rendered by a browser, that is the positions they are rendered at. For example, (top-left,top-right,bottom-left,bottom-right)
Could not find this in lxml. So, is there any library in Python that does this? I had also looked at Mechan...
What does this expression in Perl programming do?
$variable =~ /^\s*$/;
...
Hi,
I want to send some XML from a Perl program to a CGI script that makes use of XML::Simple to take that XML as input and send XML as output.
Is there a way to send XML to a CGI script from Perl? Any help in this regards would be really appreciated.
Thank You
...
My variable $var has the form 'abc.de'. What does this substr exactly do in this statement:
$convar = substr($var,0,index(".",$var));
...
I'm still relatively new to Perl Programming, but I know how Perl 5 OO basically works. However, I have never created any project with Perl 5 OO, so I'm quite sure I will run into many pitfalls.
Recently I discovered the hype about the Moose module. I checked out some documentation on CPAN and I found it to be quite interesting and help...
G'day,
Why am I getting the following two errors from the script fragment below?
Argument "www4.mh.xxxx.co.uk.logstatsto20090610.gz" isn't numeric in division (/) at line 56
Argument "/logs/xxxx/200906/mcs0.telhc/borg2" isn't numeric in division (/) at line 56
The variables $dir and $log are both strings and the concatenation...
I'm writing a complex script that takes the XML backup of a Blogger blog and converts it to InDesign Tagged Text to be laid out in a book. I'm using a whole bunch of regular expressions to clean out the HTML tags of each blog post and convert them to InDesign tags. For example:
<p>A really long paragraph.</p> -> <ParaStyle:Main text>A r...
I writing programing with Perl and XS. I need to display and do some operations that use a linked list from C. How can I accomplish that?
...
This is an extension of this question. I'm trying to parse HTML snippets embedded in an XML backup of a Blogger blog and retag them with InDesign tags.
Blogger doesn't standardize the HTML for any of its posts, and the posts can be written in Word, Windows Live Writer, the native Blogger interface, or text editors, resulting in tons of ...
I need to search for files in a directory that begin with a particular pattern, say "abc". I also need to eliminate all the files in the result that end with ".xh". I am not sure how to go about doing it in Perl.
I have something like this:
opendir(MYDIR, $newpath);
my @files = grep(/abc\*.*/,readdir(MYDIR)); # DOES NOT WORK
I also ...
My delicious-to-wp perl script works but gives for all "weird" characters even weirder output.
So I tried
$description = decode_utf8( $description );
but that doesnt make a difference. I would like e.g. “go live” to become “go live” and not “go live†How can I handle unicode in Perl so that this works?
UPDATE: I found the prob...
Hey guys.
The book in question is called 'Learning Perl, Third Edition', by Schwartz and Phoenix - printed by O'Reilly in 2001. Is this book too old? Have there been significant improvements to the language over the last 7/8 years that warrant a newer book on the subject?
Thank you.
...
I have a Perl program that has a GTK2 GUI (via the Gtk2 package). This program also opens a network socket (actually via LWP) in another thread, and continuously makes a request for a certain URL, waiting for an event to happen.
If an event occurs, then its data must be processed and interpreted, and an appropriate callback function use...