[11903] in Perl-Users-Digest
Perl-Users Digest, Issue: 5503 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Apr 28 07:07:31 1999
Date: Wed, 28 Apr 99 04:00:25 -0700
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, 28 Apr 1999 Volume: 8 Number: 5503
Today's topics:
Re: "learning perl" does not seem to be written well (Bart Lateur)
Re: "learning perl" does not seem to be written well cindycrawford@my-dejanews.com
Confused about s/// example in the Camel book <bdp@mutagenic.org>
Re: Confused about s/// example in the Camel book (Sam Holden)
Re: Confused about s/// example in the Camel book <garethr@cre.canon.co.uk>
CPU Cycles (was Re: FAQ 4.68: How do I handle binary da (Randal L. Schwartz)
FREE registration for web designers <a.carson@ndirect.co.ukNOSPAM>
Re: GIF in web page (Andrea L. Spinelli)
Re: Help:How to find Pixel size of an uploaded image us <nospam.newton@gmx.net>
Re: How do i print something using perl? <nospam.newton@gmx.net>
Re: Impythonating PERL? (Damian Conway)
Is there a command-line Usenet newsreader available? <bkn3@columbia.edu>
Re: Is there a command-line Usenet newsreader available <ebohlman@netcom.com>
Re: Is there a command-line Usenet newsreader available (Sam Holden)
Re: Multiline comments in perl <nospam.newton@gmx.net>
Re: Not another Editor question?! Yes, but this one's d <ronald_f@my-dejanews.com>
PERL & Y2K <davevans69@hormail.com>
Re: PERL & Y2K (Sam Holden)
Re: Perl and Y2K <wyzelli@yahoo.com>
Re: Perl and Y2K (Bart Lateur)
Re: Perl Editor... <p.brouwer@prevalent.nl>
Re: Perl newbie, please don't send me to ascii purgator <nospam.newton@gmx.net>
Perl question. (Austin Ming)
Problem with DBV::CSV smnayeem@my-dejanews.com
Site seach engine <pleyer@kraftwerk.co.at>
Re: stupid single quote " wipes out REST OF TEXT (Bart Lateur)
Re: stupid single quote " wipes out REST OF TEXT (Andrea L. Spinelli)
Urgent help needed - using DBI and DBD:mSQL when I CANT (Neil Jedrzejewski)
Re: using Find::file inside a sub-routine ..? <ebohlman@netcom.com>
Re: What does this error message mean? <vvb@ibm.net>
Re: What is wrong with this picture? <mkshanx@ust.hk>
Re: what's wrong with $x = $y or "" <nospam.newton@gmx.net>
Re: When uploading files how do I count the characters <crb@highpoint.co.uk>
Where can I get MAKE michielpeene@my-dejanews.com
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 28 Apr 1999 08:29:50 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: "learning perl" does not seem to be written well
Message-Id: <3726bce9.979532@news.skynet.be>
David Cassell wrote:
>But the interface is not as consistent as Python.
>That matters a lot for some people.
To paraphrase Larry Wall: English is not a consistent language. So,
apparently, consistency is NOT how the ordinary human brain works.
Larry wanted a flexible syntax for the statements, and pick one for each
statement that best reflects the problems you're trying to tackle.
Bart.
------------------------------
Date: Wed, 28 Apr 1999 09:22:40 GMT
From: cindycrawford@my-dejanews.com
Subject: Re: "learning perl" does not seem to be written well
Message-Id: <7g6k0t$mfn$1@nnrp1.dejanews.com>
well sometimes shit hapends.:)) but don't give up
I was in the same situation year ago but now..
cindy
http://cgi-shop.com
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Wed, 28 Apr 1999 03:01:25 -0600
From: Brian Peisley <bdp@mutagenic.org>
Subject: Confused about s/// example in the Camel book
Message-Id: <3726CE65.5A679AEC@mutagenic.org>
I am confused about an example of s/// on page 74 of the Camel book (2nd
ed.).
The example is as follows:
#expand tabs to 8-column spacing
s/\t+/' ' x (length($&)*8) - length($`)%8/e;
I understand what this is doing, I just don't understand why
length($`)%8 is being subtracted. I wrote the simple script below to see
what this does and then I took out the length($`)%8 part to see what the
difference was, but the output was them same. tab.txt is just a text
file with varying numbers of tabs on each line, I trust you can make one
up for yourself if you want to run this. :-)
#!/usr/bin/perl -w
use strict;
open (TABFILE, "/home/brian/bin/tab.txt") || die "Could not open file:
$!";
while (<TABFILE>) {
s/\t+/'T' x (length($&)*8 - length($`)%8)/e;
print;
};
If somebody could explain why that is there I would greatly appreciate
it.
Thanks,
Brian Peisley
bdp@mutagenic.org
------------------------------
Date: 28 Apr 1999 10:24:52 GMT
From: sholden@pgrad.cs.usyd.edu.au (Sam Holden)
Subject: Re: Confused about s/// example in the Camel book
Message-Id: <slrn7idofk.42r.sholden@pgrad.cs.usyd.edu.au>
On Wed, 28 Apr 1999 03:01:25 -0600, Brian Peisley <bdp@mutagenic.org> wrote:
>I am confused about an example of s/// on page 74 of the Camel book (2nd
>ed.).
>
>The example is as follows:
>
>#expand tabs to 8-column spacing
>s/\t+/' ' x (length($&)*8) - length($`)%8/e;
>
>I understand what this is doing, I just don't understand why
>length($`)%8 is being subtracted.
It handles cases where the tabs aren't at the start of the line....
"fred\tfred" should become "fred fred" with four spaces not eight.
That's how tabs work after all.
--
Sam
I took the initiative in creating the Internet.
--Al Gore
------------------------------
Date: Wed, 28 Apr 1999 10:23:30 GMT
From: Gareth Rees <garethr@cre.canon.co.uk>
To: Brian Peisley <bdp@mutagenic.org>
Subject: Re: Confused about s/// example in the Camel book
Message-Id: <sizp3t2gd9.fsf@cre.canon.co.uk>
Brian Peisley <bdp@mutagenic.org> wrote:
> I am confused about an example of s/// on page 74 of the Camel book (2nd
> edition). The example is as follows:
>
> # expand tabs to 8-column spacing
> s/\t+/' ' x (length($&)*8) - length($`)%8/e;
>
> I understand what this is doing, I just don't understand why
> length($`)%8 is being subtracted.
The tab characters might not all be at the left margin. For example,
your text might look like this (with a single tab on each line, between
the two numbers).
1 23456
12 3456
123 456
1234 56
12345 6
The tab on the line 1 must be changed to 7 spaces, that on line 2 to 6
spaces, and so on.
--
Gareth Rees
------------------------------
Date: 28 Apr 1999 03:40:31 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: CPU Cycles (was Re: FAQ 4.68: How do I handle binary data correctly?)
Message-Id: <m1eml5ni3k.fsf_-_@halfdome.holdit.com>
>>>>> "Larry" == Larry Rosler <lr@hpl.hp.com> writes:
Larry> Christiansen <perlfaq-suggestions@perl.com> says...
Larry> ...
>> On some legacy systems
Larry> which now operate perhaps 95% of the world's computers...
But aren't burning 95% of the CPU cycles.
I'd dare make a bold statement that there are more CPU cycles burning
inside Unix and its variants than any other O/S family now.
Especially if you factor out event-idle-loops in GUIs. :)
print "Just another Perl hacker,"
--
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@teleport.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me
------------------------------
Date: Wed, 28 Apr 1999 10:37:51 +0100
From: "afid.net" <a.carson@ndirect.co.ukNOSPAM>
Subject: FREE registration for web designers
Message-Id: <3726ca50.0@news.netdirect.net.uk>
Announcing a new and free registration service for all web designers. A
fully searchable online database for designers looking for work and for
employers looking for designers.
This free service is now available at
http://www.afid.net
Designers - list your skills, availability and location etc.
Employers - search the database and find exactly what/who you are looking
for.
It is intended to repeat this posting at a suitable regular interval over
the next few months, to launch the service.
If you feel that this offends, is off-topic or approaches SPAMMING then
please let AFID know and AFID shall reconsider how best to promote the
service.
------------------------------
Date: Wed, 28 Apr 1999 07:42:44 GMT
From: aspinelli@ismes.it (Andrea L. Spinelli)
Subject: Re: GIF in web page
Message-Id: <3726b813.1121549177@news.inet.it>
On Tue, 27 Apr 1999 11:11:08 +0200, Kaare Rasmussen <kar@webline.dk>
wrote:
>I want to make a GIF file and present it in a web page. Both are made
>dynamically. So I imagine I have to create the GIF file with a temporary
>name (eg. $$.gif or so) and make a <IMG SRC="$$.gif".
This is not a Perl question.
However, go to comp.infosystems.www.authoring.cgi and look for my
reply.
See ya.
Andrea
--
Andrea Spinelli, Ismes SpA, Via Pastrengo 9, 24068 Seriate BG, Italy
e-mail: aspinelli@ismes.it Phone: +39-035-307209 Fax: +39-035-302999
------------------------------
Date: Wed, 28 Apr 1999 11:01:25 +0200
From: "Philip 'Yes, that's my address' Newton" <nospam.newton@gmx.net>
Subject: Re: Help:How to find Pixel size of an uploaded image using CGI?
Message-Id: <3726CE65.F03EFE34@gmx.net>
David Cassell wrote:
>
> <gasp> Surely that couldn't be true, Philip. I can't conceive
> of someone asking a pure CGI or webserver question in this newsgroup!
> Tell me it isn't so!
I don't know whether this really needs a reply. <sigh>
Cheers,
Philip
--
Don't remove anything to reply
------------------------------
Date: Wed, 28 Apr 1999 11:11:21 +0200
From: "Philip 'Yes, that's my address' Newton" <nospam.newton@gmx.net>
Subject: Re: How do i print something using perl?
Message-Id: <3726D0B9.EF843CF@gmx.net>
Greg McCann wrote:
>
> If that doesn't print out a page with the word "test" at the top, you
> need to review your assumptions about the printer.
It might, for example, be a "pure PostScript" printer. Or some weird
WinPrinter with absolutely no DOS support[1]. But we can't tell from
here.
Cheers,
Philip
[1] reminds me of the Joyce (aka PCW8512) that Amstrad/Schneider used to
make. My father had one. It comes with a "word processing" keyboard
(with special keys for searching etc.) and a printer. Somewhere I read
that the printer is so stupid that it only receives head positioning
commands from the computer, so that you can't connect it to anything
else. It can't even print ASCII by itself. If you wanted to connect it
to something else, there was this huge arrangement whereby the Joyce
basically turned into a huge interface -- reading from serial port and
writing to printer.
------------------------------
Date: 28 Apr 1999 08:23:33 GMT
From: damian@cs.monash.edu.au (Damian Conway)
Subject: Re: Impythonating PERL?
Message-Id: <7g6gi5$eb4$1@towncrier.cc.monash.edu.au>
andrews@Turing.Stanford.EDU (Avery Andrews) writes:
>It seems to me that it would be cool to be able to use python-style
>whitespace-formatting when you wanted it
[snip]
>Thereby loosing some of the brackets, parentheses & semicolons that
>I find mostly to be a annoyance. Has anyone thought of trying to do
>something like this?
Hey, some of us *specialize* in making stupidity a reality! ;-)
The truly frightening thing is that you can do it in less than a
screenful of Perl:
package impythonate;
use Text::Tabs;
my ($active, @bracket) = (0, ('{', ';', '}') );
sub import
{
return 1 if ($active++);
open CODE, $0 or die "couldn't translate $0";
my ($code, $transcode, $lastindent) = (join('',<CODE>), '');
$code =~ s/\\\n/ /g;
foreach (split /\n/, $code)
{
my ($indent,$notempty) = /\A([ \t]*)(\S?)/;
$indent = length(expand($indent));
$transcode .= $bracket[1+($lastindent<=>$indent)]
if $notempty && defined $lastindent;
$transcode .= "$_\n";
$lastindent = $indent if $notempty;
}
eval $transcode and exit or die $@;
}
1;
Now newlines replace colons and indentation replaces brackets:
use impythonate; # STILL NEED THAT ONE SEMICOLON, DAMMIT!
for $i (1..10) # COMMENTS ARE OKAY
print "$i: "
my $isq = \
$i**2 # LINE CONTINUATIONS WORK AS IN PYTHON
print " $isq\n"
print "done\n"
If people seriously want this abomination, I'll clean it up (e.g. add "no
impythonate", make it smarter about continuing lines after dangling
operators, etc.) and submit it to the CPAN.
However, it should probably be called something less obscure and more
descriptive: "indentation_as_scope" or "Language::Pythonesque".
Any other suggestions welcome.
Damian
------------------------------
Date: Wed, 28 Apr 1999 05:38:40 -0400
From: bkn3 <bkn3@columbia.edu>
Subject: Is there a command-line Usenet newsreader available?
Message-Id: <3726D720.D3BB011E@columbia.edu>
--------------1991227CE26F5CEB083055A9
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Hi everyone. I need to write a perl script to automate some tasks, but
I need a command-line Usenet newsreader that can take the name of a
Usenet news group to get as well as the number of messages to retrieve,
and then return these messages and quit. I know that there are a number
of excellent Usenet readers, like trn and tin, but these all have user
interfaces while I need a command-line interface. Can anyone tell me
where to get a command-line newsreader that can take command-line
options? Please send your replies to bkn3@columbia.edu . Thanks for
your help!
--
Thanks,
Brad Neuberg
+VP of Technology, BaseSystem Inc., http://www.basesystem.com
+Visit OpenPortal at www.openportal.org, where websites become
discussions, and discussions become websites
--------------1991227CE26F5CEB083055A9
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
Hi everyone. I need to write a perl script to automate some tasks,
but I need a command-line Usenet newsreader that can take the name of a
Usenet news group to get as well as the number of messages to retrieve,
and then return these messages and quit. I know that there are a
number of excellent Usenet readers, like trn and tin, but these all have
user interfaces while I need a command-line interface. Can anyone
tell me where to get a command-line newsreader that can take command-line
options? Please send your replies to bkn3@columbia.edu . Thanks for
your help!
<PRE>--
Thanks,
Brad Neuberg
+VP of Technology, BaseSystem Inc., <A HREF="http://www.basesystem.com">http://www.basesystem.com</A>
+Visit OpenPortal at www.openportal.org, where websites become
discussions, and discussions become websites</PRE>
</HTML>
--------------1991227CE26F5CEB083055A9--
------------------------------
Date: Wed, 28 Apr 1999 10:20:45 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: Is there a command-line Usenet newsreader available?
Message-Id: <ebohlmanFAwA2L.D2q@netcom.com>
bkn3 <bkn3@columbia.edu> wrote:
: Hi everyone. I need to write a perl script to automate some tasks, but
: I need a command-line Usenet newsreader that can take the name of a
: Usenet news group to get as well as the number of messages to retrieve,
: and then return these messages and quit. I know that there are a number
Are you sure that's what you need? Check out the Net::NNTP module.
------------------------------
Date: 28 Apr 1999 10:32:49 GMT
From: sholden@pgrad.cs.usyd.edu.au (Sam Holden)
Subject: Re: Is there a command-line Usenet newsreader available?
Message-Id: <slrn7idouh.42r.sholden@pgrad.cs.usyd.edu.au>
On Wed, 28 Apr 1999 05:38:40 -0400, bkn3 <bkn3@columbia.edu> wrote:
>
>Hi everyone. I need to write a perl script to automate some tasks, but
>I need a command-line Usenet newsreader that can take the name of a
>Usenet news group to get as well as the number of messages to retrieve,
>and then return these messages and quit. I know that there are a number
>of excellent Usenet readers, like trn and tin, but these all have user
>interfaces while I need a command-line interface. Can anyone tell me
>where to get a command-line newsreader that can take command-line
>options? Please send your replies to bkn3@columbia.edu . Thanks for
>your help!
Your question really doesn't have much to do with perl does it?
However, News::NNTPClient might be of interest to you.
Something like :
my $client = new News::NNTPClient("","",0);
$client->group($group);
print $client->article($article);
--
Sam
Computers in the future may weigh no more than 1.5 tons.
--Popular Mechanics, 1949
------------------------------
Date: Wed, 28 Apr 1999 12:33:37 +0200
From: "Philip 'Yes, that's my address' Newton" <nospam.newton@gmx.net>
Subject: Re: Multiline comments in perl
Message-Id: <3726E401.6862068E@gmx.net>
Jerome O'Neil wrote:
>
> David Cassell wrote:
> >
> > Jerome O'Neil wrote:
> > > Ye Gods! Why has thou forsaken C-style comments?!!!
> >
> > It's fine by me. But then when I write C code, I do it in an
> > analogous way to my Perl code...
> >
> > ############################################################
> > # I put stuff in boxes anyway, so readers can see it. #
> > ############################################################
>
> /************************
> Ook!
> *************************/
/*********************************************************************
* some people like it *
* other people do it because of some team's "programming standards" *
*********************************************************************/
Cheers,
Philip
------------------------------
Date: Wed, 28 Apr 1999 06:45:25 GMT
From: Ronny <ronald_f@my-dejanews.com>
Subject: Re: Not another Editor question?! Yes, but this one's different... sorta.
Message-Id: <7g6aq4$e1e$1@nnrp1.dejanews.com>
In article <7g2nff$j3e$1@murdoch.acc.Virginia.EDU>,
dsf3g@node1.unix.Virginia.EDU (David Salvador Flores) wrote:
> Like everyone else who posts asking about your favorite editor, I'm pretty
> new to perl. However, I'm not going to bore you asking what editor I
> should use. I'm pretty sure I just want to use EMACS for writing
> perl code.
>
> My question is this: Is there a simple tutorial, real handholding kinda
> stuff that shows you how to implement and use perl mode in emacs?
> Something like "Using Emacs to Code Perl for Dummies."
This is how I do it (excerpt from my .emacs); note that I prefer cperl-mode
over perl-mode:
(autoload 'perl-mode "cperl-mode" "alternate mode for editing Perl programs"
t) (setq cperl-hairy t) (setq auto-mode-alist (append
'(("\\.\\([pP][Llm]\\|al\\)$" . perl-mode)) auto-mode-alist )) (setq
interpreter-mode-alist (append interpreter-mode-alist '(("miniperl" .
perl-mode)))) (defun my-cperl-setup () (cperl-set-style "C++")) (add-hook
'cperl-mode-hook 'my-cperl-setup)
cperl-mode creates a new menu, "Perl", which - among other goodies - contains
an entry labelled "Micro Docs", which is kind of a FAQ for cperl-mode.
Hope that helps.
Ronald
--
Ronald Fischer <ronald_f@my-dejanews.com>
http://ourworld.compuserve.com/homepages/ronald_fischer/
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Wed, 28 Apr 1999 10:24:58 +0100
From: "David Evans" <davevans69@hormail.com>
Subject: PERL & Y2K
Message-Id: <7g6k5d$ni2@romeo.logica.co.uk>
I'm doing some research into PERL and the Year 2000 and was wondering if
anyone knows of an existing product that scans PERL script for Y2K
compliance?
Cheers,
David Evans
MSU Desktop
------------------------------
Date: 28 Apr 1999 10:27:27 GMT
From: sholden@pgrad.cs.usyd.edu.au (Sam Holden)
Subject: Re: PERL & Y2K
Message-Id: <slrn7idoke.42r.sholden@pgrad.cs.usyd.edu.au>
On Wed, 28 Apr 1999 10:24:58 +0100, David Evans <davevans69@hormail.com> wrote:
>I'm doing some research into PERL and the Year 2000 and was wondering if
>anyone knows of an existing product that scans PERL script for Y2K
>compliance?
If you don't know how to read documentation, or even th recent posts that
have Y2K in there subject then you won't be able to fix anything it
find anyway. So what does it matter.
--
Sam
I don't want Perl to be beautiful--I want you to write beautiful
programs in Perl.
--Larry Wall
------------------------------
Date: Wed, 28 Apr 1999 17:28:21 +0930
From: "Wyzelli" <wyzelli@yahoo.com>
Subject: Re: Perl and Y2K
Message-Id: <yczV2.14$CT2.4537@vic.nntp.telstra.net>
Tad McClellan wrote in message ...
>Glen Kaatz (gkaatz1@nycap.rr.com) wrote:
>
>: Excuse the dumb management question, but is Perl 5.003 for NT Y2K
>: compliant?
>
>
> No it is not.
>
> You should stop programming in Perl immediately, recode
> everything in Visual Basic, and then go ask Frequently
> Asked Questions in some other newsgroup.
>
>
>--
> Tad McClellan SGML Consulting
> tadmc@metronet.com Perl programming
> Fort Worth, Texas
Having a bad day Tad?
:^)
Wyzelli
------------------------------
Date: Wed, 28 Apr 1999 08:29:55 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Perl and Y2K
Message-Id: <3728c08c.1910181@news.skynet.be>
Glen Kaatz wrote:
>Excuse the dumb management question, but is Perl 5.003 for NT Y2K
>compliant?
Ask the dumb managers: what do you expect to give any problems?
Y2K is wholly and completely related to mpanipulation of dates. Perl can
handle them well, provided that the rest of the script handles them
properly too. In other words: Y2K compliancy of scripts is NOT Perl's
problem. It's your programmer's problem.
Bart.
------------------------------
Date: Wed, 28 Apr 1999 08:49:32 +0200
From: "Pieter Brouwer" <p.brouwer@prevalent.nl>
To: comp.lang.perl.misc
Subject: Re: Perl Editor...
Message-Id: <PRVL680C3A7D@prevalent.nl>
We use Ed4Win. It's a general-purpose editor for a number of program
languages. It is highly configurable and extendable. It has knowledge of the
perl-language, so it might be what you are looking for.
see www.getsoft.com for further information
HTH
Pieter Brouwer
Darren Bennett heeft geschreven in bericht <85431001@NEWS.SAIC.COM>...
> Can anyone suggest a decent NT/95 based Perl editor/debugger?? Also,
>does anyone have any NT Server admin scripts or links to such?? Please
>e-mail me them if you do.
>
> Thanks,
> -Darren
>
>
------------------------------
Date: Wed, 28 Apr 1999 12:39:02 +0200
From: "Philip 'Yes, that's my address' Newton" <nospam.newton@gmx.net>
Subject: Re: Perl newbie, please don't send me to ascii purgatory
Message-Id: <3726E546.8D04AEB@gmx.net>
kyle_programmer@my-dejanews.com wrote:
>
> 2) use strict; is good programming practice as it generates compile
> time errors if you have'nt pre-declared variables. eg.
>
> use strict;
> # correct pre-declaration of a variable :
> my $variable = "hello world";
> print $variable;
> #wrong this will generate compile time error
> $otherVariable = "goodbye world";
print $varibale;
will also generate a compile-time error; this can help you spot mistyped
variable names. This can come in really handy sometimes and saves you
having to look for the one place where you mis-spelled $line as $lien!
Cheers,
Philip
------------------------------
Date: 28 Apr 1999 09:32:34 GMT
From: austin95002887@yahoo.com (Austin Ming)
Subject: Perl question.
Message-Id: <7g6kji$6r7$20@justice.csc.cuhk.edu.hk>
Which GUI perl editor support (syntax highlight, debugging, execute, output to
browser, form added, ...) ?
------------------------------
Date: Wed, 28 Apr 1999 09:55:31 GMT
From: smnayeem@my-dejanews.com
Subject: Problem with DBV::CSV
Message-Id: <7g6luj$o0d$1@nnrp1.dejanews.com>
ive been trying to use the DBV::CSV for reading in a comma seperated file and
reading data from it. but perl is giving me some errors. here are some sample
lines from the file that i wish to import (i named it user.csv) : smarzit,Mr.
Smarzit,N,,26/1 Tipu Sultan
Road,,Dhaka,1207,248741,,,,N,N,,,,,N,,,,,NONE,NORMAL,,Mohammadpur,,01-JAN-00,
01- JAN-00 ehkhan,Enayet Hossain Khan,N,,7/10 BailySquare Officer's
Quarter,,Dhaka,,.,,409296,,N,N,,,,,N,,,,,NONE,NORMAL,,Baily
Road,,01-JAN-00,01-JAN-00 ferdous5,Ferdous H. Khan,N,,BRI Commander,101 BDE
Comilla
Cantonment,Comilla,,3488,,081-8989,,N,N,,,,,N,,,,,NONE,NORMAL,,Comilla
Cant.,,01-JAN-00,01-JAN-00 nas,Mrs. Nahid Nasreen,N,,153 Pineer
Road,,Dhaka,,834801-14,,,,N,N,,,,,N,,,,,NONE,NORMAL,,Shegun
Bagicah,,01-JAN-00,01-JAN-00 mrab,Mohsin Rob Chowdhury,N,,3/2
Monipuripara,,Dhaka,,9120439,017-536780,,,N,N,,,,,N,,,,,NONE,NORMAL,,Tejgaon,
,01 -JAN-00,01-JAN-00 imaank,Imaan Kabir,N,,A.F Kabir,Apt. E-602, 35 Indira
Road,Dhaka,1215,9131304,,,,N,N,,,,,N,,,,,NONE,NORMAL,,Tejgaon,,01-JAN-00,01-J
AN- 00
Above Three lines are making one line in the real file.
and heres my script to read the file (i named it userfile.pl):
use DBI;
my $dbh = DBI->connect("DBI:CSV:")
or die ('cant connect');
$dbh->{'csv_tables'}->{'user'} = {
'eol' => "\n",
'sep_char' => ",",
'quote_char' => "",
'escape_char' => "",
'file' => 'g:\agni\user',
'col_names' => [
"LOGIN","USER_NAME","SEX","CONTACT","ADDRESS1",
"ADDRESS2","CITY","POSTCODE","OFF1","OFF2","HOME",
"FAX","FAXAWAY","ZAKNET","WEB_PAGE_HOSTING","UUCP",
"EMAIL_ONLY","FULL_INTERNET","ENABLED","REFTHRU",
"REFNAME","MODEM","OS","GROUP_NAME","USER_TYPE",
"WEB_SITE_HOSTING","AREA","OCCUPATION", "DOB",
"SUBSCRIPTION_DATE"]
};
$sth = $dbh->prepare("SELECT * FROM user")
or die "Cannot prepare: " . $dbh->errstr();
$sth->execute() or die "Cannot execute: " . $sth->errstr();
while (my($row) = $sth->fetchrow_hashref) {
print("Found result row: id = ", $row->{'LOGIN'},
", name = ", $row->{'USER_NAME'});
}
$sth->finish();
$dbh->disconnect();
now when i try to run this script (located at g:\agni directory, both the
script and the input file) it gives the following error msg : DBD::CSV::st
execute failed: Cannot open .\g:\agni\user: Invalid argument at g:
\Perl\site\lib/DBD/File.pm line 471. Cannot execute: Cannot open
.\g:\agni\user: Invalid argument at g:\Perl\site\li b/DBD/File.pm line 471.
ive tried changing the 'file' option to g:\agni\user.csv but that ddnt work.
anyone knows where i went wrong?? all i want to do is treat text files as a
data base and perl is giving me so much trouble :o)
any help would be greatly appreciated.
smnayeem
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Wed, 28 Apr 1999 11:41:53 +0200
From: Walter Pleyer <pleyer@kraftwerk.co.at>
Subject: Site seach engine
Message-Id: <3726D7E1.45E96F@kraftwerk.co.at>
Hi folks!
I'm currently looking for a search enigine to be integrated ina website
and that shall search only this local website.
The search engine should be able to handle German Umlauts (you know
these funny a, o und u with the two dots on top) and coud/should be
implemented with Perl. It's supposed to run on Solaris machine with
a Netscape Enterprise Server.
Any Information, hints and advices welcome.
Thanks
Walter Pleyer
pleyer@kraftwerk.co.at
------------------------------
Date: Wed, 28 Apr 1999 08:29:52 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: stupid single quote " wipes out REST OF TEXT
Message-Id: <3727bffc.1766497@news.skynet.be>
NOSPAMcrstlblu@planet.eon.net wrote:
> I still lose BOTH the single quote, as well as the 200 characters AFTER
>the single quote :)
Are you sure you don't need to double the single quote to properly store
it in the DB?
s/'/''/g;
(note: that's two single quotes, no one double quote)
Bart.
------------------------------
Date: Wed, 28 Apr 1999 08:38:33 GMT
From: aspinelli@ismes.it (Andrea L. Spinelli)
Subject: Re: stupid single quote " wipes out REST OF TEXT
Message-Id: <3726c753.1125453517@news.inet.it>
On Tue, 27 Apr 1999 11:08:15 GMT, NOSPAMcrstlblu@planet.eon.net wrote:
>[...]
>when I OPEN the dbm, extract, and display the text in THE FIRST SCRIPT, no prob,
>it gets displayed in its' entirety,....
>when i pass the value into a hidden formfield and forward to the next
I suspect that you write directly something like
print "<input type=\"hidden\" name=\"foo\" value=\"$value\">";
where $value is 5'10".
Now, what you'll print is
<input type="hidden" name="foo" value="5'10"">
You should see that there is an inconsistency after the 10.
I suggest using CGI::hidden instead, which takes care of
translating " to " and all those nasty details...
HTH
Andrea
--
Andrea Spinelli, Ismes SpA, Via Pastrengo 9, 24068 Seriate BG, Italy
e-mail: aspinelli@ismes.it Phone: +39-035-307209 Fax: +39-035-302999
------------------------------
Date: Wed, 28 Apr 1999 07:44:51 GMT
From: jed@grafx.co.uk (Neil Jedrzejewski)
Subject: Urgent help needed - using DBI and DBD:mSQL when I CANT install the packages?
Message-Id: <3726bb09.42505589@news.dircon.co.uk>
Hi All,
My caring, sharing ISP has got me in a fix by allowing me to use mSQL
for databases, but now refuses to install the DBI and DBD:msQL modules
as their 'third party'.
While its up to them what they install, I have o live with that but I
wondered if anyone can help.
What I was wondering was, is it possible to put the required Perl
modules into a seperate folder and point to them there?
I was thinking of creating a sub-directory of cgi-bin called 'lib' and
putting the required .pm files in there.
I read somewhere that its possible to re-write the 'use' statment
to include a path as well?
I may be talking rubbish, but is this at all possible?
I don't know which files from the DBI folder I'll need and can't
even find a mSQL folder myself!
However, if it helps I have a local Linux machine running Redhat 5.2
so I can install/make any files I need before copying them to the
webserver.
I'd really appreciate any help on this one.
Thanks
- Jed
Please CC replies to me via e-mail.
------------------------------
Date: Wed, 28 Apr 1999 08:00:04 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: using Find::file inside a sub-routine ..?
Message-Id: <ebohlmanFAw3K5.6rB@netcom.com>
Meling Mudin <mudin@expert.cc.purdue.edu> wrote:
: Hi, I am a newbie, and here's my question.
: I found that File::find provides a great method of recursively
: processing files in a directory. So I can have something like:
[snip]
: The nature of my project requires me to do all the above inside a particular
: sub-routine. Is it possible?
Yes.
: sub Check {
: # do something
: # initialization, etc
: sub process_file {
: # do some other thing
: }
: find (\&process_file, @dirlist);
: }
But not like that. In Perl, you can't have one subroutine nested inside
another (well actually you can, but it doesn't behave the way you'd expect
it to). Simply move the definition of process_file outside the definition
of Check. If you want process_file and Check to be able to share
variables that should be invisible to the rest of your code, enclose both
of them in a block like so:
{my ($private_var_1, $private_var_2);
sub process_file {
...
}
sub Check {
...
}
}
------------------------------
Date: Wed, 28 Apr 1999 12:09:39 +0200
From: "Vincent Vanbiervliet" <vvb@ibm.net>
Subject: Re: What does this error message mean?
Message-Id: <3726dd9f@news.uk.ibm.net>
The error is clearly on line 24 .
Vincent
(and if you post the code I could even tell you what exactly is wrong)
Blair Kingsland <blairk@istar.ca> wrote in message
news:pdyV2.1156$Ev1.746050@NewsRead.Toronto.iSTAR.net...
> Hello:
>
> I'm running ActivePerl on an Apache server. The program output is
> correct, but I always get the following server error (warning)
> message:
>
> Value of <HANDLE> construct can be "0"; test with defined() at
> /usr/local/etc/httpd/htdocs/tigron/cgi-bin/glossary.pl line 65535.
>
> I can't find an explanation of this message anywhere. What does "line
> 65535" mean? The program file is only 25 lines long. Any help would be
> appreciated.
>
> Thanks.
>
> Blair Kingsland
>
------------------------------
Date: Wed, 28 Apr 1999 15:42:44 +0800
From: "Shashank Tripathi" <mkshanx@ust.hk>
Subject: Re: What is wrong with this picture?
Message-Id: <7g6e4k$arm@ustsu10.ust.hk>
This exact program works for me!
A similar error had appeared to me when I used to code perl stuff on my
computer (which is windows based) and then FTPed it to my university server,
bu using CuteFTP. But I forgot to transfer it as an ASCII file and
transferred it in binary mode.
I guess if you directly write the program in your telnet window (or transfer
it in the ASCII mode), it shouldnt give you any problem !
HTH
Shanx
Brian Dodd <bd@albany.net> wrote in message news:3723A52B.22B0@albany.net...
> I am looking for some help. Ihave een reading and working on this
> all day with no succeess. Somone please help.
>
> My program:
> #!/usr/bin/perl
> print "Content-type: text/html\n\n";
>
> print <<'ending_print_tag';
> <html>
> <head>
> <title>Hello World</title>
> <background= "#000000" text="#ff0000">
> </head>
> <body>
> <h1>Hello World</h1>
> <hr noshade>
> </body>
> </html>
> ending_print_tag
------------------------------
Date: Wed, 28 Apr 1999 12:55:39 +0200
From: "Philip 'Yes, that's my address' Newton" <nospam.newton@gmx.net>
Subject: Re: what's wrong with $x = $y or ""
Message-Id: <3726E92B.F259BE35@gmx.net>
Abigail wrote:
>
> Now if only we had the ?? operator....
What would this operator do? Logical ?: or something?
Cheers,
Philip
------------------------------
Date: Wed, 28 Apr 1999 07:31:54 GMT
From: "Craig R. Belcham" <crb@highpoint.co.uk>
Subject: Re: When uploading files how do I count the characters in the resulting filename?
Message-Id: <3726ABEA.386392AD@highpoint.co.uk>
Siri Dhyan Singh wrote:
>
> Wow that was tough for a header . . .
> I am using a html form to allow web clients to browse for a file and upload to a
> predefined directory.
>
> How do I count the characters in the resulting file name.
...
> while (/pattern/g){
> count++;
$count = length($filename);
Regards
Craig
--
Craig R. Belcham. Internet Systems Management Consultant.
Email: crb@highpoint.co.uk, http://www.highpoint.co.uk/~crb
"The greatest trick the devil ever pulled was convincing the
world that he didn't exist" -- Kevin Spacey, Usual Suspects.
------------------------------
Date: Wed, 28 Apr 1999 09:57:08 GMT
From: michielpeene@my-dejanews.com
Subject: Where can I get MAKE
Message-Id: <7g6m1j$o0p$1@nnrp1.dejanews.com>
Hello,
Is there anybody who can tell me where I can find a MAKE program to install
Perl modules. I've installed PMAKE version 1.00 but it doesn't seem to work.
The installation was good, but when I use it with CPAN ( I use CPAN to install
new modules by typing: perl -MCPAN -e shell, and then install package) it says
it doesn't find make.pm in @INC. Is there a normal executable MAKE program or
do I have to use the perl module pmake.
Please help, because I'm totaly stuck with it!
Thanks in advnance, Michiel
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: 12 Dec 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Special: Digest Administrivia (Last modified: 12 Dec 98)
Message-Id: <null>
Administrivia:
Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing.
]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body. Majordomo will then send you instructions on how to confirm your
]subscription. This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.
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.
To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.
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.
The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.
The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.
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 V8 Issue 5503
**************************************