[30289] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 1532 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun May 11 16:09:47 2008

Date: Sun, 11 May 2008 13:09:10 -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           Sun, 11 May 2008     Volume: 11 Number: 1532

Today's topics:
    Re: code written under 5.10.0 to be run under 5.8.8 <benkasminbullock@gmail.com>
    Re: Creating new pages automatically with PDF::API2 <bill@ts1000.us>
    Re: DROP TABLE customers <spamtrap@dot-app.org>
    Re: DROP TABLE customers <get@bentsys.com>
    Re: None-textual content in tech groups (was: Perl DBI  <1usa@llenroc.ude.invalid>
        None-textual content in tech groups (was: Perl DBI Modu <hjp-usenet2@hjp.at>
    Re: None-textual content in tech groups <spamtrap@dot-app.org>
    Re: Perl DBI Module: SQL query where there is space in  <hjp-usenet2@hjp.at>
    Re: Perl DBI Module: SQL query where there is space in  <hjp-usenet2@hjp.at>
    Re: Perl DBI Module: SQL query where there is space in  <spamtrap@dot-app.org>
    Re: Perl DBI Module: SQL query where there is space in  <cwilbur@chromatico.net>
    Re: regex problem unresolved <benkasminbullock@gmail.com>
    Re: retrieve info from searching site <hjp-usenet2@hjp.at>
    Re: state of Erlang? <hjp-usenet2@hjp.at>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Sun, 11 May 2008 11:06:21 +0000 (UTC)
From: Ben Bullock <benkasminbullock@gmail.com>
Subject: Re: code written under 5.10.0 to be run under 5.8.8
Message-Id: <g06jvd$111$3@ml.accsnet.ne.jp>

On Sat, 10 May 2008 20:51:54 -0700, dummy wrote:

> I understand that one can specify that a script must be run under a perl
> version no earlier than a particular version.  So, if I say 'use 5.6.0',
> that code will throw an error if one tries to run it under perl 5.5.0,
> right?

#!/usr/local/bin/perl

use warnings;

use 5.6.0;

v-string in use/require non-portable at ./usenet-2008-5-11.pl line 5.

So you have to say

use 5.006;

> But how about the reverse case?
> 
> Suppose I write code on my desktop, which has perl 5.10.0 installed, and
> later transfer that code to a system that only has perl as far as 5.8.8.
> How can I cause an error on the desktop if I accidentally use any of the
> new features of 5.10.0, as I would want to do to signal incompatibility?

> Is this sort of thing impossible?

I believe the new features are all turned off by default anyway, so you 
have to "use 5.010;" anyway:

#!/usr/local/bin/perl

use warnings;

use 5.010;

say "say say what you want";


------------------------------

Date: Sun, 11 May 2008 13:03:02 -0700 (PDT)
From: Bill H <bill@ts1000.us>
Subject: Re: Creating new pages automatically with PDF::API2
Message-Id: <26fcc516-9cc0-41e6-94dd-2955bb89aa24@t54g2000hsg.googlegroups.com>

On May 11, 3:51=A0am, hotkitty <stpra...@gmail.com> wrote:
> Since no one in the beginners group could answer this I thought I'd
> ask it to this group. I am using PDF::API2 to create PDF files from a
> bunch of separate text files I have. The issue I am having is that I
> am only able to create the first page of each text file and I haven't
> been able to figure out how to automatically generate additional pages
> if the text document requires it. In the PDF::API2::Simple module,
> there is "autoflow", which will generate the additional pages you need
> and fill it with the appropriate text. I have the following code and
> would appreciate if anyone could guide me to how I can generate multi-
> page pdf's (I've omitted some of the code that isn't relevant to
> creating the pdf files):
>
> #!/usr/bin/perl
>
> use warnings;
>
> use LWP::Simple;
> use HTML::TokeParser;
> use PDF::API2;
> use Text::Autoformat;
> .
> .
> .
> .
> .
> my $pdffile =3D '$file';
> my $pdf =3D PDF::API2->new( -file =3D> "$directoryname/$file.pdf");
> my $page =3D $pdf->page;
>
> $page->mediabox('A4');
>
> =A0my $times =3D $pdf->corefont( 'Times', -encoding =3D> 'latin1');
>
> my $main_text =3D $page->text;
> $main_text->font($times, 14);
> $main_text->fillcolor('pearl');
> $main_text->lead(16);
> $main_text->translate(15, 650);
> $main_text->paragraph("@body\n", 575, 144, -align =3D> "justify");
>
> $pdf->save;
> $pdf->end;

I use PDF:API2 alot. It is easy to create a new page, when you are
done adding to the existing page you just do a new $page =3D $pdf->$page
and start writing to the second page.

Bill H


------------------------------

Date: Sun, 11 May 2008 15:08:46 -0400
From: Sherman Pendley <spamtrap@dot-app.org>
Subject: Re: DROP TABLE customers
Message-Id: <m1y76gy7y9.fsf@dot-app.org>

"Gordon Etly" <get@bentsys.com> writes:

> Why is everything you don't like a "flame" to you?

It's not "everything Uri doesn't like."

It's the fact that you've been doing nothing about pissing and moaning
and flaming about every topic that comes up, ever since you lost your silly
little "PERL vs. Perl" spat. Give it a rest already! Grow up or get out.

sherm--

-- 
My blog: http://shermspace.blogspot.com
Cocoa programming in Perl: http://camelbones.sourceforge.net


------------------------------

Date: Sun, 11 May 2008 12:53:40 -0700
From: "Gordon Etly" <get@bentsys.com>
Subject: Re: DROP TABLE customers
Message-Id: <68p166F2su9esU1@mid.individual.net>

Sherman Pendley wrote:

> "Gordon Etly" <get@bentsys.com> writes:

> > Why is everything you don't like a "flame" to you?

> It's not "everything Uri doesn't like."

It sure seems like it.

> It's the fact that you've been doing nothing about pissing and moaning
> and flaming about every topic that comes up, ever since you lost your
> silly little "PERL vs. Perl" spat. Give it a rest already! Grow up or
> get out.

1) How does commenting in a few topics every so often become "every" 
topic?

