[28800] in Perl-Users-Digest
Perl-Users Digest, Issue: 44 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Jan 17 23:21:09 2007
Date: Wed, 17 Jan 2007 15:10:10 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Wed, 17 Jan 2007 Volume: 11 Number: 44
Today's topics:
parsing xml using perl regex help <Avalon1178@aol.com>
Re: parsing xml using perl regex help <spamtrap@dot-app.org>
Re: parsing xml using perl regex help <m@remove.this.part.rtij.nl>
Re: parsing xml using perl regex help <Avalon1178@aol.com>
Re: parsing xml using perl regex help <Avalon1178@aol.com>
Re: parsing xml using perl regex help <Avalon1178@aol.com>
Re: parsing xml using perl regex help <john@castleamber.com>
Re: parsing xml using perl regex help <spamtrap@dot-app.org>
Re: parsing xml using perl regex help <jgibson@mail.arc.nasa.gov>
Re: PERL5LIB variable does not work as expected <stahl.karl@gmail.com>
Re: Position in an array <google@markginsburg.com>
Re: Question from perl newbie <kingpin+nntp@lumbercartel.ca>
regex problem <dollente@gmail.com>
Re: separating attribution, quoted text, and sigs from usenet@DavidFilmer.com
Translation please <pleaselogout@gmail.com>
Re: Translation please <jgibson@mail.arc.nasa.gov>
Unable to find form <nospam@home.com>
Re: VB to Perl Excel OLE question....QueryTables <mark.clementsREMOVETHIS@wanadoo.fr>
Re: VB to Perl Excel OLE question....QueryTables <mark.clementsREMOVETHIS@wanadoo.fr>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 17 Jan 2007 11:29:12 -0800
From: "Avalon1178" <Avalon1178@aol.com>
Subject: parsing xml using perl regex help
Message-Id: <1169062152.554658.245160@q2g2000cwa.googlegroups.com>
Hi,
I'm trying to write a somewhat simple parser using perl to parse an xml
element node, without having to use one of the CPAN libraries like
XML::Simple or SAX, etc. My application is fairly simple and I thought
I could accomplish it using regex. Basically, I just want to extract
the value of an attribute within an xml node.
For example, I have the following xml:
<?xml version="1.0" encoding="UTF-8"?>
<main>
<theNode name="blah" type="blah2" opt="blah3">
<desc>Some node</desc>
</theNode>
</main>
In my app, all I want is to extract the attribute value of "type" and
"opt", using regex, but I'm having trouble with it.
For starters, I attempted to extract the attribute value for "name", so
I did the following:
my $regex = qr/^\s*<theNode\s*name=\"(\w+)\".*/;
open(XML, "file.xml");
while(<XML>) {
if (/$regex/) {
print "Regex match: $1\n";
} else {
print "NO Regex match!\n";
}
}
close(XML);
Expecting $1 to be "blah" when it reaches the 3rd line of file.xml
(where file.xml is the sample xml that I posted above), instead I get a
NO Regex match.
Can anyone help? Thanks!
Avalon1178
------------------------------
Date: Wed, 17 Jan 2007 14:39:11 -0500
From: Sherm Pendley <spamtrap@dot-app.org>
Subject: Re: parsing xml using perl regex help
Message-Id: <m2hcup4f4w.fsf@Sherm-Pendleys-Computer.local>
"Avalon1178" <Avalon1178@aol.com> writes:
> I'm trying to write a somewhat simple parser using perl to parse an xml
> element node, without having to use one of the CPAN libraries like
> XML::Simple or SAX, etc.
The goals you've stated here are contradictory - you say you want to keep
it simple, but you've already ruled out the simplest solution.
sherm--
--
Web Hosting by West Virginians, for West Virginians: http://wv-www.net
Cocoa programming in Perl: http://camelbones.sourceforge.net
------------------------------
Date: Wed, 17 Jan 2007 20:50:52 +0100
From: Martijn Lievaart <m@remove.this.part.rtij.nl>
Subject: Re: parsing xml using perl regex help
Message-Id: <pan.2007.01.17.19.50.52.208277@remove.this.part.rtij.nl>
On Wed, 17 Jan 2007 11:29:12 -0800, Avalon1178 wrote:
> Hi,
>
> I'm trying to write a somewhat simple parser using perl to parse an xml
> element node, without having to use one of the CPAN libraries like
> XML::Simple or SAX, etc. My application is fairly simple and I thought
> I could accomplish it using regex. Basically, I just want to extract
> the value of an attribute within an xml node.
>
> For example, I have the following xml:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <main>
> <theNode name="blah" type="blah2" opt="blah3">
> <desc>Some node</desc>
> </theNode>
> </main>
>
> In my app, all I want is to extract the attribute value of "type" and
> "opt", using regex, but I'm having trouble with it.
>
> For starters, I attempted to extract the attribute value for "name", so
> I did the following:
use strict;
use warnings;
>
> my $regex = qr/^\s*<theNode\s*name=\"(\w+)\".*/;
> open(XML, "file.xml");
> while(<XML>) {
> if (/$regex/) {
> print "Regex match: $1\n";
> } else {
> print "NO Regex match!\n";
> }
> }
> close(XML);
>
> Expecting $1 to be "blah" when it reaches the 3rd line of file.xml
> (where file.xml is the sample xml that I posted above), instead I get a
> NO Regex match.
Works for me.
[martijn@dexter tmp]$ ./test.pl
NO Regex match!
NO Regex match!
Regex match: blah
NO Regex match!
NO Regex match!
NO Regex match!
[martijn@dexter tmp]$
What's your output? (Which you should have posted already!)
M4
--
Redundancy is a great way to introduce more single points of failure.
------------------------------
Date: 17 Jan 2007 11:51:25 -0800
From: "Avalon1178" <Avalon1178@aol.com>
Subject: Re: parsing xml using perl regex help
Message-Id: <1169063485.485120.260420@m58g2000cwm.googlegroups.com>
Sherm Pendley wrote:
> "Avalon1178" <Avalon1178@aol.com> writes:
>
> > I'm trying to write a somewhat simple parser using perl to parse an xml
> > element node, without having to use one of the CPAN libraries like
> > XML::Simple or SAX, etc.
>
> The goals you've stated here are contradictory - you say you want to keep
> it simple, but you've already ruled out the simplest solution.
>
> sherm--
>
> --
> Web Hosting by West Virginians, for West Virginians: http://wv-www.net
> Cocoa programming in Perl: http://camelbones.sourceforge.net
Huh? How is that contradictory?
Anyway, when I mentioned simple, I meant my task is simple....my app
only needs to parse a known and specific attribute value...that's it.
Porting a library that parses XML like SAX and XML::Simple in a general
purpose way I think is a little overkill for my needs esp. if I only
want to accomplish a single task. I also keep in mind that when I
distribute my app, I'm assuming that the system where this app will be
running on does not have XML::Simple or SAX or DOM installed in that
system...that is why I'm attempting to see if I can do so using
regex...no matter how complicated that regex is (I never said the perl
code is going to be simple...I meant my task is simple :) )
------------------------------
Date: 17 Jan 2007 12:03:00 -0800
From: "Avalon1178" <Avalon1178@aol.com>
Subject: Re: parsing xml using perl regex help
Message-Id: <1169064179.987328.45430@s34g2000cwa.googlegroups.com>
Martijn Lievaart wrote:
> On Wed, 17 Jan 2007 11:29:12 -0800, Avalon1178 wrote:
>
> > Hi,
> >
> > I'm trying to write a somewhat simple parser using perl to parse an xml
> > element node, without having to use one of the CPAN libraries like
> > XML::Simple or SAX, etc. My application is fairly simple and I thought
> > I could accomplish it using regex. Basically, I just want to extract
> > the value of an attribute within an xml node.
> >
> > For example, I have the following xml:
> >
> > <?xml version="1.0" encoding="UTF-8"?>
> > <main>
> > <theNode name="blah" type="blah2" opt="blah3">
> > <desc>Some node</desc>
> > </theNode>
> > </main>
> >
> > In my app, all I want is to extract the attribute value of "type" and
> > "opt", using regex, but I'm having trouble with it.
> >
> > For starters, I attempted to extract the attribute value for "name", so
> > I did the following:
>
> use strict;
> use warnings;
>
> >
> > my $regex = qr/^\s*<theNode\s*name=\"(\w+)\".*/;
> > open(XML, "file.xml");
> > while(<XML>) {
> > if (/$regex/) {
> > print "Regex match: $1\n";
> > } else {
> > print "NO Regex match!\n";
> > }
> > }
> > close(XML);
> >
> > Expecting $1 to be "blah" when it reaches the 3rd line of file.xml
> > (where file.xml is the sample xml that I posted above), instead I get a
> > NO Regex match.
>
> Works for me.
>
> [martijn@dexter tmp]$ ./test.pl
> NO Regex match!
> NO Regex match!
> Regex match: blah
> NO Regex match!
> NO Regex match!
> NO Regex match!
> [martijn@dexter tmp]$
>
> What's your output? (Which you should have posted already!)
>
> M4
> --
> Redundancy is a great way to introduce more single points of failure.
Hmm...you're right....it does work....it turns out its the source xml
that I'm using. The value of the attribute that I'm trying to extract
also contains a non-alpha numeric character so obviously the (\w+) will
not match.
Modifying the regex to:
my $regex = qr/^s*<theNode\s*name=\"(\S+)\".*/;
works :) Thanks!
------------------------------
Date: 17 Jan 2007 12:12:32 -0800
From: "Avalon1178" <Avalon1178@aol.com>
Subject: Re: parsing xml using perl regex help
Message-Id: <1169064752.332379.92560@q2g2000cwa.googlegroups.com>
Great it works now...essentially by modifying (\w+) to (\S+)
So my new regex looks like the following if I want to extract the
attribute value of type and opt:
my $regex =
qr/^s*<theNode\s*name=\"(\S+)\"\s*type=\"(\S+)\"\s*opt=\"(\S+)\".*/;
I have one other question though...and maybe this is because of my
fairly novice knowledge of regex's. Is there another way using regex
to parse the attributes where the order of the attributes name may not
be always the same? In other words, in my xml sample, I could have an
attribute order of type--opt--name, or opt--name--type, etc. Of
course, I could create different regex for different order
combinations, but that's a bit overkill (the naive approach), but is
there a way to represent it in a single regex?
Avalon1178 wrote:
> Martijn Lievaart wrote:
> > On Wed, 17 Jan 2007 11:29:12 -0800, Avalon1178 wrote:
> >
> > > Hi,
> > >
> > > I'm trying to write a somewhat simple parser using perl to parse an xml
> > > element node, without having to use one of the CPAN libraries like
> > > XML::Simple or SAX, etc. My application is fairly simple and I thought
> > > I could accomplish it using regex. Basically, I just want to extract
> > > the value of an attribute within an xml node.
> > >
> > > For example, I have the following xml:
> > >
> > > <?xml version="1.0" encoding="UTF-8"?>
> > > <main>
> > > <theNode name="blah" type="blah2" opt="blah3">
> > > <desc>Some node</desc>
> > > </theNode>
> > > </main>
> > >
> > > In my app, all I want is to extract the attribute value of "type" and
> > > "opt", using regex, but I'm having trouble with it.
> > >
> > > For starters, I attempted to extract the attribute value for "name", so
> > > I did the following:
> >
> > use strict;
> > use warnings;
> >
> > >
> > > my $regex = qr/^\s*<theNode\s*name=\"(\w+)\".*/;
> > > open(XML, "file.xml");
> > > while(<XML>) {
> > > if (/$regex/) {
> > > print "Regex match: $1\n";
> > > } else {
> > > print "NO Regex match!\n";
> > > }
> > > }
> > > close(XML);
> > >
> > > Expecting $1 to be "blah" when it reaches the 3rd line of file.xml
> > > (where file.xml is the sample xml that I posted above), instead I get a
> > > NO Regex match.
> >
> > Works for me.
> >
> > [martijn@dexter tmp]$ ./test.pl
> > NO Regex match!
> > NO Regex match!
> > Regex match: blah
> > NO Regex match!
> > NO Regex match!
> > NO Regex match!
> > [martijn@dexter tmp]$
> >
> > What's your output? (Which you should have posted already!)
> >
> > M4
> > --
> > Redundancy is a great way to introduce more single points of failure.
>
> Hmm...you're right....it does work....it turns out its the source xml
> that I'm using. The value of the attribute that I'm trying to extract
> also contains a non-alpha numeric character so obviously the (\w+) will
> not match.
>
> Modifying the regex to:
>
> my $regex = qr/^s*<theNode\s*name=\"(\S+)\".*/;
>
> works :) Thanks!
------------------------------
Date: 17 Jan 2007 20:19:26 GMT
From: John Bokma <john@castleamber.com>
Subject: Re: parsing xml using perl regex help
Message-Id: <Xns98BB91B4C1DF8castleamber@130.133.1.4>
"Avalon1178" <Avalon1178@aol.com> wrote:
> I have one other question though...and maybe this is because of my
> fairly novice knowledge of regex's.
Nah, it has much more to do with missing the point and ignoring advice.
The road you're following leads to disaster after disaster. There is a
reason that there are XML modules on CPAN.
> there a way to represent it in a single regex?
Don't use regex when a parser is /needed/ even in very simple cases.
--
John Experienced Perl programmer: http://castleamber.com/
Perl help, tutorials, and examples: http://johnbokma.com/perl/
------------------------------
Date: Wed, 17 Jan 2007 15:38:05 -0500
From: Sherm Pendley <spamtrap@dot-app.org>
Subject: Re: parsing xml using perl regex help
Message-Id: <m2d55d4ceq.fsf@Sherm-Pendleys-Computer.local>
"Avalon1178" <Avalon1178@aol.com> writes:
> Sherm Pendley wrote:
>> "Avalon1178" <Avalon1178@aol.com> writes:
>>
>> > I'm trying to write a somewhat simple parser using perl to parse an xml
>> > element node, without having to use one of the CPAN libraries like
>> > XML::Simple or SAX, etc.
>>
>> The goals you've stated here are contradictory - you say you want to keep
>> it simple, but you've already ruled out the simplest solution.
>
> Huh? How is that contradictory?
How is it *not* contradictory? You've stated that you want to keep it simple,
and in the same sentence you state that you want to complicate it by ruling
out the simplest solution.
You can't have it both ways; if simplicity is your primary goal, then use the
CPAN module - that's why it's there. If your primary goal is to avoid using
CPAN, then you'll need to accept the fact that achieving that goal will mean
giving up on your secondary goal of simplicity.
Note that I'm not trying to push you one way or another - the choice is yours.
I'm simply trying to help you understand that you *are* facing a choice.
> Anyway, when I mentioned simple, I meant my task is simple....my app
> only needs to parse a known and specific attribute value...that's it.
> Porting a library that parses XML like SAX and XML::Simple in a general
> purpose way I think is a little overkill for my needs esp. if I only
> want to accomplish a single task.
That task has already snowballed. Take your followup request about what to
do when attributes appear in a different order. The complexity of your task
is growing even as we're talking about it.
I've been down this road myself, and trust me, the supposed simplicity of
parsing XML is an illusion. It starts out simple enough, but you wind up
adding one special case, then another, and another, until eventually you've
written a full-blown XML parser anyway.
sherm--
--
Web Hosting by West Virginians, for West Virginians: http://wv-www.net
Cocoa programming in Perl: http://camelbones.sourceforge.net
------------------------------
Date: Wed, 17 Jan 2007 14:37:13 -0800
From: Jim Gibson <jgibson@mail.arc.nasa.gov>
Subject: Re: parsing xml using perl regex help
Message-Id: <170120071437137341%jgibson@mail.arc.nasa.gov>
In article <1169063485.485120.260420@m58g2000cwm.googlegroups.com>,
Avalon1178 <Avalon1178@aol.com> wrote:
> Sherm Pendley wrote:
> > "Avalon1178" <Avalon1178@aol.com> writes:
> >
> > > I'm trying to write a somewhat simple parser using perl to parse an xml
> > > element node, without having to use one of the CPAN libraries like
> > > XML::Simple or SAX, etc.
> >
> > The goals you've stated here are contradictory - you say you want to keep
> > it simple, but you've already ruled out the simplest solution.
> >
>
> Huh? How is that contradictory?
>
> Anyway, when I mentioned simple, I meant my task is simple....my app
> only needs to parse a known and specific attribute value...that's it.
> Porting a library that parses XML like SAX and XML::Simple in a general
> purpose way I think is a little overkill for my needs esp. if I only
> want to accomplish a single task. I also keep in mind that when I
> distribute my app, I'm assuming that the system where this app will be
> running on does not have XML::Simple or SAX or DOM installed in that
> system...that is why I'm attempting to see if I can do so using
> regex...no matter how complicated that regex is (I never said the perl
> code is going to be simple...I meant my task is simple :) )
>
That way lies madness:
Message-ID: <k35h821uf50268qnse0t5kjroqf2kiceqt@4ax.com>
Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com
------------------------------
Date: 17 Jan 2007 11:30:41 -0800
From: "Ishmael" <stahl.karl@gmail.com>
Subject: Re: PERL5LIB variable does not work as expected
Message-Id: <1169062241.240800.252800@q2g2000cwa.googlegroups.com>
Just in case anyone reads this post in the future, I finally got the
PERL5LIB variable to work, simply by finding the correct local path to
add. For me, it was:
PATH_TO_MODULE_INSTALLATION_DIR/lib/site_perl
Note that the following DO NOT work:
PATH_TO_MODULE_INSTALLATION_DIR
PATH_TO_MODULE_INSTALLATION_DIR/lib
Hope this helps.
------------------------------
Date: 17 Jan 2007 14:47:30 -0800
From: "Mark" <google@markginsburg.com>
Subject: Re: Position in an array
Message-Id: <1169074050.739667.35270@q2g2000cwa.googlegroups.com>
bernd wrote:
> Is there a way of "knowing" the index without using
> the explicitly defined variable $count?
>
> $count = 0 ;
> foreach ( @testarr ) {
>
> if ( $count == 0 ) { print $_ }
>
> # same code for all items ....
>
> $count++ ;
> }
>
> So, can I get rid of $count in some way
This following doesn't solve the problem of "'knowing' the index", but
it can detect when the loop is at the desired iteration:
foreach ( @testarr ) {
print if \$_ == \$testarr[0] ;
}
------------------------------
Date: Wed, 17 Jan 2007 23:02:31 GMT
From: "Randolf Richardson" <kingpin+nntp@lumbercartel.ca>
Subject: Re: Question from perl newbie
Message-Id: <op.tmbmrci4aynfek@laptop32.home.inter-corporate.com>
On Mon, 18 Dec 2006 07:05:03 -0800, Jürgen Exner <jurgenex@hotmail.com>
wrote:
> [X-Post and follow-up to CLPM because CLP has been a zombie for many
> years,
> please see the FAQ]
>
> Victor wrote:
>> I downloaded and installed Perl, seemingly in a successful manner to a
>> Windows XP computer. then I wrote the following code to a file,
>> Example_4_1.pl:
>>
>> #! ..\bin\perl -w
>
> Windows doesn't care about the shebang line. You can just as well leave
> it out.
> The command line option -w is outdated. It is better to use
> use warnings;
> instead.
[sNip]
The "strict" module is also recommended:
use strict;
--
Randolf Richardson - kingpin+nntp@lumbercartel.ca
The Lumber Cartel, local 42 (Canadian branch)
http://www.lumbercartel.ca/
------------------------------
Date: 17 Jan 2007 14:44:14 -0800
From: "eldwin" <dollente@gmail.com>
Subject: regex problem
Message-Id: <1169073854.097814.163470@51g2000cwl.googlegroups.com>
Hey all,
I'm trying to search and replace to the following string:
0|1061203|150200559802-12345|STUDIO
0006979867|STUDIO|0066678||STUDIO|150200559802-12345|STAFF|XX|STAFF|XX|
What I want to do is replace whatever is in between | |.
For example, I want to replace STAFF with PROSTAFF.
my current regex looks like this:
s/\|.*\|XX\|/\|PROSTAFF\|XX\|/g
So, I'm not concerned with STAFF so much, but what's in between | |. I
know "|" is a special character thus the "\" before it.
When I apply this regex to my code, the resulting string is:
0|PROSTAFF|XX|
Thanks in advance for any advice.
------------------------------
Date: 17 Jan 2007 11:31:44 -0800
From: usenet@DavidFilmer.com
Subject: Re: separating attribution, quoted text, and sigs from the body of a post
Message-Id: <1169062304.532897.175680@11g2000cwr.googlegroups.com>
Art Merkel wrote:
> I wonder if anyone would be willing to share some code for pulling out
> the "meat" of the body of an e-mail or usenet post?
You won't be able to do this 100% of the time because the behavior of
replies is different (and can be customized) in different newsreaders.
Usenet posts are plain text, and lack the context tagging of XML, etc.
But you can probably get pretty close to what you want.
You can probably exclude 90%+ of attribution lines by excluding
/wrote:$/ (but it won't work for Dr.Ruud's posts, etc). Of course,
that assumes English-language newsgroups. Some folks try to be cute
with attribution lines like:
When Art Merkel finally sobered up, he blundered:
Nuthin you can do about attribution lines like that, unless you
hard-code distinctive strings for prolific posters.
You can probably exclude 90%+ of context quotes by excluding /^>/.
A usenet sig (if it's properly configured) follows a cutline which is
two dashes and a space. It's easy to identify such a cutline and
ignore everything which follows. But many posters don't use a proper
cutline.
--
The best way to get a good answer is to ask a good question.
David Filmer (http://DavidFilmer.com)
------------------------------
Date: 17 Jan 2007 13:30:03 -0800
From: "Stan" <pleaselogout@gmail.com>
Subject: Translation please
Message-Id: <1169069403.480074.91640@l53g2000cwa.googlegroups.com>
Could someone please translate this into english please. This is part
of obfuscation script
thanks
perl -n -i.bak -e "if (/([0-9]+\t)([A-Z0-9]*)(.*)$/) { print $1 .
\"58\" x (length($2) / 2) . $3 . \"\n\"; } else { print; }"
TBL_BlobData.dat
------------------------------
Date: Wed, 17 Jan 2007 14:49:13 -0800
From: Jim Gibson <jgibson@mail.arc.nasa.gov>
Subject: Re: Translation please
Message-Id: <170120071449130504%jgibson@mail.arc.nasa.gov>
In article <1169069403.480074.91640@l53g2000cwa.googlegroups.com>, Stan
<pleaselogout@gmail.com> wrote:
> Could someone please translate this into english please. This is part
> of obfuscation script
>
> thanks
>
> perl -n -i.bak -e "if (/([0-9]+\t)([A-Z0-9]*)(.*)$/) { print $1 .
> \"58\" x (length($2) / 2) . $3 . \"\n\"; } else { print; }"
> TBL_BlobData.dat
>
1. Start the Perl interpreter and execute a Perl program that does the
following:
2. Open a temporary file for writing.
3. Open the file TBL_BlobData.dat for reading.
4. Read each line in the input file and do the following:
5. If the line contains one or more decimal digits followed by a tab
character followed by zero or more decimal digits or upper-case English
alphabet characters, write the first set of digits followed by the
string "58" repeated one-half the number of times there are characters
in the second digit-upper-case-character string followed by the rest of
the original line and a newline to the output file. Otherwise, copy
the original line (with its original newline) to the output file.
6. When all of the input file has been read, close both files, rename
the original file to TBL_BlobData.dat.bak and rename the temporary file
to TBL_BlobData.dat.
7. Quit
HTH
Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com
------------------------------
Date: Wed, 17 Jan 2007 20:16:18 GMT
From: "Nospam" <nospam@home.com>
Subject: Unable to find form
Message-Id: <muvrh.6086$8j7.724@newsfe1-win.ntli.net>
I have tried form_number(1)..form_name(add_posting) ...current_form()..
still no luck can't figue out the name of the form or it's number, this is a
sample of the html:
<html>
...
<form method="post" action="/cgi-bin/add_posting.pl">
<table width="100%" border="0" cellpadding="4" height="456">
<tr valign="top" >
<td align="none" colspan="2" height="429" >
<div align="right">
<p align="left"> </p>
<p align="left"><font face="Verdana, Arial, Helvetica,
sans-serif"><b><font color="#FF6600" size="-1"></font></b></font><font
size="-1" color="#FF6600">
</font> </p>
</div>
<div align="left"><font face="Verdana, Arial, Helvetica,
sans-serif"><b><font color="#006600" size="-1">To
edit or delete one of your postings, please enter the posting
reference
and the password below:</font></b></font> <br>
<input type="hidden" name="action" value="enter_password">
</div>
<table width="56%" border="0" bgcolor="#E8E8A8" align="center">
<tr>
<td>
<table width="100%" border="0" align="center">
<tr bordercolor="#CCCCCC">
<td width="57%" height="42" nowrap>
<div align="right"><font face="Verdana, Arial,
Helvetica, sans-serif" size="-1"><b>Posting
Reference:</b> </font></div>
</td>
<td height="42" width="43%"> <font face="Verdana, Arial,
Helvetica, sans-serif" size="-1">
<input type="text" name="posting_id" value="" size="10"
maxlength="10">
</font></td>
</tr>
<tr bordercolor="#CCCCCC">
<td width="57%">
<div align="right"><font face="Verdana, Arial,
Helvetica, sans-serif" size="-1"><b>Password:
</b></font></div>
</td>
<td width="43%"> <font face="Verdana, Arial, Helvetica, sa
ns-serif" size="-1">
<input type="password" name="password" value=""
size="10" maxlength="10">
</font></td>
</tr>
<tr bordercolor="#CCCCCC">
<td colspan="2">
<div align="right"> <font face="Verdana, Arial,
Helvetica, sans-serif" size="-1">
<input type="submit" name="continue" value="Continue
>>">
</font> </div>
</td>
</tr>
</table>
</td>
</tr>
</table>
<p align="left"><font face="Verdana, Arial, Helvetica, sans-serif"
size="-2">If
you can't remember your password, please enter the posting
reference
above and press 'Email me the password' below. The password will
be
sent to the email address you specified when the advert was
posted.</font>
</p>
<div align="left"><font face="Verdana, Arial, Helvetica, sans-serif"
size="-2">If
you can't remember the posting reference search for your posting
using
the search function on the navigation bar on the left. Posting
references
are displayed on the bottom right of the postings. </font> </div>
<table width="630" border="0" cellspacing="2" cellpadding="2" >
<tr>
<td colspan="3">
<div align="center"><font face="Verdana, Arial, Helvetica,
sans-serif" size="-1">
<input type="submit" name="email_password" value="Email me
the password">
</font><font size="-1" color="#FF6600"></font></div>
</td>
</tr>
</table>
<font size="2" face="Verdana, Arial, Helvetica, sans-serif"><b>
</b></font></td>
</tr>
</table> </form>
</body>
</html>
------------------------------
Date: Wed, 17 Jan 2007 21:35:27 +0100
From: Mark Clements <mark.clementsREMOVETHIS@wanadoo.fr>
Subject: Re: VB to Perl Excel OLE question....QueryTables
Message-Id: <45ae88ab$0$27414$ba4acef3@news.orange.fr>
gearoidterry@vodafone.ie wrote:
> Hi,
>
> I'm trying to convert this VB code:
>
> ActiveSheet.QueryTables.Add(Connection:="TEXT;C:\perl\2.csv", _
> Destination:=Range("A1"))
>
> into Perl and can't seem to get the syntax right. Can someone please
> help me out? Here is what I have within Perl:
>
> $xlBook->ActiveSheet->QueryTables->Add(Connection=>"TEXT;C:\perl\2.csv",
> Destination=>Range("A1"));
>
> I think the Connection parameter is Ok but the syntax on the
> Destination parameter is definitely not correct.
Pass, but the "TEXT;C:\perl\2.csv" is suspect. You need to escape the
backslashes or use a non-interpolating quote operator, eg q()
mark@owl:~$ perl -le 'print q(TEXT;C:\perl\2.csv)'
TEXT;C:\perl\2.csv
mark@owl:~$ perl -le 'print "TEXT;C:\perl\2.csv"'
TEXT;C:perl.csv
See man perlop.
Mark
------------------------------
Date: Wed, 17 Jan 2007 21:41:40 +0100
From: Mark Clements <mark.clementsREMOVETHIS@wanadoo.fr>
Subject: Re: VB to Perl Excel OLE question....QueryTables
Message-Id: <45ae8a20$0$27414$ba4acef3@news.orange.fr>
Mark Clements wrote:
> gearoidterry@vodafone.ie wrote:
>> Hi,
>>
>> I'm trying to convert this VB code:
>>
>> ActiveSheet.QueryTables.Add(Connection:="TEXT;C:\perl\2.csv", _
>> Destination:=Range("A1"))
>>
>> into Perl and can't seem to get the syntax right. Can someone please
>> help me out? Here is what I have within Perl:
>>
>> $xlBook->ActiveSheet->QueryTables->Add(Connection=>"TEXT;C:\perl\2.csv",
>> Destination=>Range("A1"));
>>
>> I think the Connection parameter is Ok but the syntax on the
>> Destination parameter is definitely not correct.
>
> Pass, but the "TEXT;C:\perl\2.csv" is suspect. You need to escape the
> backslashes or use a non-interpolating quote operator, eg q()
>
> mark@owl:~$ perl -le 'print q(TEXT;C:\perl\2.csv)'
> TEXT;C:\perl\2.csv
> mark@owl:~$ perl -le 'print "TEXT;C:\perl\2.csv"'
> TEXT;C:perl.csv
>
> See man perlop.
>
Come to think of it, you're clearly on Windows. You'll probably get more
mileage out of
perldoc perlop
Mark
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>
Administrivia:
#The Perl-Users Digest is a retransmission of the USENET newsgroup
#comp.lang.perl.misc. For subscription or unsubscription requests, send
#the single line:
#
# subscribe perl-users
#or:
# unsubscribe perl-users
#
#to almanac@ruby.oce.orst.edu.
NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
#To request back copies (available for a week or so), send your request
#to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
#where x is the volume number and y is the issue number.
#For other requests pertaining to the digest, send mail to
#perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
#sending perl questions to the -request address, I don't have time to
#answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V11 Issue 44
*************************************