[24357] in Perl-Users-Digest
Perl-Users Digest, Issue: 6546 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun May 9 21:06:11 2004
Date: Sun, 9 May 2004 18:05:07 -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, 9 May 2004 Volume: 10 Number: 6546
Today's topics:
Re: is there something more elegant to convert Dos to u <tadmc@augustmail.com>
Palm Warez Francophone (LePerisprit)
Parse::RecDescent: special treatment for keywords (A. Farber)
Re: Permission denied with PERL/APACHE <tadmc@augustmail.com>
Re: Printing Array's content with carriage return (\n) (David Efflandt)
Re: Printing Array's content with carriage return (\n) <lv@aol.com>
Re: Printing Array's content with carriage return (\n) <uri@stemsystems.com>
Re: Printing PDF directly from Perl Win2000, Perl 5.8 <nakroshis@NOICKYSPAMsmart.net>
rapid development web interface to a database carloschoenberg@yahoo.com
Re: rapid development web interface to a database <the_greenes@comcast.net>
Re: Regular expression questions <abigail@abigail.nl>
Re: Spreadsheet::WriteExcel <sean_berry@cox.net>
Re: Spreadsheet::WriteExcel <sean_berry@cox.net>
Re: Spreadsheet::WriteExcel <sean_berry@cox.net>
Re: Spreadsheet::WriteExcel <sean_berry@cox.net>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sun, 9 May 2004 17:12:25 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: is there something more elegant to convert Dos to unix in subroutine?
Message-Id: <slrnc9tb69.u7l.tadmc@magna.augustmail.com>
Andrew <myfam@surfeu.fi> wrote:
> thanks for help though...
>
> Uri Guttman <uri@stemsystems.com> wrote in message news:<x7fzaasrub.fsf@mail.sysarch.com>...
>> stop top posting. no more help until you learn this.
So long then.
*plonk*
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: 9 May 2004 16:15:00 -0700
From: leperisprit@yahoo.ca (LePerisprit)
Subject: Palm Warez Francophone
Message-Id: <eafc5291.0405091515.59cade87@posting.google.com>
Un nouveau site pour PALM francophone.... Tout les softs, des trucs et
astuces... et + encore
http://www.leperisprit.fr.st
Le Perisprit
p.s n'hésitez pas à faire vos demandes par couriel...
------------------------------
Date: 9 May 2004 11:48:17 -0700
From: Alexander.Farber@t-online.de (A. Farber)
Subject: Parse::RecDescent: special treatment for keywords
Message-Id: <c9ccaf83.0405091048.75ebacc8@posting.google.com>
Hi,
I'm trying to parse this kind of texts:
TARGET Snake.app
TARGETTYPE app
UID 0x100079be 0x103F5BE8
TARGETPATH \system\apps\Snake
SOURCEPATH ..\UiSrc
SOURCE CSApplication.cpp CSAppUI.cpp CSDocument.cpp
CSView.cpp CSViewControl.cpp CSSettingsDialog.cpp
SOURCE CSHighScoreDialog.cpp CSKeyboardReader.cpp
CSGameDrawer.cpp CSPauseNoteDialog.cpp
CSHighscoreStore.cpp CSPlayDialog.cpp
CSHelpDialog.cpp
SOURCE CSConnectionNoteDialog.cpp
CSAsyncWait.cpp // added 13.02.2004
CSGameOverNoteDialog.cpp // added 24.7.2001
SOURCE ..\audiosrc\CSoundBank.cpp CdBitmapManager.cpp
DOCUMENT ..\group\Snake.loc
by the following grammar:
startrule: comment(s) | directive(s)
comment: m{//[^\\n]*}
directive: keyword value(s)
{ print "KEYWORD: $item{keyword}\n" }
value: file | type | uid
file: m{[\\w\\\\/.-]+}
type: 'app' | 'dll'
uid: /0[xX][0-9a-fA-F]+/
keyword:
'AIF' |
'DOCUMENT' |
'LANG' |
'LIBRARY' |
'RESOURCE' |
'SOURCE' |
'SOURCEPATH' |
'SYSTEMINCLUDE' |
'TARGET' |
'TARGETPATH' |
'TARGETTYPE' |
'UID' |
'USERINCLUDE'
But only get the single line printed out:
KEYWORD: TARGET
Probably because the very first line is being
parsed as the "keyword" TARGET with all the rest
words in the file being parsed as "value"s.
I've tried to change the last rule in my grammar to
a set of regexes (which has uglified it as well):
keyword:
/^\s*AIF/ |
/^\s*DOCUMENT/ |
/^\s*LANG/ |
/^\s*LIBRARY/ |
/^\s*RESOURCE/ |
/^\s*SOURCE/ |
/^\s*SOURCEPATH/ |
/^\s*SYSTEMINCLUDE/ |
/^\s*TARGET/ |
/^\s*TARGETPATH/ |
/^\s*TARGETTYPE/ |
/^\s*UID/ |
/^\s*USERINCLUDE/
But the problem persists. I wonder if there is a
nice way to solve this (probably frequent) problem?
I.e. I'd like the words matching the keyword list
above to be parsed as "keyword", not as "value" -
provided they are found at a beginning of a line.
Thank you for any suggestions
Alex
PS: Also, is there a way to make the grammar
case-insensitive, without using /regexes/i
(since that would make my grammar less readable)?
------------------------------
Date: Sun, 9 May 2004 17:17:58 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Permission denied with PERL/APACHE
Message-Id: <slrnc9tbgm.u7l.tadmc@magna.augustmail.com>
Nicolas D <nico99@netcourrier.com> wrote:
> I use a PERLscript lauched by Apache web server,
What is a "PERLscript"?
Did you mean "Perl script" or "Perlscript"instead?
> with the line
> "open (FICH, '>>commandes.txt') || die " error: :$!";
>
> i obtain the following line in my error.log:
> "permission denied
>
> i tried to change the rights but with no results.
>
> what is the pb ?
^^
^^
What is the Peanut Butter? Your question makes no sense to me...
Your problem is that you do not have the required permissions, what else?
You don't tell us what OS you are using, but if it is a *nix-flavor
one, you may need to change the permisssions on the directory that
the file is in, rather than the permissions on the file itself...
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Sun, 9 May 2004 20:50:04 +0000 (UTC)
From: efflandt@xnet.com (David Efflandt)
Subject: Re: Printing Array's content with carriage return (\n)
Message-Id: <slrnc9t6br.48v.efflandt@typhoon.xnet.com>
On Sun, 09 May 2004, Edward Wijaya <ewijaya@singnet.com.sg> wrote:
> If I have an array: @myarray = (ab, bc, cd, ...)
>
> currently if I use the print command directly like this:
>
> print "@myarray\n";
>
> it returns:
> ab bc cd ....
>
> is there anyway I can tweak the print command?
> so that it gives
>
> ab
> bc
> cd
> ...
>
> Namely, it print out in vertical forms.
If you want to print like that, but NOT insert newlines in your data, it
may be better to simply:
foreach (@myarray) { print "$_\n"; }
--
David Efflandt - All spam ignored http://www.de-srv.com/
------------------------------
Date: Sun, 09 May 2004 18:47:13 -0500
From: l v <lv@aol.com>
Subject: Re: Printing Array's content with carriage return (\n)
Message-Id: <409ec341$1_1@corp.newsgroups.com>
Edward Wijaya wrote:
> Hi,
>
> If I have an array: @myarray = (ab, bc, cd, ...)
>
> currently if I use the print command directly like this:
>
> print "@myarray\n";
>
> it returns:
> ab bc cd ....
>
> is there anyway I can tweak the print command?
> so that it gives
>
> ab
> bc
> cd
> ...
>
> Namely, it print out in vertical forms.
>
> Thanks so much for your time
>
> Regards
> Edward WIJAYA
> SINGAPORE
>
I usually use with preference on #2:
print map {"$_\n"} @myarray;
or
map {print "$_\n"} @myarray;
Len
-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 100,000 Newsgroups - 19 Different Servers! =-----
------------------------------
Date: Sun, 09 May 2004 23:56:41 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: Printing Array's content with carriage return (\n)
Message-Id: <x7u0ypp32f.fsf@mail.sysarch.com>
>>>>> "lv" == l v <lv@aol.com> writes:
lv> I usually use with preference on #2:
lv> print map {"$_\n"} @myarray;
often i do that with some common variations
lv> or
lv> map {print "$_\n"} @myarray;
alert! map in void context! (hush abigail!).
anyhow try benchmarking those two. i will wager that the former is much
faster than the latter. this segues right into my rule about printing:
print rarely, print late.
uri
--
Uri Guttman ------ uri@stemsystems.com -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs ---------------------------- http://jobs.perl.org
------------------------------
Date: Sun, 09 May 2004 23:18:57 -0000
From: Rick Nakroshis <nakroshis@NOICKYSPAMsmart.net>
Subject: Re: Printing PDF directly from Perl Win2000, Perl 5.8
Message-Id: <Xns94E4C47BCE267ricknak@216.168.3.44>
junk@dlink.org (Aqua) wrote in news:55d7995c.0404290929.541128b4
@posting.google.com:
> I am very new to Windows based Perl. Is there any way to print a PDF
> (or a DOC) from a windows Perl Script. I appreciate any samples.
>
> I cannot buy any products at this moment.
If you want to print pre-existing PDF files under Windows, then the easiest
was is to do a system call to Adobe Acrobat Reader. You should be able to
find everything you need to know about printing from the command line on
Adobe's website.
Rick
------------------------------
Date: 9 May 2004 14:41:35 -0700
From: carloschoenberg@yahoo.com
Subject: rapid development web interface to a database
Message-Id: <8c526b62.0405091341.784cdea5@posting.google.com>
I am looking for the easiest web interface to a database. By easiest,
I mean most rapid development. Because the requirements are so simple
and standard, I'm hoping that something can take care of the grunt
work. Easy maintenance, possibly by non-programmers (or at least
"junior" programmers) would also be nice.
I'm open to Perl, PHP, Java in that order (best solution wins, equal
solutions go with the preferred language). I'm also open to anything
that doesn't require code to be written to get the job done, as long
as there's some way to extend it if I get stuck.
The design is simple and is an age-old story:
I have a database with about 15 tables. 5 contain data with the same
primary key, 2 have their own primary key but still a 1-to-1 mapping
to the "main" primary key, and 8 are master lists that the other
tables reference (site id, customer id, that sort of thing). I need
the following screens:
simple search based on a couple fields
advanced search based on most available fields
search results simple display, showing a reasonable set of fields
search results advanced display, showing large or configurable set of
fields
simple display, showing most commonly desired fields
advanced display, showing all data
add new record simple, requesting most commonly entered fields
add new record advanced, allowing all fields to be manipulated
edit existing record simple
edit existing record advanced
editing for each of the 'master' tables
All edit/add screens need pulldowns for master lists allowing one to
be selected, search screens need pulldowns allowing multiple to be
selected. The user should not be burdened by the underlying layout of
thed tabase.
I want something to do most of the grunt work of:
all the CGI stuff, of course
authentication and maintaining the session
building the forms. ugly is ok as long as it's usable. optional
templating would be nice.
working with the database
After everything is done modifying the interface to accomidate a new
table or new column in an existing table should be trivial.
I appreciate any advice about the most efficient way to develop such
systems.
------------------------------
Date: Sun, 9 May 2004 18:59:41 -0400
From: "Eljon Greene" <the_greenes@comcast.net>
Subject: Re: rapid development web interface to a database
Message-Id: <992dnR-wN8N-KgPdRVn-gg@comcast.com>
One of the most popular in the open source community for MySQL databases is
PHPMyAdmin (http://www.phpmyadmin.net/home_page/).
........................................................
Eljon Greene
formGenie - E-Documents Simplified
E-mail: egreene@form-genie.com
Website: www.form-genie.com
.....................................................
<carloschoenberg@yahoo.com> wrote in message
news:8c526b62.0405091341.784cdea5@posting.google.com...
> I am looking for the easiest web interface to a database. By easiest,
> I mean most rapid development. Because the requirements are so simple
> and standard, I'm hoping that something can take care of the grunt
> work. Easy maintenance, possibly by non-programmers (or at least
> "junior" programmers) would also be nice.
>
> I'm open to Perl, PHP, Java in that order (best solution wins, equal
> solutions go with the preferred language). I'm also open to anything
> that doesn't require code to be written to get the job done, as long
> as there's some way to extend it if I get stuck.
>
> The design is simple and is an age-old story:
> I have a database with about 15 tables. 5 contain data with the same
> primary key, 2 have their own primary key but still a 1-to-1 mapping
> to the "main" primary key, and 8 are master lists that the other
> tables reference (site id, customer id, that sort of thing). I need
> the following screens:
> simple search based on a couple fields
> advanced search based on most available fields
> search results simple display, showing a reasonable set of fields
> search results advanced display, showing large or configurable set of
> fields
> simple display, showing most commonly desired fields
> advanced display, showing all data
> add new record simple, requesting most commonly entered fields
> add new record advanced, allowing all fields to be manipulated
> edit existing record simple
> edit existing record advanced
> editing for each of the 'master' tables
>
> All edit/add screens need pulldowns for master lists allowing one to
> be selected, search screens need pulldowns allowing multiple to be
> selected. The user should not be burdened by the underlying layout of
> thed tabase.
>
> I want something to do most of the grunt work of:
> all the CGI stuff, of course
> authentication and maintaining the session
> building the forms. ugly is ok as long as it's usable. optional
> templating would be nice.
> working with the database
>
> After everything is done modifying the interface to accomidate a new
> table or new column in an existing table should be trivial.
>
> I appreciate any advice about the most efficient way to develop such
> systems.
------------------------------
Date: 09 May 2004 18:38:03 GMT
From: Abigail <abigail@abigail.nl>
Subject: Re: Regular expression questions
Message-Id: <slrnc9sukb.4ga.abigail@alexandra.abigail.nl>
Anno Siegel (anno4000@lublin.zrz.tu-berlin.de) wrote on MMMCMIV September
MCMXCIII in <URL:news:c7lajg$711$2@mamenchi.zrz.TU-Berlin.DE>:
() Abigail <abigail@abigail.nl> wrote in comp.lang.perl.misc:
() > Hung Truong (skyfaye@yahoo.com) wrote on MMMCMIII September MCMXCIII in
() > <URL:news:805c863b.0405071735.1561e4b2@posting.google.com>:
()
() [...]
()
() > :) 2) have an even number of 'a's
() >
() >
() > I wouldn't use a regex for that.
() >
() > print "Even number of 'a's\n" unless y/a/a/c;
()
() Hmm?
()
() Scalar y/a/a/c counts the number of non-a's, so that identifies strings
() of a's only.
Yeah, what I meant was:
print "Even number of 'a's\n" unless y/a/a/ % 2;
Abigail
--
$_ = "\x3C\x3C\x45\x4F\x54"; s/<<EOT/<<EOT/e; print;
Just another Perl Hacker
EOT
------------------------------
Date: Sun, 9 May 2004 11:51:31 -0700
From: "Sean Berry" <sean_berry@cox.net>
Subject: Re: Spreadsheet::WriteExcel
Message-Id: <r4vnc.99394$Jy3.67478@fed1read03>
I don't think this is my problem. I am not parsing an XML file. Here is
the code in question.
----------------start code---------------------
#!/usr/bin/perl -w
use strict;
use Spreadsheet::ParseExcel::SaveParser;
my $parser = new Spreadsheet::ParseExcel::SaveParser;
my $template = $parser->Parse('summary.xls');
my $sheet = 0;
my $row = 3;
my $col = 1;
my $format =
$template->{Worksheet}[$sheet]->{Cells}[$row][$col]->{FormatNo};
$template->AddCell(0, $row, $col, "=SUM(C4:N4)", $format);
$col += 1;
## Add values to columns 1-6 and rows 3-16
while ($col < 7) {
while ($row < 16) {
$template->AddCell(0, $row, $col, "505", $format);
$row += 1;
}
$row = 3;
$col += 1;
}
## Add single cell value for testing. < Works...
$template->AddCell(0, 9, 7, "606", $format);
$workbook = $template->SaveAs('book1.xls');
-----------------end code----------------------------
If I change to line "while ($col < 7)" to any number higher than 7 I get the
error.
Later, when I get this code to work, I will be parsing a tab delimited txt
file and
adding the data from that file to this formatted excel spreadsheet.
Any help is appreciated a great deal. I am trying to get this project done
by this
Tuesday so that I can start automating this task.
Thanks.
"John McNamara" <jmcnamara@cpan.org> wrote in message
news:8cceb2da.0405082247.569d5a79@posting.google.com...
> Sean Berry wrote:
>
> > If I ever try to write past the 8th column, the xls file becomes
corrupted
> > and will not open. I can fill cells in columns up to 8, but as soon as
I
> > try to add a cell to column 8, whamo.
>
> This type of problem usually indicates that utf8 strings are being
> written to the file. This causes some other internal strings to be
> coerced to utf8 and thus the binary data get corrupted.
>
> See the "Working with XML" section of the Spreadsheet::WriteExcel
> docs:
>
>
http://search.cpan.org/~jmcnamara/Spreadsheet-WriteExcel/WriteExcel.pm#WORKING_WITH_XML
>
> Let me know if this isn't the cause of the problem.
>
> John.
> --
------------------------------
Date: Sun, 9 May 2004 12:51:02 -0700
From: "Sean Berry" <sean_berry@cox.net>
Subject: Re: Spreadsheet::WriteExcel
Message-Id: <gYvnc.99454$Jy3.3553@fed1read03>
Apparently this has to do with the formatting of my existing excel file.
I removed all of the colors and other formatting from the spreadsheet and it
works no problem. Any known issues about some excel formatting options?
Would it be more reasonable to parse a file and write to a new file instead
using
Spreadsheet::WriteExcel and SpreadSheet::ParseExcel?
"John McNamara" <jmcnamara@cpan.org> wrote in message
news:8cceb2da.0405082247.569d5a79@posting.google.com...
> Sean Berry wrote:
>
> > If I ever try to write past the 8th column, the xls file becomes
corrupted
> > and will not open. I can fill cells in columns up to 8, but as soon as
I
> > try to add a cell to column 8, whamo.
>
> This type of problem usually indicates that utf8 strings are being
> written to the file. This causes some other internal strings to be
> coerced to utf8 and thus the binary data get corrupted.
>
> See the "Working with XML" section of the Spreadsheet::WriteExcel
> docs:
>
>
http://search.cpan.org/~jmcnamara/Spreadsheet-WriteExcel/WriteExcel.pm#WORKING_WITH_XML
>
> Let me know if this isn't the cause of the problem.
>
> John.
> --
------------------------------
Date: Sun, 9 May 2004 13:27:09 -0700
From: "Sean Berry" <sean_berry@cox.net>
Subject: Re: Spreadsheet::WriteExcel
Message-Id: <4uwnc.99458$Jy3.57290@fed1read03>
I reformatted the xls file starting with a brand new spreadsheet and making
it the exact same as what I had before, and it works with no errors. The
only problem now, not really a problem, is that it messes up the text
allignment within the cells. Some things are left justified, others are
right...
Any ideas here?
TIA
"John McNamara" <jmcnamara@cpan.org> wrote in message
news:8cceb2da.0405082247.569d5a79@posting.google.com...
> Sean Berry wrote:
>
> > If I ever try to write past the 8th column, the xls file becomes
corrupted
> > and will not open. I can fill cells in columns up to 8, but as soon as
I
> > try to add a cell to column 8, whamo.
>
> This type of problem usually indicates that utf8 strings are being
> written to the file. This causes some other internal strings to be
> coerced to utf8 and thus the binary data get corrupted.
>
> See the "Working with XML" section of the Spreadsheet::WriteExcel
> docs:
>
>
http://search.cpan.org/~jmcnamara/Spreadsheet-WriteExcel/WriteExcel.pm#WORKING_WITH_XML
>
> Let me know if this isn't the cause of the problem.
>
> John.
> --
------------------------------
Date: Sun, 9 May 2004 13:35:47 -0700
From: "Sean Berry" <sean_berry@cox.net>
Subject: Re: Spreadsheet::WriteExcel
Message-Id: <aCwnc.99459$Jy3.10697@fed1read03>
Error in my original post... not xml file... XLS file.
Sorry
"Sean Berry" <sean_berry@cox.net> wrote in message
news:ODWmc.85741$Jy3.46975@fed1read03...
> Is there a way of opening a preformatted excel file, then write to empty
> cells in the table.
>
> I have a table with various formulas, cell and text colors, borders, etc.
> But, the data is in a 28 x 170 sized chunk of the sheet. This will be a
big
> pain to code so I was looking for a shortcut.
>
> Is is possible to parse the .xml file and use the values within instead of
> just the data?
>
> TIA
>
>
------------------------------
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 V10 Issue 6546
***************************************