2) I merely comment on what I see, and how I felt it was either wrong or 
unnecessary. It's not a flame. But I can see how one who can't accept 
being wrong or that their are other points of view and ways of looking 
at things might see every contrary comment as a flame...


-- 
G.Etly 




------------------------------

Date: Sun, 11 May 2008 14:16:52 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: None-textual content in tech groups (was: Perl DBI Module: SQL query where there is space in field name)
Message-Id: <Xns9A9B6894D2F50asu1cornelledu@127.0.0.1>

"Peter J. Holzer" <hjp-usenet2@hjp.at> wrote in
news:slrng2du4j.v9m.hjp-usenet2@hrunkner.hjp.at: 

> On 2008-05-10 17:25, A. Sinan Unur <1usa@llenroc.ude.invalid> wrote:
>> "Waylen Gumbal" <wgumgfy@gmail.com> wrote in
>> news:68m2jtF2t6f4nU1@mid.individual.net: 
>>> A. Sinan Unur wrote:
>>>> Nope. Post plain text in text only groups.
>>
>>> HTML without breaking a sweat, so why stifle innovation in the name
>>> of preserving old 20+ year old paradigms?
>>
>> ... cute little graphics provides any enhanced value to me.
> 
> I disagree with that. I consider especially graphics to be very
> valuable in explaining a problem or a solution. We can make do with
> crude ASCII graphics (or less crude Unicode graphics), or we can
> include links to a graphic on some webserver, but the ability to
> include graphics (preferably vector graphics) in a posting would
> sometimes (not often, I agree) help to get a point across a lot
> better. 

