[31924] in Perl-Users-Digest
Perl-Users Digest, Issue: 3187 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Oct 23 00:09:22 2010
Date: Fri, 22 Oct 2010 21:09:05 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Fri, 22 Oct 2010 Volume: 11 Number: 3187
Today's topics:
ANNOUNCE: NHI1-0.8, PLMK-1.6 und libmsgque-4.6 <aotto1968@users.berlios.de>
Re: CGI, multiple page data input. <xhoster@gmail.com>
Re: map an array but first item different? <jwkrahn@example.com>
Re: modifying a PDF using PDF::API2? <w.c.humann@arcor.de>
Re: on windows 7 / cygwin / perl / cpan - cannot make c <emailsrvr-groups@yahoo.com>
paypal wholesale world cup 2010 football jersey <wangchang345@yahoo.cn>
Re: perl curl get data from website <emailsrvr-groups@yahoo.com>
Re: perl curl get data from website sln@netherlands.com
Re: Proposal: Using the debugger or 'diagnostics' shoul <w.c.humann@arcor.de>
Re: Proposal: Using the debugger or 'diagnostics' shoul <nospam-abuse@ilyaz.org>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 22 Oct 2010 19:19:32 +0200
From: Andreas Otto <aotto1968@users.berlios.de>
Subject: ANNOUNCE: NHI1-0.8, PLMK-1.6 und libmsgque-4.6
Message-Id: <i9sh64$ne8$00$2@news.t-online.com>
-----BEGIN xxx SIGNED MESSAGE-----
Hash: SHA1
Dear User,
ANNOUNCE: Major Feature Release
====================================
libmsgque: Application-Server-Toolkit for
C, C++, JAVA, C#, TCL, PERL, PYTHON, RUBY, VB.NET
PLMK: Programming-Language-Microkernel
NHI1: Non-Human-Intelligence #1
LINKS
=====
ChangeLog:
> http://nhi1.berlios.de/theLink/changelog.htm
libmsgque:
> http://nhi1.berlios.de/theLink/index.htm
NHI1:
> http://nhi1.berlios.de/
DOWNLOAD:
> http://developer.berlios.de/projects/nhi1/
SUMMARY
=======
This release adds the ability to:
* Ruby language support (LNG)
* L)anguage A)bstraction L)ayer (LaL)
* G)arbage C)ollection (GC) Object-Mark
Ruby is an object-oriented programming language like Python.
The new 'libmsgque' function (MqMark) was added to the GC support and
marks all objects that are referenced within 'libmsgque'. The programmer
now has the opportunity to replace internal functions such as:
SysCalloc, SysMalloc, SysRealloc, SysFree, SysSelect, SysFork,
SysServerSpawn, SysServerThread, SysServerFork, SysWait, SysUSleep,
SysSleep, SysDaemonize, SYSEXIT, SysAbort to adapt to the environment (Lal).
The connection of Ruby on libmsgque had light and shadow.
The light was clearly a complete API that allows very fast classes and
functions to be defined in C. The result was convincing in the
performance test, and let Python, Perl and Tcl behind.
The shadow was first of all the non-existent documentation. The initial
enthusiasm for the thread link was to quickly and ultimately turned out
to be unusable (no matter how many processors / cores are available in
Ruby is only one thread is active and the others are blocked ->
ridiculous). Last I made the memory management (garbage collection) to
create. I have no problem with "Mark" and "sweep" but without
IncrRefCout and DecrRefCount is a torture and forced me to adapt my
garbage collector.
Finally, a note in their own right:
will from now on, during the development of a work package, only source
code and binaries for x86_64 - created Linux. The reason lies in the
necessary acceleration of the development. The packages for other
operating systems like Windows or BSD / MacOSX only be made at the end
of a Work-Package. Ports and specific adjustments can be booked as a
consulting service.
mfg
Andreas Otto (aotto1968)
-----BEGIN xxx SIGNATURE-----
Version: GnuPG v2.0.15 (GNU/Linux)
Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org/
iQEcBAEBAgAGBQJMwcekAAoJEGTcPijNG3/A0gwH/2k8R7JYiVcEidHcAAO9vMVI
k6FbOT+zXRQAijl/42iWi0DMFB+iPw5G720pAbI0qAiEboaS0CfqZuGF0Di5kBTc
rswcfHMgJoCZoPVPQlio3s5Jrxn0Gj3Pr5FebG3BfqyQ1hm1t1g1XvxGI3hDFpdZ
vSe+lTcsVGGV2kuzgzomZ0B4LHWd2ttBniiDWUBXd09HYT7ePxIn8t1K76rnt7yy
9mqwKFC3DtShMEgFEgM0Ai2+RxHDGr/38wGlUmcXGUuYADdSgkX08+i4OM06OwPn
E5gW9Fi4LAQ2+SMIGot6xyF+YgEG9uOzgKTBgHqhzUg4iWJz9cvN/OHsoQYUrhw=
=Clor
-----END PGP SIGNATURE-----
------------------------------
Date: Thu, 21 Oct 2010 18:29:39 -0700
From: Xho Jingleheimerschmidt <xhoster@gmail.com>
Subject: Re: CGI, multiple page data input.
Message-Id: <4cc226cd$0$29347$ed362ca5@nr5-q3a.newsreader.com>
Justin C wrote:
> On 2010-10-19, Xho Jingleheimerschmidt <xhoster@gmail.com> wrote:
>> It is not clear to me that the direction you indicate is a 'forward'
>> direction.
>
> Xho, the problem is that in some of my programs there are many fields to
> the forms (invoice lines, often they number in the hundreds), and to
> add:
> print hidden(-name=>'some-name', -value=>$cgi->param('some-name'));
> a few hundred times is extremely ugly.
Well then don't do that. Use a loop. Switching from hidden to session
isn't going to change that. You can write horrible code either way, if
you work hard at it.
And where do these hundreds of invoice lines come from? Did you make
the user enter them one by one, each into a different form element? Or
did you compute them from a more compact form of entry? If the latter,
why not just send back the compact form, and recompute the list on the
next submission?
> There has to be a better way. But
> as Jurgen mentioned, it's not a perl problem, though it can be solved
> with perl.
>
> I've looked at CGI::Session, and decided to re-invent the wheel.
Why?
> The
> program is for internal use only and there is nothing to be gained by
> users messing around with it, so I'm creating a sort of session ID that
> I will pass in a hidden field, and using Storable to store/retrieve the
> entire hash submitted by the browser. CGI::Session seemed overkill.
>
> For a session ID I'm using:
> my $sid = md5_hex (int(rand(99999999)));
Why not just use the random integer directly? Using md5 this way
doesn't make accidental collisions less likely. And since you have just
published your intentions, using an md5 doesn't make malicious ones less
likely, either.
Xho
------------------------------
Date: Fri, 22 Oct 2010 14:56:26 -0700
From: "John W. Krahn" <jwkrahn@example.com>
Subject: Re: map an array but first item different?
Message-Id: <fMnwo.889$vu3.499@newsfe13.iad>
Justin C wrote:
> I'm using CGI.pm to generate a table, and within that table I'm using
> map to put the contents of an arrayref into cells within each table row:
>
> print table(
> { get_formatting_string($formatting) },
> Tr({-class=>'holding'},
> [
> th([@{$col_heads}]),
> map { td($_) } @{$data},
> ],
> ),
> );
>
> Here's what Data::Dumper says about $data:
> $VAR1 = [ '2010-10-01', 'First consignment of two. Order split due to size.', 'John Smith' ];
> $VAR2 = [ '2010-10-21', 'Sent email requesting payment. If no joy by follow-up date then set a deadline.', 'Justin' ];
>
> The problem I'm having is that when the second column has a lot of text
> it causes the first column to shrink and wrap and this looks terrible. I
> can fix this with td({-nowrap=>'nowrap}, $_) if doing things manually,
> but I'd still like map to handle this for me because I'm using the same
> sub to print tables with different numbers of columns.
>
> How can I set a parameter for the first item while still letting map
> handle this? ... or how else could I do this?
print table(
{ get_formatting_string($formatting) },
Tr({-class=>'holding'},
[
th([@{$col_heads}]),
td( { -nowrap => 'nowrap' }, $data->[ 0 ] ),
map { td( $_ ) } @{ $data }[ 1 .. $#$data ],
],
),
);
John
--
Any intelligent fool can make things bigger and
more complex... It takes a touch of genius -
and a lot of courage to move in the opposite
direction. -- Albert Einstein
------------------------------
Date: Fri, 22 Oct 2010 02:11:53 -0700 (PDT)
From: Wolfram Humann <w.c.humann@arcor.de>
Subject: Re: modifying a PDF using PDF::API2?
Message-Id: <24ea3bd9-1a29-4899-b10d-7bf56b66fe25@c20g2000yqj.googlegroups.com>
On Oct 13, 3:56=A0pm, bugbear <bugbear@trim_papermule.co.uk_trim> wrote:
> I'm trying to add a watermark to an existing page; the watermark
> is in a separate pre-prepared PDF.
>
> Code is fairly simple -
>
> =A0 =A0 =A0my $base =3D PDF::API2->open($in);
>
> =A0 =A0 =A0my $page =3D $base->openpage(1);
>
> =A0 =A0 =A0my $water =3D PDF::API2->open("water.pdf");
>
> =A0 =A0 =A0my $xo =3D $dest->importPageIntoForm($water, 1);
> =A0 =A0 =A0$page->gfx->formimage($xo, 0, 0, 1);
>
> =A0 =A0 =A0$base->saveas($out);
>
> This works OK on simple "base" files, but fails on larger ones;
> Adobe Acrobat Reader says the output has an error (without
> being specific)
>
> sidebar
> =A0 =A0 anyone know a good PDF checker that gives detailed fault reports?
>
> I note that API2 is much more about creating new PDF files
> than messing with existing ones - indeed, if I proceed
> by transcribing the page from "$in" and the watermark
> into a PDF::API2->new() object, that works OK,
> in that it generates valid files, but it loses much
> of the metadata from the base file.
>
> So - is PDF::API2 really up to modifying existing files,
> or should I try to "jazz up" my transcription solution?
>
> =A0 =A0BugBear
Have you tried PDF::Reuse? There are some remarks about using it for
watermarking here: http://groups.google.com/group/PDF-Reuse/browse_thread/t=
hread/b1028cc24dadb16c
I used it a couple of times and found it o.k. Don't know how well it
preserves metadata though.
Wolfram
------------------------------
Date: Fri, 22 Oct 2010 08:59:04 -0700 (PDT)
From: SVCitian <emailsrvr-groups@yahoo.com>
Subject: Re: on windows 7 / cygwin / perl / cpan - cannot make cpan work
Message-Id: <0cedb61d-638d-46bf-a5ce-3113f86a44de@s12g2000prs.googlegroups.com>
On Oct 21, 10:55=A0pm, Sherm Pendley <sherm.pend...@gmail.com> wrote:
> SVCitian <emailsrvr-gro...@yahoo.com> writes:
> > Hi, I have tried load some Perl Modules using CPAN.. but I can't make
> > it work.
>
> > fyi, curl "http://..." works on the command line perfectly. (just so
> > that you know the internet connection is all ok.
>
> Yeah, the error messages seem to indicate that the request is being
> made OK, but the server is returning an error - i.e. connectivity doesn't
> seem to be the problem.
>
> Have you tried configuring CPAN.pm to use a different mirror site?
>
> sherm--
>
> --
> Sherm Pendley
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0<h=
ttp://camelbones.sourceforge.net>
> Cocoa Developer
Thank you so much.. I have no idea about CPAN.pm.
earlier i accepted the defaults (auto configure).
and i didn't know how i can go back to set all those thing again.. and
I read from elsewhere to do this:
cpan> o conf init
and went through all the steps.. and put in several mirrors from
here.. closer to my country.
http://www.cpan.org/SITES.html
and it works perfectly now.
Thank you.
------------------------------
Date: Fri, 22 Oct 2010 17:40:02 -0700 (PDT)
From: POLO TSHIRT <wangchang345@yahoo.cn>
Subject: paypal wholesale world cup 2010 football jersey
Message-Id: <2924ec31-aeeb-4562-8479-e94fbab4ef45@j4g2000prm.googlegroups.com>
paypal wholesale world cup 2010 football jersey England
www.supertrade06.com
paypal wholesale world cup 2010 football jersey France
www.supertrade06.com
paypal wholesale world cup 2010 football jersey New Zealand
paypal wholesale world cup 2010 football jersey Portugal
www.supertrade06.com
paypal wholesale www.supertrade06.comworld cup 2010 football jersey
paypal wholesale www.supertrade06.comworld cup 2010 football jersey
Brazil www.supertrade06.com
paypal wholesale world cup 2010 football jersey England
------------------------------
Date: Fri, 22 Oct 2010 09:15:32 -0700 (PDT)
From: SVCitian <emailsrvr-groups@yahoo.com>
Subject: Re: perl curl get data from website
Message-Id: <4564ae86-5778-4853-812d-0f51a8f40a08@o15g2000prh.googlegroups.com>
On Oct 20, 9:53=A0pm, SVCitian <emailsrvr-gro...@yahoo.com> wrote:
> On Oct 20, 10:47=A0am, s...@netherlands.com wrote:
>
>
>
> > On Tue, 19 Oct 2010 20:10:42 -0700, s...@netherlands.com wrote:
> > >On Tue, 19 Oct 2010 07:17:14 -0700 (PDT),SVCitian<emailsrvr-gro...@yah=
oo.com> wrote:
>
> > >>On Oct 19, 2:26=A0am, s...@netherlands.com wrote:
> > >>> On Mon, 18 Oct 2010 05:58:42 -0700 (PDT),SVCitian<emailsrvr-gro...@=
yahoo.com> wrote:
> > >>> >On Oct 17, 10:21=A0pm, Tad McClellan <ta...@seesig.invalid> wrote:
> > >>> >>SVCitian<emailsrvr-gro...@yahoo.com> wrote:
> > >>> >> > I even tried to user "tamper data" firefox add to get behind t=
he
> > >>> >> > scenes of GET, POST, etc... but I can't proceed any further th=
an the
> > >>> >> > URLs given above.
>
> > >>I have no clue of how to make heads or tails of the result.
>
> > >>If you could post the result in a more helpful format.. I would
> > >>appreciate it.
>
> > >>Thanks.
>
> > >This may be better, my first afternoon with LWP.
>
> > >-sln
>
> > >----------------------
> > >use strict;
> > >use warnings;
>
> > >use HTML::TableExtract;
> > >use HTTP::Cookies;
> > >use HTTP::Request::Common qw(POST GET);
> > >use LWP::UserAgent;
>
> > >my $show_content =3D 0;
> > >my ($content1, $content2);
>
> > [snip code]
>
> > ># Create asecond request: "get search table"
> > ># ---------
>
> > > $request =3D HTTP::Request->new('GET' =3D>
> > > =A0join '', qw{
> > >http://www.bangkokflightservices.com/TrackTrace/search_awb.php?m_pref.=
..
> > >n=3D75064953&h_prefix=3DHWB&h_sn=3D&ch=3D } );
>
> > ## Or, to create a variable AWB lookup
> > # =A0my $WBNprefix =3D '176';
> > # =A0my $WBN =A0 =A0 =A0 =3D '75064953';
> > # =A0 $request =3D HTTP::Request->new('GET' =3D>
> > # =A0"http://www.bangkokflightservices.com/TrackTrace/search_awb.php?m_=
prefix=3D" .
> > # =A0 $WBNprefix. "&m_sn=3D" . $WBN . "&h_prefix=3DHWB&h_sn=3D&ch=3D ")=
;
>
> > -sln
>
> Thank you for your efforts... I will try out the perl code tomorrow.
>
> By the way, I am not on a linux machine.. I am on Windows XP using
> cygwin / perl.
>
> So, I don't know if the proxy and all the rest of it could work. Any
> way I will try if I ever get successful.
>
> Any other helpful pointers for Windows / Cygwin / Perl... will be
> appreciated too.
>
> Thanks.
Thank you sln.
First I had a hard time making cpan work with Windows 7 / cygwin /
perl.. the problem was found to be cpan.pm module and mirror site.
made at that work.. and installed the required modules.
And, the next step was to run your code... When i copied and pasted
your code from the google groups.. I had issue with some "..." which
the html was not formatted correctly... so, i had to make the best
judgment and fixed the m_prefix and m_sn number correctly.
another sample:
m_prefix=3D081&m_sn=3D75133844
And it works just as per the needs. Thank you so much.
I have no idea why my initial direct "curl" execution cannot execute
correctly... Can you please explain why a direct GET doesn't work with
the URL.
and why your code had to be instead.. what does the web site developer
do to avoid getting direct GET result. Is it mainly to do with the
cookie, or user agent or some form ajax issues, etc.??
Also, can you please explain a bit about your code and what it does..
just some comments.
Thank you.. much appreciated.
------------------------------
Date: Fri, 22 Oct 2010 19:01:01 -0700
From: sln@netherlands.com
Subject: Re: perl curl get data from website
Message-Id: <fqc4c6phr58d1qe1ia7p6uqi7f0fu60cfj@4ax.com>
On Fri, 22 Oct 2010 09:15:32 -0700 (PDT), SVCitian <emailsrvr-groups@yahoo.com> wrote:
>Thank you sln.
>
>First I had a hard time making cpan work with Windows 7 / cygwin /
>perl.. the problem was found to be cpan.pm module and mirror site.
>made at that work.. and installed the required modules.
>
>And, the next step was to run your code... When i copied and pasted
>your code from the google groups.. I had issue with some "..." which
>the html was not formatted correctly... so, i had to make the best
>judgment and fixed the m_prefix and m_sn number correctly.
>
>another sample:
>m_prefix=081&m_sn=75133844
>
>And it works just as per the needs. Thank you so much.
>
>I have no idea why my initial direct "curl" execution cannot execute
>correctly... Can you please explain why a direct GET doesn't work with
>the URL.
>
>and why your code had to be instead.. what does the web site developer
>do to avoid getting direct GET result. Is it mainly to do with the
>cookie, or user agent or some form ajax issues, etc.??
>
>Also, can you please explain a bit about your code and what it does..
>just some comments.
>
>Thank you.. much appreciated.
Not a problem. I'm learning as I go.
Whats going on with this is that it is using JavaScript and Ajax.
The first GET is to load a minimal html page that has embedded JS
that calls Ajax layer. At this time it also establishes a session id
that is only good as long as the page is loaded.
The html is sparse, and contains a table "container". One of the elements,
a single <td> with an id of 'output', is being used as a placeholder into
which more html/JS will be added dynamically with the next GET call.
This is called a html/code fragment, its not a new page, its just the
dynamic loading of table data. Each new WBN sent in subsequent GETs will
return data (html fragment) for that <td> element (id="output").
So, rendering the full page is at least a two-step process.
Loading the main html frame, then loading html code fragment (table data
for the Air Bill). Subsequent GETs (without leaving the page) just updates
the table data to contain the information for a new Air Bill.
Thats the way it works in the browser. In the browser, Java Script is run.
It takes the url input and "constructs" a new url. The "new" url is formulated
into a new request called XMLHttpRequest() object (similar to LWP request).
This Ajax request object goes out and does a normal GET. Whats returned is a
fragment of html, in this case table data containing info about the luggage
for the particular Way Bill.
So thats the reason it didn't work in LWP, the main page is just a shell for
the dynamic data loaded later.
WSP however, see's two requests, one for the main page, the other for the data
fragment. WSP doesen't need to execute JS/Ajax, it just records the result of the
interaction between the client/server.
On the bottom of the main html page, we see this:
<script>
searchajax2('./search_awb.php?m_prefix=176&m_sn=75064953&h_prefix=HWB&h_sn=&ch= ');
reloadpage();
</script>
This is the first thing that is run.
We see that the function searchajax2() first creates an Ajax request object
(using that url). Then it asigns the ajax response reference to the
<td> id="output" elements innerHTML. The ajax request is opened then sent:
ajaxRequest.open("GET", url , true);
ajaxRequest.send(null);
Finally, searchajax2() function returns, then reloadpage() is called to render
the DOM.
Apparently, with regard to the LWP, its a two step process. First to load the
main page skeleton, establish a cookie, then do sucessive calls to load
each fragment with a new WBN info. The html fragments returned each contain
specific information (mostly table data html) related to the WBN.
I hope I am clear, trying not to overload the noise on the group.
I am new to this too, but it doesn't look line rocket science.
-sln
Ps. Here is fleshed out example with some comments and added constuct
to fetch mutilple Way Bills' data.
To see the content, set $show_content = 1;
and maybe redirect the output to a file:
> perl lwp.pl > mycapture.txt
-----------------------------------------------
use strict;
use warnings;
use HTML::TableExtract;
use HTTP::Cookies;
use HTTP::Request::Common qw(POST GET);
use LWP::UserAgent;
my $show_content = 0; # 1 = shows response content (html)
my ( $content1, $content2 );
# Create cookies
my $jar = HTTP::Cookies->new();
# Create user agent
my $ua = LWP::UserAgent->new();
$ua->timeout( 10 );
$ua->cookie_jar( $jar );
$ua->agent( "Microsoft Internet Explorer/6.0" );
# Create a first request: "get track table framework"
# Note - this will establish a session with the server.
# ---------
my $request = HTTP::Request->new('GET' =>
join '', qw{
http://www.bangkokflightservices.com/TrackTrace/showc_track.php?m_prefix=176&m_s
n=75064953&h_prefix=HWB&h_sn=&ecy=e076438db64c6190f7b9689a379b7f7093368f1652d14d
b65fee1ab916713f3f5f4030f53369cb1f669614312c4748899c272f4d976a2b299274a21ad80fc0
72b1bab2ab1c181d08c670188722e51ec162f9ae337e3f2f132c88d249133815558d241ce8a4e9b3
fa75c144268b9e901037c2c7257142ee42ff9b2bf2767f57ed62b94fd938ea4dd2b28c53fea6af74
be&ch=%A0%A0%A0%A0 &id=1.2405164500620218} );
# Pass request to agent
# Note - the response is just Java Script/Ajax laced
# html document with a skeleton table. One of the table's element <td> has
# an Id = "output" that recieves the real table data from the next request.
# Apparently this establishes a cookie.
my $res = $ua->request( $request );
if ( $res->is_success ) {
print "\nHtml main Content .. OK\n\n";
if ($show_content) {
print $res->content, "\n\n";
}
$content1 = $res->content;
}
else {
print "Request (Html main Content) Failed\n";
print $res->status_line, "\n\n";
die;
}
print '='x20, "\n\n";
# Create a second request: "get track table body"
# Note - When running as an html document, JS/Ajax are used
# to dynamically load table data (html) to put in <td id="output" ..>
# already loaded with the first request (the main html).
# The html that is returned is Dynamic Html fragment. This contails
# the table data for a single prefix/serial no.
# ---------
# Loop, get the data for a couple of Way Bill Numbers.
my %wbhash = ( '176'=>'75064953', '081'=>'75133844' );
while (my ( $WBNprefix, $WBN ) = each %wbhash)
{
$request = HTTP::Request->new('GET' =>
join '', (
"http://www.bangkokflightservices.com/TrackTrace/search_awb.php?",
"m_prefix=$WBNprefix",
"&m_sn=$WBN",
"&h_prefix=HWB",
"&h_sn=&ch= ")
);
# Pass request to agent
$res = $ua->request( $request );
if ( $res->is_success ) {
print "\nWay Bill fragment .. OK\n";
if ($show_content) {
print $res->content, "\n\n";
}
$content2 = $res->content;
}
else {
print "Request (Way Bill html fragment Content) Failed\n";
print $res->status_line, "\n\n";
die;
}
print "Way Bill ($WBNprefix - $WBN) Content tables:\n", '-'x20, "\n\n";
print_tables( $content2 );
print "\n";
}
print '='x20, "\n\n";
print "Done!\n\n\n";
exit;
## Table extract Util from wsp
##
sub print_tables {
my ( $table, $row, $cell );
my $tc = 0;
my $table_extractor = HTML::TableExtract->new();
$table_extractor->parse( $_[0] );
foreach $table ( $table_extractor->table_states ) {
print "TABLE $tc:\n"; $tc++;
my $rc = 0;
foreach $row ( $table->rows ) {
print "ROW $rc:\n"; $rc++;
foreach $cell ( @$row ) {
$cell = '' unless defined $cell;
$cell =~ s/\n/ /g;
$cell =~ s/[ \t]+/ /g;
$cell =~ s/^[ \t]//;
$cell =~ s/[ \t]$//;
$cell =~ s/ *<\/td *//g;
print "$cell|";
}
print "\n";
}
}
}
__END__
Html main Content .. OK
====================
Way Bill fragment .. OK
Way Bill (081 - 75133844) Content tables:
--------------------
TABLE 0:
ROW 0:
á||||
ROW 1:
á|Enter Master Air Waybill (MAWB)|
ROW 2:
Optional (For Import MAWB Only)|
ROW 3:
á||||
ROW 4:
||* Master Air Waybill number example 123 - 12345678||
TABLE 1:
ROW 0:
||||||||||
ROW 1:
Item|AWB No|Flight No|Flight Date|Origin|Dest|Status|Pieces|Weight|Time|
ROW 2:
1|081-75133844|JQ 029|Oct 19 2010|MEL|BKK|Delivered|2|1,480.00|Oct 20 2010 - 125
5|
Way Bill fragment .. OK
Way Bill (176 - 75064953) Content tables:
--------------------
TABLE 0:
ROW 0:
á||||
ROW 1:
á|Enter Master Air Waybill (MAWB)|
ROW 2:
Optional (For Import MAWB Only)|
ROW 3:
á||||
ROW 4:
||* Master Air Waybill number example 123 - 12345678||
TABLE 1:
ROW 0:
|||||||||||
ROW 1:
Item|AWB No|Flight No|Flight Date|Origin|Dest|ULD No|Status|Pieces|Weight|Time|
ROW 2:
1|176-75064953|EK 419|Oct 15 2010|BKK|DXB|Flight Changeá|Export Transshipment|3|
743.00|Oct 14 2010 5:37PM|
ROW 3:
2|176-75064953|EK 419|Oct 15 2010|BKK|DXB|á|Accepted|3|743.00|Oct 14 2010 5:37PM
|
ROW 4:
3|176-75064953|EK 373|Oct 15 2010|BKK|DXB|Flight Changeá|Export Transshipment|3|
743.00|Oct 14 2010 6:12PM|
ROW 5:
4|176-75064953|EK 373|Oct 15 2010|BKK|DXB|SHCá|Export Transshipment|3|743.00|Oct
14 2010 6:12PM|
ROW 6:
5|176-75064953|EK 373|Oct 14 2010|BKK|DXB|Flight Changeá|Export Transshipment|3|
743.00|Oct 14 2010 6:42PM|
ROW 7:
6|176-75064953|EK 373|Oct 14 2010|BKK|DXB|PMC31131EKá|Manifested|3|743.00|Oct 14
2010 6:57PM|
ROW 8:
7|176-75064953|EK 373|Oct 14 2010|BKK|DXB|á|Departed|3|743.00|Oct 14 2010 9:54PM
|
====================
Done!
------------------------------
Date: Fri, 22 Oct 2010 01:47:29 -0700 (PDT)
From: Wolfram Humann <w.c.humann@arcor.de>
Subject: Re: Proposal: Using the debugger or 'diagnostics' should preload Carp::Heavy
Message-Id: <66a273c4-4070-4225-bb36-297cf9b781b3@t20g2000yqa.googlegroups.com>
On Oct 21, 8:01=A0pm, Ilya Zakharevich <nospam-ab...@ilyaz.org> wrote:
> On 2010-10-21, Wolfram Humann <w.c.hum...@arcor.de> wrote:
>
> > I would therefore propose, that the debugger and "use diagostics" do a
> > "use Carp::Heavy" internally. What do you think?
>
> Essentially, this would debug different code than the original one. =A0A
> no-no-no.
>
> A better thing would be to catch in Carp the errors in loading
> Carp::Heavy, and emit the advice to preload Carp::Heavy.
If I understand you correctly, the reasoning is "if we fix this in the
debugger and dignostics.pm, then the next one trying to use Carp
during compilation phase will run into the same problem again". So
yes, something in Carp.pm should be fixed. Would that be simply to
replace
eval { require Carp::Heavy };
return $@ if $@;
with
eval { require Carp::Heavy };
return $@ . $extra_message if $@;
(but I don't have a really good idea how to word $extra_message)?
Once that is done I would still be in favour of a "use Carp::Heavy" in
diagonstics.pm. Otherwise I would need to "use Carp::Heavy" before
every "use diagnostics" as a standard idiom, which obviously conflicts
with lazyness :-)
Wolfram
------------------------------
Date: Fri, 22 Oct 2010 11:59:43 +0000 (UTC)
From: Ilya Zakharevich <nospam-abuse@ilyaz.org>
Subject: Re: Proposal: Using the debugger or 'diagnostics' should preload Carp::Heavy
Message-Id: <slrnic2v5f.mhi.nospam-abuse@powdermilk.math.berkeley.edu>
On 2010-10-22, Wolfram Humann <w.c.humann@arcor.de> wrote:
> On Oct 21, 8:01 pm, Ilya Zakharevich <nospam-ab...@ilyaz.org> wrote:
>> On 2010-10-21, Wolfram Humann <w.c.hum...@arcor.de> wrote:
>>
>> > I would therefore propose, that the debugger and "use diagostics" do a
>> > "use Carp::Heavy" internally. What do you think?
>>
>> Essentially, this would debug different code than the original one. A
>> no-no-no.
>>
>> A better thing would be to catch in Carp the errors in loading
>> Carp::Heavy, and emit the advice to preload Carp::Heavy.
>
> If I understand you correctly, the reasoning is "if we fix this in the
> debugger and dignostics.pm, then the next one trying to use Carp
> during compilation phase will run into the same problem again". So
> yes, something in Carp.pm should be fixed. Would that be simply to
> replace
> eval { require Carp::Heavy };
> return $@ if $@;
> with
> eval { require Carp::Heavy };
> return $@ . $extra_message if $@;
More or less; as far as I noticed, the $@ is always the same in teh
case of failure; and $^S has a special value. I would probably check
for these conditions...
> (but I don't have a really good idea how to word $extra_message)?
Postponed load of Carp::Heavy failed
(load was requested during unappropriate compilation phase):
$@;
One may want to preload Carp::Heavy by -MCarp::Heavy or `use Carp::Heavy'.
Ilya
------------------------------
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:
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
Back issues are available via anonymous ftp from
ftp://cil-www.oce.orst.edu/pub/perl/old-digests.
#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 3187
***************************************