[19578] in Perl-Users-Digest
Perl-Users Digest, Issue: 1773 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Sep 19 14:08:13 2001
Date: Wed, 19 Sep 2001 11:05:10 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <1000922710-v10-i1773@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Wed, 19 Sep 2001 Volume: 10 Number: 1773
Today's topics:
ANNOUNCE: grepmail 4.51 released <newspost@coppit.org>
CGI_Lite Buffer Error on Win2000Pro Machine <news@raincloud-studios.com>
Re: copy STDERR to file (Martien Verbruggen)
Re: debug CGI script (Chad Yoshikawa)
Excel-Files <christian.wanninger@toshiba-tro.de>
Re: Excel-Files <nospam@ireland.com>
Re: Excel-Files <djberge@qwest.com>
Explananation for strange die behaviour while using XML <william.wueppelmann@SPAM.FREE.nlc-bnc.ca>
Re: filter out short strings <sun_tong@users.sourceforge.net>
Re: Global variables <mjcarman@home.com>
Group Counting... (JR)
Re: Group Counting... (Randal L. Schwartz)
Re: Help with $ENV{'PATH'} statement <robert.rawlinson@worldnet.att.net>
Re: How to htmlize an email, for eg lynx? (Randal L. Schwartz)
how to replace several blank lines with 1 <tamm@scotlegal.com>
Re: how to replace several blank lines with 1 <dbohl@sgi.com>
Re: Need help with perl script... (Martien Verbruggen)
Re: Net::FTP and AIX (Charles DeRykus)
Re: Objects and Sockets (Anno Siegel)
only allowing characters from a list to be inputed (Kiaya)
Re: only allowing characters from a list to be inputed (Randal L. Schwartz)
Re: Perl English only?????? <weiss@kung.foo.at>
Perl Image Voting software? <a@b.c>
Re: Perl Image Voting software? (Randal L. Schwartz)
Re: Perl Image Voting software? (Michel Dalle)
Perl on CD-ROM (Kiaya)
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 19 Sep 2001 13:59:19 -0000
From: David Coppit <newspost@coppit.org>
Subject: ANNOUNCE: grepmail 4.51 released
Message-Id: <tqh95njaes5q62@corp.supernews.com>
Description:
- grepmail is a Perl program that searches a normal or compressed mailbox
(gzip, bzip2, or tzip) for a given regular expression and returns those
emails that match the query. It also supports searches constrained by date
and size.
Download:
- You can download grepmail 4.51 from CPAN:
http://www.cpan.org/authors/id/D/DC/DCOPPIT/grepmail-4.51.tar.gz
- Until the file propagates to the mirrors, you can use the following URL:
http://prdownloads.sourceforge.net/grepmail/grepmail-4.51.tar.gz
Changes:
- Fixed a bug in attachment boundary matching which would cause the boundary
match to fail if the boundary contained special pattern matching characters.
(Thanks to Richard Everson for identifying the bug, and providing a sample
email which demonstrates the problem.)
- Fixed a bug where grepmail would fail to print matching emails which had
signatures, and added a test case for it. This bug was introduced with -B
support in version 4.49. (A *huge* thanks to Moritz Barsnick for reporting
the bug and doing the initial analysis of the cause.)
- grepmail now dies gracefully when invalid patterns like "strcpy(" are
supplied. (It should be "strcpy\(".)
- Added a check for Inline 0.41 or better during "perl Makefile.PL" when
Mail::Folder::FastReader is selected to be installed. (Thanks to Brian L.
Johnson for the problem report.)
- Modified Makefile.PL to ask whether the user wants FastReader regardless of
whether they specified arguments to "make Makefile.PL".
- Modified Makefile.PL to allow the user to interactively specify the
installation path.
- Fixed a typo in debugging output for emails without "Date:" headers.
- Improved error messages.
- Usage message now displays just the flags, --help shows a summary of their
meanings as well.
A complete change log is at:
- ftp://grepmail.sourceforge.net/pub/grepmail/CHANGES
Thanks,
David
_________________________________________________________________________
David Coppit - Ph.D. Candidate david@coppit.org
The University of Virginia http://coppit.org/
"Yes," said Piglet, "Rabbit has Brain." There was a long silence.
"I suppose," said Pooh, "that that's why he never understands anything."
------------------------------
Date: Wed, 19 Sep 2001 11:09:11 -0400
From: "Charles R. Thompson" <news@raincloud-studios.com>
Subject: CGI_Lite Buffer Error on Win2000Pro Machine
Message-Id: <7A2q7.14410$5j7.283417@e3500-atl2.usenetserver.com>
I'm running Apache on a Win2000Pro machine and the latest release of
ActivePerl. I've used CGI_Lite for an eon now with Unix and Win98 with
constant success but I recently tested an older script I had written on a
Win2000Pro machine and browser based uploads are failing like heck.
CGI_Lite is reporting "Uh Oh I can't read what I want" which I guess is
related to reading from the buffer. The script manages to upload 6k of any
file and place it in the $TEMP_PATH directory so I know my paths are ok.
The platform has been tried as Windows and PC. The script runs fine from
Unix with various browsers so I'm left thinking it's something about the
buffer code and the Win2000 security, filesystem, etc. Can anyone give me
any indication on what might be going on so I can get back to work? :) If
it's more of a Win2000 issue I'll move on but I figured somebody here would
have experienced it before anyone there.
Thanks for any help,
CT
This is the core snippet...
use lib $MODULE_PATH;
$FILE_TIMESTAMP = "temp__" . time . "_";
##################################################
# BRAND UPLOADED FILENAME
##################################################
sub brand_uploaded_filename{
my $file = shift;
if ($file eq "") {
return ('NULL.FILE'); # used when file is not required in the DB
}
$file =~ tr/A-Z/a-z/; # Upper to lowercase
$file =~ s/(?:%20)+/_/g; # One or more spaces to "_"
$file =~ s/%[\da-fA-F]{2}//g; # Remove all hex %xx
return ($FILE_TIMESTAMP . $file);
}
##################################################
# CREATE CGI
##################################################
use CGI_Lite;
$CGI = new CGI_Lite;
$CGI->set_directory($TEMP_PATH) || die "Directory $TEMP_PATH does not
exist!";
$CGI->set_platform('Windows');
$CGI->set_buffer_size(1024);
$CGI->add_timestamp(0);
$CGI->set_file_type('handle');
$CGI->filter_filename(\&brand_uploaded_filename);
%QUERY = $CGI->parse_form_data;
if ($CGI->is_error) {
$error_message = $CGI->get_error_message;
&print_header;
print qq~$error_message~;
}
# -- snipped --#
------------------------------
Date: Wed, 19 Sep 2001 22:57:38 +1000
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: copy STDERR to file
Message-Id: <slrn9qh5i1.2ut.mgjv@martien.heliotrope.home>
On 19 Sep 2001 03:47:12 -0700,
Rory <rory@campbell-lange.net> wrote:
> I would like, for part of a script, to copy STDERR to a file, as I
> have a script that takes ages to run, and I might miss some of the
> messages written to the console.
>
> I have tried the recipe in perlfunc, but after closing the STDERR
> filehandle, I don't get messages reported to the console at all.
Then don't close it.
Where's the actual code you're using?
Martien
--
Martien Verbruggen |
Interactive Media Division | The world is complex; sendmail.cf
Commercial Dynamics Pty. Ltd. | reflects this.
NSW, Australia |
------------------------------
Date: Wed, 19 Sep 2001 17:32:02 GMT
From: m_010@yahoo.com (Chad Yoshikawa)
Subject: Re: debug CGI script
Message-Id: <3ba8d5d1.1636252@enews.newsguy.com>
how about unix?
i telnet to a unix host from windows, and i am using exceed which is a
unix emulator. any way I can make debugger GUI pop up on my windows
machine which has unix emulation?
i had export the terminal screen to my windows machine:
speed> DISPLAY=10.0.1.113:0
speed> export DISPLAY
thanks again.
On Wed, 19 Sep 2001 02:09:14 GMT, Bob Walton
<bwalton@rochester.rr.com> wrote:
>Joe Chung wrote:
>...
>Just as a followup to all this, I wanted to post a private communication
>between myself and Mr. Chung here, in which I noted that ptkdb *can* be
>used to debug "live" CGI scripts on a computer with a web server. Here
>it is:
>
>Well, [debugging a "live" CGI script with ptkdb] can easily be done, but
>I don't see the point. There are only a handful of CGI environment
>variables to define. It will always be easier to debug a CGI script
>offline and, when it is working, try it online.
>
>But if you really want to, just add -d:ptkdb to your shebang line, like:
>
>#!/usr/bin/perl -d:ptkdb
>
>Note that if you are running Windoze, Windoze Perl will pay attention to
>the switches on the shebang line, even though the so-called OS doesn't
>pay attention to the name or path of the executable.
>
>That seems to work, even for POST, which, frankly, surprised me. My
>setup: Windoze 98SE, ActiveState Perl 5.6.1 build 629, WebSite 1.1 web
>server set up to run .pl files as CGI scripts. Test script: the
>example script in the CGI module docs, pasted verbatim except shebang
>line added with -d:ptkdb .
------------------------------
Date: Wed, 19 Sep 2001 15:02:00 +0200
From: "Christian Wanninger" <christian.wanninger@toshiba-tro.de>
Subject: Excel-Files
Message-Id: <9oa8cj$5vk$1@news1.dtag.de>
How can I open an existing Excel-File and write data from another Excel-File
into it? Can anyone help me?
Thanxx
------------------------------
Date: Wed, 19 Sep 2001 14:15:49 +0100
From: rob <nospam@ireland.com>
Subject: Re: Excel-Files
Message-Id: <3BA89A85.1921BD79@ireland.com>
Christian Wanninger wrote:
> How can I open an existing Excel-File and write data from another Excel-File
> into it? Can anyone help me?
>
> Thanxx
perldoc Win32::OLE
gives some examples on opening / creating Excel files.
-rob-
------------------------------
Date: Wed, 19 Sep 2001 09:23:18 -0500
From: "Daniel Berger" <djberge@qwest.com>
Subject: Re: Excel-Files
Message-Id: <3P1q7.23$GX6.155158@news.uswest.net>
"Christian Wanninger" <christian.wanninger@toshiba-tro.de> wrote in message
news:9oa8cj$5vk$1@news1.dtag.de...
> How can I open an existing Excel-File and write data from another
Excel-File
> into it? Can anyone help me?
>
> Thanxx
Spreadsheet-WriteExcel and Spreadsheet-ParseExcel - both available on CPAN
Regards,
Mr. Sunblade
------------------------------
Date: Wed, 19 Sep 2001 11:10:19 -0400
From: ww <william.wueppelmann@SPAM.FREE.nlc-bnc.ca>
Subject: Explananation for strange die behaviour while using XML::DOM
Message-Id: <3BA8B55B.8090809@SPAM.FREE.nlc-bnc.ca>
I am getting some unexpected output from the following:
use strict;
use XML::DOM;
my $xml_file = 'source/home.xml';
$SIG{'__DIE__'} = \&Die;
sub Die
{
my $reason = shift;
$reason =~ s/.*(mismatched tag at.*?) at .*/$1/;
my $message = "$xml_file: $reason.";
die "$message\n";
}
my $parser = new XML::DOM::Parser;
my $dom = $parser->parsefile ($xml_file);
The file source/home.xml is not well-formed, so I expect (and want) the
program to die and give me the following message:
source/home.xml: mismatched tag at line 32, column 2, byte 467.
But what I get is:
source/home.xml: source/home.xml: source/home.xml:
mismatched tag at line 32, column 2, byte 467
.
.
.
Does anyone know why this is happenning and how to avoid printing the
extraneous text?
I am using ActivePerl 5.6.1 on NT4.
Thanks in advance.
------------------------------
Date: 19 Sep 2001 13:53:01 -0300
From: * Tong * <sun_tong@users.sourceforge.net>
Subject: Re: filter out short strings
Message-Id: <sa866af5dhu.fsf@suntong.personal.users.sourceforge.net>
"Wyzelli" <wyzelli@yahoo.com> writes:
> > How can I filter out strings that are too short from an array?
> >
> > @out = grep { (=~ tr/a-z//i) <3} @in;
> @out = grep {(length $_ > 3)} @in;
Thanks, I forgot to mention the reason that I want use tr instead of
length:
For a string 'Abc1234', I want it count as 3 instead of 7, i.e.,
count characters in it only. Is it possible? thanks
--
Tong (remove underscore(s) to reply)
*niX Power Tools Project: http://xpt.sourceforge.net/
- All free contribution & collection
------------------------------
Date: Wed, 19 Sep 2001 07:46:10 -0500
From: Michael Carman <mjcarman@home.com>
Subject: Re: Global variables
Message-Id: <3BA89392.1EFE183A@home.com>
Philippe PERRIN wrote:
>
> I have a script.pl file, where I use a global variable :
> use strict;
> my %hash;
That's not a global, it's a (file-scoped) lexical. For a true global
variable, you'd have to declare it as either
our (%hash); # Perl v5.6.0+
use vars qw(%hash); # Perl before v5.6.0
> In this .pl file, I use some .pm files of my own. How can I make
> these .pm modules access the %hash variable, defined in the .pl
> script ?
First: you can't (directly) if %hash is a lexical variable. That's the
point of scoping.
Second: You shouldn't be writing modules that depend on the existance of
a variable in the script that uses them. I don't know what you use %hash
for, but there are two basic options for doing things the "right way"
* Declare %hash as a global in your module and export it to the
.pl file.
* Leave %hash as a lexical in your script and pass it (or a
reference to it) into the subs in the .pm that need the data.
-mjc
------------------------------
Date: 19 Sep 2001 10:43:21 -0700
From: tommyumuc@aol.com (JR)
Subject: Group Counting...
Message-Id: <319333f5.0109190943.32863090@posting.google.com>
Please help with this group counting problem.
I have a file such as the following:
Type Code Value
---- ---- -----
C 10010 30
C 10010 30
P 20030 10
T 20040 10
P 10010 30
...
...
For which I need to output the following data sets:
Group Total
----- -----
10010 90
20030 10
20040 10
and
Group Group-Frequency Type-Frequency ( C | P | T )
----- --------------- ----------------------------
10010 2 2 | 1 | 0
20030 1 0 | 1 | 0
20040 1 0 | 0 | 0
PL/SQL could make easy work of counting the above frequencies, etc.,
but I don't want an expensive callout to the system just to group data
and count data within the groups (there must be a way to do this with
Perl without the need for the system callout). I have created code to
handle any one set of group data, but when the group data has several
columns, I get lost fast. I know there must be a Perl guru out there
who has encountered and solved this type of problem (fingers crossed).
I appreciate any help anyone may have. Thanks much.
JR
------------------------------
Date: 19 Sep 2001 10:57:15 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: Group Counting...
Message-Id: <m1itef5ais.fsf@halfdome.holdit.com>
>>>>> "You" == <tommyumuc@aol.com> writes:
You> Please help with this group counting problem.
You> I have a file such as the following:
You> Type Code Value
You> ---- ---- -----
You> C 10010 30
You> C 10010 30
You> P 20030 10
You> T 20040 10
You> P 10010 30
You> ...
You> ...
You> For which I need to output the following data sets:
You> Group Total
You> ----- -----
You> 10010 90
You> 20030 10
You> 20040 10
You> and
You> Group Group-Frequency Type-Frequency ( C | P | T )
You> ----- --------------- ----------------------------
You> 10010 2 2 | 1 | 0
You> 20030 1 0 | 1 | 0
You> 20040 1 0 | 0 | 0
while (<INPUT>) {
my ($type, $code, $value) = split;
$code_total{$code} += $value;
$code_detail{$code}{$type} ++;
}
for my $code (sort keys %code_total) {
print "$code $code_total{$code}\n";
}
for my $code (sort keys %code_detail) {
my %item; my $sum;
$sum += $item{$_} = $code_detail{$code}{$_} || 0 for qw(C P T);
print "$code $sum @item{qw(C P T)}\n";
}
Kindly put 25 cents into your favorite beverage machine and think of me. :)
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
------------------------------
Date: Wed, 19 Sep 2001 14:43:09 GMT
From: Robert Rawlinson <robert.rawlinson@worldnet.att.net>
Subject: Re: Help with $ENV{'PATH'} statement
Message-Id: <3BA8AED7.FDD3638E@worldnet.att.net>
First I would like to thank all the really great ideas and
suggestions I got. They all got me to thinking and so I put
some print statements in to see what was there before and
after I ran the line. I found that I must not have counted the
lines well. I found the problem was in the line following. I
now think I have a permission problem in Linux as the line is a
system($command); fed by a line that sets up the command which
executes a ppp and chat dialog. So thanks again for the help
and I will place a new message in the Linux and RedHat groups.
Bob
Robert Rawlinson wrote:
> I was given a script to dial up an ISP and it has a line in
> it which says:
> $ENV{'PATH'} = ' '; and a comment #make $ENV{'PATH'}
> untainted
> I thin this is to set the path in env to empty. If this is
> wrong please let ;me know.
> The problem is that while this statement works as root when
> I am a user and try to run it I get the message:
> Insecure $ENV{BASH_ENV} while running setuid at
> /usr/sbin/ppp-on line 29
> What is the cause and cure for this problem? Thanks for any
> help/enlightenment you can offer.
> Bob
>
--
Robert A. Rawlinson | Check us out at:
|
robert.rawlinson.home.att.net
Felicity Ohio 45120
| We are not destroying the
world
| We are just getting it ready
| for our successors.
------------------------------
Date: 19 Sep 2001 06:10:19 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: How to htmlize an email, for eg lynx?
Message-Id: <m1vgifba2s.fsf@halfdome.holdit.com>
>>>>> "David" == David Combs <dkcombs@panix.com> writes:
David> Being as I do *not* use M$, and instead use
David> (as email-reader) mutt, I need some way to
David> convert an email like this:
[...]
David> into an html doc that I can read via lynx and then
David> easily link to the various sites.
$ perl -MHTML::FromText -0777 -e 'print text2html(<>, urls => 1)' <<END
Building Debate: Should Twin Towers Go Up Again?
http://www.dallasnews.com/national/472263_nycarchitect_1.html
We Cannot Allow Fear to Dictate Commercial Architecture
http://www.jsonline.com/news/metro/sep01/goulcol17091601a.asp
The End of Tall Buildings
http://www.planetizen.com/oped/item.php?id=30
Rebuild or Not: Architects Respond
http://www.nytimes.com/2001/09/23/magazine/23REBUILD.html
END
Building Debate: Should Twin Towers Go Up Again?
<TT><A HREF="http://www.dallasnews.com/national/472263_nycarchitect_1.html">http://www.dallasnews.com/national/472263_nycarchitect_1.html</A></TT>
We Cannot Allow Fear to Dictate Commercial Architecture
<TT><A HREF="http://www.jsonline.com/news/metro/sep01/goulcol17091601a.asp">http://www.jsonline.com/news/metro/sep01/goulcol17091601a.asp</A></TT>
The End of Tall Buildings
<TT><A HREF="http://www.planetizen.com/oped/item.php?id=30">http://www.planetizen.com/oped/item.php?id=30</A></TT>
Rebuild or Not: Architects Respond
<TT><A HREF="http://www.nytimes.com/2001/09/23/magazine/23REBUILD.html">http://www.nytimes.com/2001/09/23/magazine/23REBUILD.html</A></TT>
Close enough?
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
------------------------------
Date: Wed, 19 Sep 2001 16:37:29 +0100
From: "Tam McLaughlin" <tamm@scotlegal.com>
Subject: how to replace several blank lines with 1
Message-Id: <1geao9.81r.ln@mail.scotlegal.com>
I cannot find how to replace or delete several successive blank lines
from a text file.
I have text file which is normally sent to the printer but now want to split
the file up and email the different files to different people. I have
created
the different files but wish to get rid of the blank lines that are left
over
that are inserted for correct page length etc.
I have looked at the /start pattern/ .. /end attern/ operator but cant work
this out.
------------------------------
Date: Wed, 19 Sep 2001 11:37:20 -0500
From: Dale Bohl <dbohl@sgi.com>
Subject: Re: how to replace several blank lines with 1
Message-Id: <3BA8C9C0.C1F6610B@sgi.com>
Tam McLaughlin wrote:
>
> I cannot find how to replace or delete several successive blank lines
> from a text file.
>
> I have text file which is normally sent to the printer but now want to split
> the file up and email the different files to different people. I have
> created
> the different files but wish to get rid of the blank lines that are left
> over
> that are inserted for correct page length etc.
> I have looked at the /start pattern/ .. /end attern/ operator but cant work
> this out.
What about 'grep'?
@array = grep length, @array;
if the definition of 'empty line' is no characters, or
@array = grep !/^$/, @array;
if the definition of 'empty line' is no characters or nothing but a new-
line character.
--
Thanks,
Dale
Dale Bohl
SGI Information Services
World Wide Systems Administration
dbohl@sgi.com
(715)-726-8406
http://wwwcf.americas.sgi.com/~dbohl/
------------------------------
Date: Wed, 19 Sep 2001 23:10:28 +1000
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: Need help with perl script...
Message-Id: <slrn9qh6a4.2ut.mgjv@martien.heliotrope.home>
On Wed, 19 Sep 2001 01:29:13 +0200,
Jonas Vonlanthen <jonas.vonlanthen@jef.ch> wrote:
> This is a multi-part message in MIME format.
Please, don't do that. Usenet is a plain text medium.
> Could someone help me with the following perl script...
I'm sure someone could.
> 1. Is it possible to modify the script so that it doesn' search only the
> "base" directory but also other directories?
Have a look at the File::Find module. Comes standard with Perl.
> 2. Is it possible to search text instead of keywords?
Yes. But you'll have to be more specific when you explain what you want
to the programmer who'll do the work. You'll have to specify what you
mean by text.
> 3. How can we exclude some files from being scanned?
Again, read the File::Find documentation. If you hand it the correct
'wanted' function, it'll only trigger on files that you want to search.
> #!/usr/bin/perl
no -w, no use strict. A CGI program accepting use input, without -T.
> # Copyright (C) 1998 by Sierra Kempster. All rights reserved.
Did you ask the author?
> $dir = "/www/WP011B25/"; # Directory to search
> $url = "http://WP011B25.sizch.net/"; # URL of directory
>
> # Get the form information
> read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
Doing work the hard way which nowadays is done with the CGI module. And
doing it incorrectly.
> # Open the directory and get file list
> opendir(DIR, "$dir");
No error check.
> local(@files) = grep /\S+\.[Hh][Tt][Mm]/, readdir(DIR);
using local() where my() would be better. local() is useless here.
This is where you would build a list of files with the help of the
File::Find module, OR where you would use the module to directly search
those files.
> closedir(DIR);
>
> # List of key words
> $FORM{keywords} = ~tr/[A-Z]/[a-z]/;
> @keywords = split(/ /,$FORM{keywords});
>
> # Check each file for the words
> foreach $file (@files)
> {
> if($file ne "index.htm")
If you don't want index.htm, then why did you include it in @files in
the first place?
> {
> open(FILE, "$dir/$file");
No error check.
> $x = 0;
> while(<FILE>)
> {
> chomp;
> $_ =~ tr/[A-Z]/[a-z]/;
unnecessary binding.
> foreach $word (@keywords)
> {
> if($_ =~ /$word/)
Unnecessary binding.
And this is where I stop reading. Most people probably gave up after the
first few lines. I'd chuck this whole script, and start with a clean,
new one. Use File::Find, do all the work in the wanted() function.
Martien
--
Martien Verbruggen | Since light travels faster than
Interactive Media Division | sound, isn't that why some people
Commercial Dynamics Pty. Ltd. | appear bright until you hear them
NSW, Australia | speak?
------------------------------
Date: Wed, 19 Sep 2001 16:59:35 GMT
From: ced@bcstec.ca.boeing.com (Charles DeRykus)
Subject: Re: Net::FTP and AIX
Message-Id: <GJx5vB.L9J@news.boeing.com>
In article <CEUp7.281835$g_3.63507077@typhoon.austin.rr.com>,
Bob Densmore <bdensmore@austin.rr.com> wrote:
>I asked the Unix admins at the shop to install the Net::FTP perl module.
>They had never heard of CPAN and after looking around, basically said they
>would not install the perl module because it had not been tested and
>certified on AIX.
The libnet bundle which includes Net::FTP has a validating test
suite which is part of the recommended installation. No other
certification is needed.
--
Charles DeRykus
------------------------------
Date: 19 Sep 2001 13:36:00 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Objects and Sockets
Message-Id: <9oa700$1f0$2@mamenchi.zrz.TU-Berlin.DE>
According to Del <delanthear@yahoo.com>:
> > You can build your object around a hash ref and store your
> > instance-specific data like an associated socket in that hash.
> >
> > Consider this standard constructor skeleton:
> >
> > sub new {
> > my $proto = shift;
> > my $class = ref( $proto ) || $proto;
> > my $self = {};
> >
> > # do something
> >
> > return $self;
> > }
> >
> > Each method of the object will receive this hash ref as the first
> > argument when it is called.
>
> Sorry,
>
> I don't really understand that example. How do you store a
> filehandle within a hash? I don't remember any examples of doing
> this! Could you point me to a working example so I can get my head
> around it?
>
> eg,
> socket(SESSION, PR_INET, SOCK_STREAM, getprotobyname('tcp')) || die
> "$!";
>
> creates a socket, usable by the filehandle SESSION, but how would I
> store that within the object for later use?
>
> thanks for the help!
Well, with a named filehandle this is a bit hard to do (though possible).
If you use the newish filehandle objects, there is no problem. This
should work (untested):
socket(my $session, PR_INET, SOCK_STREAM, getprotobyname('tcp'))
Now you can use $session like a filehandle, but also store it in
a structure:
{
# ...
socket => $session,
}
Anno
------------------------------
Date: 19 Sep 2001 08:06:48 -0700
From: kiaya_halilah@yahoo.com (Kiaya)
Subject: only allowing characters from a list to be inputed
Message-Id: <e5340dbc.0109190706.f59ab28@posting.google.com>
We have a cgi form that inputs to a pipe-delimited file. We want to
prevent people from inputing symbols, hard returns, etc. which mess up
the flat file. We tried using:
elsif ($email !~ /A-Za-z,.\;'\/\@\-_/) {
$field="E-mail";
$character="E-mail";
&error;
exit(0);
}
But this is not working. Any ideas? We only want to allow A-Z a-z , .
; / @ - _ We should probably allow parenthesis also. Thanks, Kiaya
------------------------------
Date: 19 Sep 2001 08:24:09 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: only allowing characters from a list to be inputed
Message-Id: <m1lmjb8aqu.fsf@halfdome.holdit.com>
>>>>> "Kiaya" == Kiaya <kiaya_halilah@yahoo.com> writes:
Kiaya> We have a cgi form that inputs to a pipe-delimited file. We want to
Kiaya> prevent people from inputing symbols, hard returns, etc. which mess up
Kiaya> the flat file. We tried using:
Kiaya> elsif ($email !~ /A-Za-z,.\;'\/\@\-_/) {
Kiaya> $field="E-mail";
Kiaya> $character="E-mail";
Kiaya> &error;
Kiaya> exit(0);
Kiaya> }
Kiaya> But this is not working. Any ideas? We only want to allow A-Z a-z , .
Kiaya> ; / @ - _ We should probably allow parenthesis also. Thanks, Kiaya
If that's an email address, you must allow ANY character in the ASCII
character set. (Or my friends at <*@qz.to> and
<fred&barney@stonehenge.com> will get upset, and yes, those are valid
active addresses.) So, if that's not storable in your "flat file",
you've got a problem. Perhaps you can hex-encode your address,
or use a real database.
print for split "", "Just another Perl hacker,"
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
------------------------------
Date: Wed, 19 Sep 2001 16:41:06 +0200
From: "Stefan Weiss" <weiss@kung.foo.at>
Subject: Re: Perl English only??????
Message-Id: <1000910768.481348@newsmaster-04.atnet.at>
"Michael Carman" <mjcarman@home.com> wrote:
> Perl itself is English -- keywords, warning and error messages, etc. are
> all in English, as is the standard documentation. It's possible that
> someone has translated the docs to other languages, but I'm not aware of
> any instances of this.
Perl documentation in German:
http://perlwelt.horus.at/Doku/
Looks like the project hompage is currently under construction, but
it should be up again in a few days. At the moment we have ~15
translated documents in various stages of completion; you can take a
look at them here:
http://perlwelt.horus.at/cgi-bin/cvsweb/perldoku/de/
There's also a mailing list:
http://webmail.horus.at/cgi-bin/listinfo/perl-doku-deutsch
cheers,
stefan
------------------------------
Date: Wed, 19 Sep 2001 09:58:17 -0700
From: BCC <a@b.c>
Subject: Perl Image Voting software?
Message-Id: <3BA8CEA9.94EF3658@b.c>
Hi,
Does anyone have any leads on any perl scripts that allow users to vote
on a picture? Like a photo contest?
I have a client from a health and fitness site that wants users to be
able to vote on who has the best physique... :P
Thanks,
Bryan
------------------------------
Date: 19 Sep 2001 10:10:50 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: Perl Image Voting software?
Message-Id: <m11yl36r8l.fsf@halfdome.holdit.com>
>>>>> "BCC" == BCC <a@b.c> writes:
BCC> Does anyone have any leads on any perl scripts that allow users to vote
BCC> on a picture? Like a photo contest?
column - http://www.stonehenge.com/merlyn/WebTechniques/col59.html
Read the column first, then use the links below:
code - http://www.stonehenge.com/merlyn/WebTechniques/col59.listing.txt
demo - http://www.stonehenge.com/perl/amihooternot
print "Just another Perl hacker,"
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
------------------------------
Date: Wed, 19 Sep 2001 17:15:23 GMT
From: news@mikespub.net (Michel Dalle)
Subject: Re: Perl Image Voting software?
Message-Id: <9oak9b$esu$2@dackel.pdb.sbs.de>
In article <3BA8CEA9.94EF3658@b.c>, BCC <a@b.c> wrote:
>Hi,
>
>Does anyone have any leads on any perl scripts that allow users to vote
>on a picture? Like a photo contest?
>
>I have a client from a health and fitness site that wants users to be
>able to vote on who has the best physique... :P
>
>Thanks,
>Bryan
As usual, 'Randy' (?) Randal L. Schwartz has some interesting ideas
for you in one of his Web Techniques Columns. Check out the
"Simplified Voting - Am I Hot or Not?" article at :
http://www.stonehenge.com/merlyn/WebTechniques/col59.html
If learning Perl is not your thing, then :
a) you're not in the right newsgroup, and
b) you should have a look at :
http://cgi.resourceindex.com/Programs_and_Scripts/Perl/Survey_and_Voting/
HTH,
Michel.
--
Welcome to Mike's Pub
http://mikespub.net/forum/
------------------------------
Date: 19 Sep 2001 08:01:33 -0700
From: kiaya_halilah@yahoo.com (Kiaya)
Subject: Perl on CD-ROM
Message-Id: <e5340dbc.0109190701.772c03f5@posting.google.com>
Anyone know how to put Perl on a CD-ROM so that you can run scripts
off of it? I am making a CD-ROM that needs a search function
implemented on it. We would like to combine HTML and cgi so that the
CD-ROM will look exactly the same as the website archive. Thanks,
Kiaya
------------------------------
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.
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 1773
***************************************