OK, granted ... However, I had just looked at the most recent 5 MB 
seminar speaker announcement the entire information content of which 
consisted of paper title, speaker's name, time and place.

When you get a few of these every day, even on a fast connection, the 
time spent waiting for email to download becomes not so insignificant.

So, for every message where the quality of communication improves 
somewhat thanks to figures etc, I fear there will be n (for n not small) 
"send me teh codez plz" messages but this time with attachments which 
need to be virus scanned before one can even take a look.

Nah, just give me plain text.

Sinan
-- 
A. Sinan Unur <1usa@llenroc.ude.invalid>
(remove .invalid and reverse each component for email address)

comp.lang.perl.misc guidelines on the WWW:
http://www.rehabitation.com/clpmisc/


------------------------------

Date: Sun, 11 May 2008 15:45:53 +0200
From: "Peter J. Holzer" <hjp-usenet2@hjp.at>
Subject: None-textual content in tech groups (was: Perl DBI Module: SQL query where there is space in field name)
Message-Id: <slrng2du4j.v9m.hjp-usenet2@hrunkner.hjp.at>

On 2008-05-10 17:25, A. Sinan Unur <1usa@llenroc.ude.invalid> wrote:
> "Waylen Gumbal" <wgumgfy@gmail.com> wrote in
> news:68m2jtF2t6f4nU1@mid.individual.net: 
>> A. Sinan Unur wrote:
>>> Nope. Post plain text in text only groups.
>
>> HTML without breaking a sweat, so why stifle innovation in the name of
>> preserving old 20+ year old paradigms?
>
> There is no innovation here. Yeah, there is an attempt to change 
> something but not all change qualifies as innovation. No one's cute 
> color scheme, liberal use of different font sizes, cute little graphics 
> provides any enhanced value to me.

I disagree with that. I consider especially graphics to be very valuable
in explaining a problem or a solution. We can make do with crude ASCII
graphics (or less crude Unicode graphics), or we can include links to a
graphic on some webserver, but the ability to include graphics
(preferably vector graphics) in a posting would sometimes (not often, I
agree) help to get a point across a lot better.

	hp



------------------------------

Date: Sun, 11 May 2008 15:03:57 -0400
From: Sherman Pendley <spamtrap@dot-app.org>
Subject: Re: None-textual content in tech groups
Message-Id: <m13aoozmqq.fsf@dot-app.org>

"Peter J. Holzer" <hjp-usenet2@hjp.at> writes:

> On 2008-05-10 17:25, A. Sinan Unur <1usa@llenroc.ude.invalid> wrote:
>> "Waylen Gumbal" <wgumgfy@gmail.com> wrote in
>> news:68m2jtF2t6f4nU1@mid.individual.net: 
>>> A. Sinan Unur wrote:
>>>> Nope. Post plain text in text only groups.
>>
>>> HTML without breaking a sweat, so why stifle innovation in the name of
>>> preserving old 20+ year old paradigms?
>>
>> There is no innovation here. Yeah, there is an attempt to change 
>> something but not all change qualifies as innovation. No one's cute 
>> color scheme, liberal use of different font sizes, cute little graphics 
>> provides any enhanced value to me.
>
> I disagree with that. I consider especially graphics to be very valuable
> in explaining a problem or a solution. We can make do with crude ASCII
> graphics (or less crude Unicode graphics), or we can include links to a
> graphic on some webserver, but the ability to include graphics
> (preferably vector graphics) in a posting would sometimes (not often, I
> agree) help to get a point across a lot better.

The principle is sound - a picture is worth a thousand words.

But the implementation might be difficult. Usenet is propagated across many
thousands of local servers, and each message takes up space on each one of
those servers. To manage storage, messages are only retained for a fixed
amount of time, with that time being far, far shorter in groups that allow
binary attachments such as images. GigaNews, for instance, retains messages
in "binaries" groups for 200 days, and text-only messages for $DEITY knows
how long - I've found seven-year-old messages in some groups.

The switch to a rich-text + graphics medium would require a lot of work by
a lot of people, and would increase storage requirements, decrease the time
that messages are retained on local servers, or both. It's really rather
hard to justify that time & expense when the web is sitting right next door
with all the multimedia one can handle. :-)

sherm--

-- 
My blog: http://shermspace.blogspot.com
Cocoa programming in Perl: http://camelbones.sourceforge.net


------------------------------

Date: Sun, 11 May 2008 15:24:03 +0200
From: "Peter J. Holzer" <hjp-usenet2@hjp.at>
Subject: Re: Perl DBI Module: SQL query where there is space in field name
Message-Id: <slrng2dsrm.v9m.hjp-usenet2@hrunkner.hjp.at>

On 2008-05-10 09:18, Martijn Lievaart <m@rtij.nl.invlalid> wrote:
> On Fri, 09 May 2008 09:48:56 -0700, szr wrote:
>
>> Achim Peters wrote:
>>> Andrew DeFaria schrieb:
>>>> Jürgen Exner wrote:
>>>>> And you honestly believe your 120+ lines long signature (quoted in
>>>>> full below)
>>>> Looks like somebody needs to learn what a signature is...
>>>
>>>> --------------030103090100010400060503 Content-Type: text/html;
>>>> charset=ISO-8859-1 Content-Transfer-Encoding: 7bit
>>>>
>>>> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html>
>>>
>>> Please stop posting HTML and/or MIME. TIA!
>> 
>> It's a multiple format posting; one section for html and one for plain
>> text. If I set my reader to use plain-text only, I don't see html, just
>> the plain text version. Can your reader not be configured similarly? If
>> you only wish to see plain text then set your reader to display only
>> plain text and then you wont have a problem.
>
> Well, there is this slight problem of standards, encoded into RFCs. You 
> don't /have/ to follow them, but it's in general a good idea.

The relevant RFC in this case would be RFC 2046. As fas as I can see
Andrew did follow the RFC.

> HTML in usenet postings is definitely not standard and in fact, any
> serious newsreader (on any platform, even on Windows) does not render
> it. Even worse, mime-multipart, although a standard for mail, is not a
> standard for usenet.

You are mixing up technical standards and social standards. RFC
1036 refers to RFC 822 for the article format which has later been
extended by the series of MIME RFCs (starting with RFC 1341 in
1992). Now one could argue that since 1341 came after 1036 and 1036 was
never revised, 1341 is irrelevant - only plain text US-ASCII is allowed
in usenet messages. However, that is clearly not practical - Usenet is
used for discussions in many languages, most of which cannot be
expressed adequately in US-ASCII. Even if the discussion language is
English, the topic of the discussion (for example, how to process
Chinese text in a Perl program) may require another character set. And
there is absolutely no RFC or other authoritative document which says
that MIME Content-Type is ok for Usenet and MIME multipart is not.
Technically, you have to accept MIME as a whole or not at all.

However, there is a strong *convention* that Usenet messages (outside of
the binary groups) should contain only plain text. No images, no fancy
markup, no sound files, no video. That's a social convention, not a
technical one. Of course, newsreader authors often only implement
features for which they see a need - so if nobody posts multipart
messages, why should they implement support for them? (the newsreader you
use - Pan - seems to be quite curious in supporting multipart/mixed, but
not multipart/alternative).

	hp


------------------------------

Date: Sun, 11 May 2008 15:34:18 +0200
From: "Peter J. Holzer" <hjp-usenet2@hjp.at>
Subject: Re: Perl DBI Module: SQL query where there is space in field name
Message-Id: <slrng2dter.v9m.hjp-usenet2@hrunkner.hjp.at>

On 2008-05-11 00:10, Martijn Lievaart <m@rtij.nl.invlalid> wrote:
> On Sat, 10 May 2008 09:43:15 -0700, szr wrote:
>>> Any serious newsreader does not do mime-multipart.
>> 
>> This would seem to be the opposite from what I've seen. All the major
>> graphical ones (at least for Windows) to handle it, and they all allow
>> you to specify which format should take precedence. I have that set to
>> "plain", so I don't actually see the HTML part of a multipart posting
>> :-)
>
> I haven't "done" Windows for ages, but I used to use Xnews, which 
> definately did not do mime-multipart. I'ld be very surprised if anything 
> besides Outlook and possibly Mozilla and friends do mime-multipart.

On Linux, Mozilla and KNode have decent multipart support. Pan has
partial support. I'm quite sure that GNUS has good multipart support,
but since I don't like Emacs, I've never tried it. There is a patch for
slrn, but since nobody I consider worth reading is posting multipart
messages, I haven't tried that, either. I don't know about the other
text-based readers (tin, trn, ...).

	hp


------------------------------

Date: Sun, 11 May 2008 13:44:52 -0400
From: Sherman Pendley <spamtrap@dot-app.org>
Subject: Re: Perl DBI Module: SQL query where there is space in field name
Message-Id: <m17ie0zqej.fsf@dot-app.org>

"Waylen Gumbal" <wgumgfy@gmail.com> writes:

> A. Sinan Unur wrote:
>
>> Nope. Post plain text in text only groups.
>
> Right. But let me pose this; In the 1980's and even in the 90's, this 
> was the way things were done, and a lot of it was for technical reasons, 
> right? Do those reasons still really exist?

No, but the relevant standards are still at that level. If you disagree
with that, then by all means go through the relevant steps to update them.
You'll probably find a lot of people who agree with you.

> in a medium such as UseNet ? Any modern news reader should be able to 
> easily handle multipart messages

Where are the standards that specify how a compliant news reader is required
to handle multipart messages? Without such standards, goals such as this,
as sensible as they are in principle, are very difficult to implement.

> A good tool should be able to, at the very least, deal 
> with such posts as a user sees fit.

Some tools deal with them one way, some another; some people see his sig,
some don't. And, because there's no relevant standard to which anyone can
point and say "*that* is how it's done people, get it together!" there's
no basis on which to claim that one way or another is wrong.

If there were a serious proposition made to write a new RFC defining how
multipart/alternative messages were to be handled, I'd be all for it. But
for now, in the absence of such a standard, the polite thing to do IMHO
is to refrain from posting what many will see as gibberish.

sherm--

-- 
My blog: http://shermspace.blogspot.com
Cocoa programming in Perl: http://camelbones.sourceforge.net


------------------------------

Date: Sun, 11 May 2008 15:47:18 -0400
From: Charlton Wilbur <cwilbur@chromatico.net>
Subject: Re: Perl DBI Module: SQL query where there is space in field name
Message-Id: <867ie08vy1.fsf@mithril.chromatico.net>

>>>>> "SP" == Sherman Pendley <spamtrap@dot-app.org> writes:

    SP> If there were a serious proposition made to write a new RFC
    SP> defining how multipart/alternative messages were to be handled,
    SP> I'd be all for it. But for now, in the absence of such a
    SP> standard, the polite thing to do IMHO is to refrain from posting
    SP> what many will see as gibberish.

It has been my observation for some time that people who insist on
posting in a gibberish format are very likely to post gibberish
content.  So it is with Mr DeFaria: the content of his posts is not
worth reading, and my newsreader plonks text/plain and
multipart/alternative with equal facility.

Charlton


-- 
Charlton Wilbur
cwilbur@chromatico.net


------------------------------

Date: Sun, 11 May 2008 12:38:31 +0000 (UTC)
From: Ben Bullock <benkasminbullock@gmail.com>
Subject: Re: regex problem unresolved
Message-Id: <g06pc7$111$4@ml.accsnet.ne.jp>

On Sun, 11 May 2008 03:13:40 +0000, Jürgen Exner wrote:

> Ben Bullock <benkasminbullock@gmail.com> wrote:

>>What you need to do is to use \Q \E around the string which is causing
>>the problems.

> Actually I respectfully disagree. If the OP wants to compare two strings
> then index() or even a simple 'eq' is the tool of choice.

Well, the thing is that we actually don't know what the original poster's 
code is doing anyway. His main problem seemed to finding the line of code 
where the problem occurred, rather than the "comparing two strings" part.

> Using the \Q...\E method will work, but it is like filing the fin of a
> hammer to fit a Philips screw head because you realized that pounding in
> the screw doesn't work and you don't know how to use a screw drivers

OK, but my \Q \E solution has one merit: it minimizes the editing of the 
program source, and hence minimizes the debugging work for Ela, who 
already seems fairly confused (didn't understand abour regex and index, 
etc.). That was the reason I chose it.


------------------------------

Date: Sun, 11 May 2008 12:11:37 +0200
From: "Peter J. Holzer" <hjp-usenet2@hjp.at>
Subject: Re: retrieve info from searching site
Message-Id: <slrng2dhiq.v9m.hjp-usenet2@hrunkner.hjp.at>

On 2008-05-06 15:24, batman <uspensky@gmail.com> wrote:
[problem description snipped]
> im familiar with programming but never done any perl before-
> anybody have an idea?

Just curious: If you are familiar with programming but never have used
Perl before, why do you want to do this in Perl? Why don't you use a
programming language you already know?

	hp


------------------------------

Date: Sun, 11 May 2008 16:17:21 +0200
From: "Peter J. Holzer" <hjp-usenet2@hjp.at>
Subject: Re: state of Erlang?
Message-Id: <slrng2dvvj.v9m.hjp-usenet2@hrunkner.hjp.at>

On 2008-05-09 13:01, cartercc <cartercc@gmail.com> wrote:
> On May 9, 4:25 am, bugbear <bugbear@trim_papermule.co.uk_trim> wrote:
>> >  Does a language need some sort of critical mass
>> > before it collects a big following?
>>
>> Yes.
>
> In this case, how do you measure the critical mass? Compare Pascal,
> which had a good run in the academic community but never escaped the
> ivyed walls, with Ada which should have had a critical mass in the
> military-industrial complex but somehow never made it into the
> mainstream.
>
> On the other hand, you have languages like C, Perl, Python, and Ruby
> that had their starts in backrooms but have generated (at least!) a
> lot more buzz than Pascal or Ada. What's the difference between a
> language that starts off with a large in-built mass that falls by the
> wayside, and a language that starts off with nothing but generates a
> respectfull presence in the market?

A few ideas:

* Readily available implementations:
  Open source interpreted languages like Perl, Python, and Ruby are
  available on all platforms. C was (in the beginning) a very simple
  language and was rapidly ported to all sorts of platforms. There was
  no Pascal or Modula or Ada compiler available for the unix systems we
  had when I was a student.

* An existing code base:
  Unix and all its utilities were written in C. A unix programmer had to
  learn C. Much open source software was developed on unix systems and
  therefore written in C. Obviously a new language can never have an
  existing code base, but can rapidly get one: Look at JavaScript or
  PHP.

* Portability:
  Perl or C code is reasonably portable. You can write a C or Perl
  program on one platform in such a way that it will require no or only
  little effort to get it to run on another platform. Pascal had a
  gazillion incompatible dialects, and there the target system probably
  didn't have a Pascal compiler at all.

* Hype:
  Sun and Netscape were hyping Java. Java didn't really deliver what Sun
  promised, but everybody believed it was the future: So lots of
  applications were (re)written in Java, Frameworks were developed,
  Universities switched their introductory programming courses to Java,
  etc. And then Java was the future, or already the present. 

  	hp


------------------------------

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 1532
***************************************


home help back first fref pref prev next nref lref last post