[15628] in Perl-Users-Digest
Perl-Users Digest, Issue: 3041 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun May 14 09:08:47 2000
Date: Sun, 14 May 2000 06:05:09 -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: <958309509-v9-i3041@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Sun, 14 May 2000 Volume: 9 Number: 3041
Today's topics:
[Perl] How to find the Perl FAQ <rootbeer&pfaq*finding*@redcat.com>
Re: alarm problem <beaumontsystems@netscapeonline.co.uk>
Any body know how I access serial ports(unix) <stephen@oxnee.com>
Re: Better way to do this? <lr@hpl.hp.com>
Re: Execute permissions of a directory <lr@hpl.hp.com>
Re: Execute permissions of a directory <lr@hpl.hp.com>
Re: extracting mails <thepoet1@arcormail.de>
Re: Files in subdirectories chris2037@my-deja.com
Re: Files in subdirectories <phill@modulus.com.au>
Re: Files in subdirectories chris2037@my-deja.com
Re: Formulaire et fichier attache <gellyfish@gellyfish.com>
Re: Guess what? the largest online book store Amazon.co <mc@backwoods.org>
Re: hash scalar value (Eric Bohlman)
Re: Help in Perl <thepoet1@arcormail.de>
Re: How do I get a user's home directory with NIS+? <shouck@bellatlantic.net>
How to replace "\" , HELP! <mmlai@sfu.ca>
JOB Domain Name Ordering Script <anne@robeson.screaming.net>
Location of Dictionaries, Encyclopadias and public doma <bay@datatap.com>
Problems with MySQL and DBD/DBI modules <webmaster@animationlibrary.com>
pure Perl Webserver with CGI & Win32::ODBC - I'm search <salvojr@rocketmail.com>
Re: Regular Expressions help malverian@hotmail.com
Re: Semantics of terminal /@/ and "@" (Was: Re: Help Ne (Ilya Zakharevich)
Re: Silencing module warnings. (Andrew Johnson)
Re: spoofing identity (SBoyV)
Re: Using Net::FTP in a subroutine <phill@modulus.com.au>
Re: where can i find perl? <thepoet1@arcormail.de>
Re: zen and the art of trolling [OT] (Blah)
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sun, 14 May 2000 10:22:43 GMT
From: Tom Phoenix <rootbeer&pfaq*finding*@redcat.com>
Subject: [Perl] How to find the Perl FAQ
Message-Id: <pfaqmessage958299843.15558@news.teleport.com>
Archive-name: perl-faq/finding-perl-faq
Posting-Frequency: weekly
Last-modified: 29 Apr 2000
[ That "Last-modified:" date above refers to this document, not to the
Perl FAQ itself! The last _major_ update of the Perl FAQ was in Summer
of 1998; of course, ongoing updates are made as needed. ]
For most people, this URL should be all you need in order to find Perl's
Frequently Asked Questions (and answers).
http://www.cpan.org/doc/FAQs/
Please look over (but never overlook!) the FAQ and related docs before
posting anything to the comp.lang.perl.* family of newsgroups.
For an alternative way to get answers, check out the Perlfaq website.
http://www.perlfaq.com/
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
Beginning with Perl version 5.004, the Perl distribution itself includes
the Perl FAQ. If everything is pro-Perl-y installed on your system, the
FAQ will be stored alongside the rest of Perl's documentation, and one
of these commands (or your local equivalents) should let you read the FAQ.
perldoc perlfaq
man perlfaq
If a recent version of Perl is not properly installed on your system,
you should ask your system administrator or local expert to help. If you
find that a recent Perl distribution is lacking the FAQ or other important
documentation, be sure to complain to that distribution's author.
If you have a web connection, the first and foremost source for all things
Perl, including the FAQ, is the Comprehensive Perl Archive Network (CPAN).
CPAN also includes the Perl source code, pre-compiled binaries for many
platforms, and a large collection of freely usable modules, among its
560_986_526 bytes (give or take a little) of super-cool (give or take
a little) Perl resources.
http://www.cpan.org/
http://www.perl.com/CPAN/
http://www.cpan.org/doc/FAQs/FAQ/html/
http://www.perl.com/CPAN/doc/FAQs/FAQ/html/
You may wish or need to access CPAN via anonymous FTP. (Within CPAN,
you will find the FAQ in the /doc/FAQs/FAQ directory. If none of these
selected FTP sites is especially good for you, a full list of CPAN sites
is in the SITES file within CPAN.)
California ftp://ftp.cdrom.com/pub/perl/CPAN/
Texas ftp://ftp.metronet.com/pub/perl/
South Africa ftp://ftp.is.co.za/programming/perl/CPAN/
Japan ftp://ftp.dti.ad.jp/pub/lang/CPAN/
Australia ftp://cpan.topend.com.au/pub/CPAN/
Netherlands ftp://ftp.cs.ruu.nl/pub/PERL/CPAN/
Switzerland ftp://sunsite.cnlab-switch.ch/mirror/CPAN/
Chile ftp://ftp.ing.puc.cl/pub/unix/perl/CPAN/
If you have no connection to the Internet at all (so sad!) you may wish
to purchase one of the commercial Perl distributions on CD-Rom or other
media. Your local bookstore should be able to help you to find one.
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
Comments and suggestions on the contents of this document
are always welcome. Please send them to the author at
<pfaq&finding*comments*@redcat.com>. Of course, comments on
the docs and FAQs mentioned here should go to their respective
maintainers.
Have fun with Perl!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Sun, 14 May 2000 08:56:48 +0100
From: "beaumontsystems" <beaumontsystems@netscapeonline.co.uk>
Subject: Re: alarm problem
Message-Id: <391e4e3a$1_2@plato.netscapeonline.co.uk>
Sorry, forgot to add that this is Perl 5.005_03 (ActiveState Build 522), on
Win98.
---
Andrew
beaumontsystems <beaumontsystems@netscapeonline.co.uk> wrote in message
news:391d9c7a_1@plato.netscapeonline.co.uk...
> I am having a problem using alarm().
> When I have the line...
> alarm(0);
> ... I get the error message...
> "The Unsupported function alarm function is unimplemented at line xxx".
> I cant figure out what this means. Ive looked at perldoc -f alarm.
> Any ideas/suggestions ?
>
> Andrew Fry
>
>
>
------------------------------
Date: Sun, 14 May 2000 22:21:44 +1000
From: Stephen Lohning <stephen@oxnee.com>
Subject: Any body know how I access serial ports(unix)
Message-Id: <391E9A58.5020A411@oxnee.com>
Does any body how how I can access serial ports on a linux
Redhat 5.2 machine.
Which CPAN module should I look for?
------------------------------
Date: Sun, 14 May 2000 00:35:55 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: Better way to do this?
Message-Id: <MPG.1387f73034f1a0c698aa7b@nntp.hpl.hp.com>
In article <f5ashsogc770k0q2nt6iej7j7pd9dsfr13@4ax.com> on Sun, 14 May
2000 00:20:38 -0400, Sydney Lu <slu_2@altavista.net> says...
> I have a string that I need to split into fields, with each field
> delimited by commas. I'd use split, but I don't want a comma that's
> inside a quote to be split.
...
> is there a faster and easier regexp that would do the same thing? This
> works, but it's messy, and really slow, which isn't good when I need
> to process 500 lines every time someone clicks on my Tk widget...
perlfaq4: "How can I split a [character] delimited string except when
inside [character]? (Comma-separated files)"
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Sun, 14 May 2000 00:02:11 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: Execute permissions of a directory
Message-Id: <MPG.1387ef4f42f05ea898aa79@nntp.hpl.hp.com>
In article <UEpT4.28400$PL4.565919@ozemail.com.au> on Sun, 14 May 2000
14:13:19 +1000, Susan Entwisle <sentwisle@ozemail.com.au> says...
...
> I have tried using the following code but it does not work:
It doesn't even compile properly.
> $matchcount=grep(/'/'/, $ARGV[0]);
You are trying to determine whether there is a slash in the string
$ARGV[0], using a regex. That regex is invalid. These are valid:
/\//
or, better (using a delimiter of your choice):
m!/!
In addition, grep() isn't the best tool, because it is designed to
select or count matching elements from a list, not a single scalar. You
can use a pattern match:
$matchcount = $ARGV[0] =~ m!/!;
or (better) the index() function:
$matchcount = index($ARGV[0], '/') >= 0;
> if ($matchcount)
As you don't use this variable elsewhere, you could simply write the
predicate expression between the parentheses, instead of storing the
result and testing it.
> {
> @sections=split(/'/'/, $ARGV[0]);
Wrong regex again. See above.
> foreach $currsection(@sections)
But I can't imagine why you are looping over the results of the split()
when you don't use the section in the loop, which is the same each time
through.
> {
> if (-d $ARGV[0])
> {
> if (-X $ARGV[0])
> {
> print "Directory with execute persmissions";
> }
> else
> {
> print "Directory does not have execute permissions";
> exit(1);
> }
> }
> else
> {
> print "Regular expression with / in it";
> last;
> }
> }
> }
> else
> {
> print "Normal Regular expression";
> }
Clean up the code until it compiles properly, and think through the
logic more clearly.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Sun, 14 May 2000 00:31:27 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: Execute permissions of a directory
Message-Id: <MPG.1387f626b5a092a198aa7a@nntp.hpl.hp.com>
[In the future, please follow Usenet protocols by placing the material
you are responding to *ahead of* your comments.]
In article <L5sT4.28528$PL4.569913@ozemail.com.au> on Sun, 14 May 2000
17:00:39 +1000, Susan Entwisle <sentwisle@ozemail.com.au> says...
> Must apologies I posted the wrong version of the code to the newsgroup it
> should have been:
Indeed you did, and got a lot of attention for it.
> # Prototype to testing directories for executable and regular expressions
> $matchcount=grep(/\//, $ARGV[0]);
> if ($matchcount)
> {
> @sections=split(/\//, $ARGV[0]);
> foreach $currsection(@sections)
> {
> if (-d $currsection)
It seems as if you are trying to determine the nature of segments of a
filepath. This won't work. Use complete partial paths that are
absolute, or relative to the current directory.
...
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Sat, 13 May 2000 15:07:24 +0200
From: Christian Winter <thepoet1@arcormail.de>
Subject: Re: extracting mails
Message-Id: <c2kjf8.91a.ln@usenet-autoren.de>
Jens Luedicke <jens@irs-net.com> schrob:
> How can I extract all mails
> from an mbox mail-folder into
> single files ?
Just read in the mbox file line by line and open a new
output file everytime "From somewone@somewhere" appears at line start
after an empty line.
e.g.
--------------------------------------------
#!/usr/bin/perl -w
use strict;
my $count=1;
my $last_empty = 1;
open(IN, "<mbox" or die $!;
open(OUT, ">mail$count") or die $!;
while(<IN>)
{
if($last_empty && /^From\s(.*\@.*)\s/ ) {
$count++;
$last_empty = 0;
close OUT;
open(OUT, ">mail$count") or die $!;
}
$last_empty = /^$/ ? 1 : 0;
print OUT $_;
}
close OUT;
close IN;
---------------------------------------------
If this script should be run not just one time, that is to make
a regular backup, the number of extracted messages should also
be stored somewhere so that files don't get overwritten and
$count is set to $NUMBER_OF_ALREADY_EXTRACTED_MAILS+1.
HTH
Christian
------------------------------
Date: Sun, 14 May 2000 07:46:35 GMT
From: chris2037@my-deja.com
Subject: Re: Files in subdirectories
Message-Id: <8fllkp$p13$1@nnrp1.deja.com>
Yes, I've tried that before posting. It's easier said than done. Don't
believe me? Try it. With each iteration of the loop, you have to keep
tagging on the subdirectory bits, use opendir with that, remember what
this it, then once you have reach the lowest level, you need to travel
back to where you first branched off, and repeat for all other
bracnches. For example:
/pub/staff/branch1/sub_dir/sub_sub_dir/sub_sub_sub_dir/sub_sub_sub_sub_dir
/pub/staff/branch2/sub_dir/sub_sub_dir/sub_sub_sub_dir/sub_sub_sub_sub_dir
etc...
Can't wait to see what you come up with :-)
In article <391e3c35_1@einstien.netscapeonline.co.uk>,
"beaumontsystems" <beaumontsystems@netscapeonline.co.uk> wrote:
> It's just a matter of using loops and subroutines (and recursion) to
descend
> down
> into the tree.
> Having determined the set of objects that exist in the top-level
directory,
> you
> need to test each one in turn to see if it is a directory (-d xxx),
and if
> it is,
> you can then do an opendir/readdir/closedir on this subdirectory.
>
> ---
> Andrew
>
> <chris2037@my-deja.com> wrote in message
news:8flcur$ffg$1@nnrp1.deja.com...
> > I have the following code which will list the files in a given
> > directory:
> >
> >
> > #!/usr/local/bin/perl
> >
> > $namev = "dir1";
> > $curdir = "/public/staff/usern";
> >
> >
> > opendir DH, "$curdir/$namev" or die "Can't open: $!";
> >
> > while ($namev = readdir(DH)) {
> > print "$namev\n";
> >
> > }
> > closedir(DH);
> >
> >
> > dir1 could have subdirectories which in turn can have
subdirectories...
> >
> > I have looked at perlfunc and perldoc, neither goes into this. Can
> > anyone help? Thanks.
> >
> >
> >
> >
> > Sent via Deja.com http://www.deja.com/
> > Before you buy.
>
>
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Sun, 14 May 2000 19:28:18 +1000
From: Peter Hill <phill@modulus.com.au>
Subject: Re: Files in subdirectories
Message-Id: <391E71B2.38BD@modulus.com.au>
chris2037@my-deja.com wrote:
>
> I have the following code which will list the files in a given
> directory:
>
[snip]
>
> dir1 could have subdirectories which in turn can have subdirectories...
>
[snip]
The module File::Find deals with recursive directory searches elegantly.
You might want to enable warnings (#!/usr/local/bin/perl -w) and
use strict additionally.
--
Peter Hill,
Modulus Pty. Ltd.,
http://www.modulus.com.au/
------------------------------
Date: Sun, 14 May 2000 11:03:08 GMT
From: chris2037@my-deja.com
Subject: Re: Files in subdirectories
Message-Id: <8fm159$3qn$1@nnrp1.deja.com>
Perfect! Thank you so much Peter.
In article <391E71B2.38BD@modulus.com.au>,
phill@modulus.com.au wrote:
> chris2037@my-deja.com wrote:
> >
> > I have the following code which will list the files in a given
> > directory:
> >
> [snip]
> >
> > dir1 could have subdirectories which in turn can have
subdirectories...
> >
> [snip]
> The module File::Find deals with recursive directory searches
elegantly.
> You might want to enable warnings (#!/usr/local/bin/perl -w) and
> use strict additionally.
> --
> Peter Hill,
> Modulus Pty. Ltd.,
> http://www.modulus.com.au/
>
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: 13 May 2000 11:43:05 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Formulaire et fichier attache
Message-Id: <8fjbjp$8su$1@orpheus.gellyfish.com>
On Sat, 13 May 2000 09:14:04 +0200 Luc-Etienne.Brachotte wrote:
> Fabien Quesnel a écrit :
>
>> Voila mon problème :
>> J'ai besoin d'offrir à mes visiteurs la possibilité d'envoyer par mail leur
>> CV en .doc.
>>
>> J'ai un champ Input="FILE" dans mon formulaire. Je fait "parcourir," je
>> choisi mon fichier, j'obtient donc (par ex) :
>> c:\mesdocs\toto.doc dans le champ du formulaire.
>>
>> Or, à la réception de mon mail, j'obtient cette ligne, mais pas le fichier
>> attaché !
>>
>> J'ai essayé des tas de scripts PERL, mais aucun ne prend en compte ce type
>> de champ si particulier !! Pourtant, les formulaires des services Yahoo ou
>> Hotmail par ex, permettent d'envoyer des fichiers attachés par mail !! Alors
>> ?
>>
>> Cela fait 2 jours que je cherche, PLEAAAASSSEEE !!!!
>
> Le transferts des données de la page au script se fait
> -- soit par "GET"
> $buffer = $ENV{QUERY_STRING};
>
> -- soit par "POST"
> Le script obtiendra les données par
> read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
>
> Et pour tester:
> if ($ENV{'REQUEST_METHOD'} eq 'GET')
> {
> $buffer = $ENV{QUERY_STRING};
> }
> else
> {
> read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
> }
>
>
Uh.
use CGI;
use MIME::Lite;
/J\
--
Uh huh. Uh huh. Okay. Um, can you repeat the part of the stuff where
you said all about the...things? Uh... the things?
--
fortune oscar homer
------------------------------
Date: Sun, 14 May 2000 07:50:48 -0400
From: MC <mc@backwoods.org>
Subject: Re: Guess what? the largest online book store Amazon.com
Message-Id: <391E9318.CBA96AFA@backwoods.org>
Thats interesting (amazon) because I ordered Programming the Perl DBI from them
about a month ago and had it in two days no problem. I have NEVER had a problem
from Amazon.
MC
"L. Monroy" wrote:
>
> I also found readmedoc.com have a good selection of technical books and they
> are slightly cheaper then bookpool.com.
>
> "Paul R. Andersen" wrote:
>
> > I don't want to sound like an advertisement cause I have no interest in
> > this place but we have found generally better prices and availability on
> > technical books through bookpool.com, YMMV.
> >
> > Paul
> >
> > Freelancer wrote:
> >
> > > I told our secretary order two O'Reilly books Java Enterprise in a
> > > Nutshell and
> > > Programming the Perl DBI for me. She ordered from Amazon.com instead
> > > O'Reilly.
> > > Guess what? She got replied said Amazon only has 1 book each on their
> > > stock,
> > > so they could not sell those two books to us any more. (^0^)
> > >
> > > BTW, Amazon.com is the largest online book store in the world.
> >
> > --
> > Paul Andersen
> > -- I can please only ONE person per day.
> > -- Today is NOT your day.
> > -- Tomorrow isn't looking good either.
------------------------------
Date: 14 May 2000 12:55:56 GMT
From: ebohlman@netcom.com (Eric Bohlman)
Subject: Re: hash scalar value
Message-Id: <8fm7os$22s$1@slb6.atl.mindspring.net>
Luc-Etienne.Brachotte (Luc-Etienne.Brachotte@wanadoo.fr) wrote:
: I have a hash %test with 2921 pairs in the form of
: string => small integer
:
: Recently I tried the following
:
: $test=%test;
: print "$test\n";
:
: It prints
: 2157/4096
That means the hash has 4096 buckets available, of which 2157 are in use.
Since you have 2921 keys, looking up a key involves determining the key's
bucket (a single computation) and then making 1.35 comparisons on
average. If 2921 buckets were in use, you'd have a "perfect hash" where
everything could be found with only one comparison; if only one bucket
were in use, you'd have a degenerate hash where looking up a key was as
expensive as searching a linear list.
------------------------------
Date: Sat, 13 May 2000 14:37:28 +0200
From: Christian Winter <thepoet1@arcormail.de>
Subject: Re: Help in Perl
Message-Id: <8aijf8.2c9.ln@usenet-autoren.de>
ringo <ringo@ringo.net.ru> schrob:
> Have anybody script to daily rotate of some .html pages.
> Please help!!!
I've done this on my homepage, hope I get it right, as I don't have
it here:
------------------------------------------------------------------------
#!/usr/bin/perl -w
use strict;
opendir(NEWDIR, "/dir/with/new/pages");
LOOP: while(readdir(*NEWDIR))
{
next LOOP if /^\.+$/;
if( strftime("%d",(stat("/dir/with/new/pages/$_"))[9]) >
strftime("%d",(stat("/dir/with/actual/pages/$_"))[9]) )
# compare modification times of new and old file.
# stat($file) returns an array of file characteristics,
# see "perldoc -f stat" for that. (stat($file))[9] (mtime)
# should work on all systems except a few linux machines
# with broken libc6.
{
system("cp /dir/with/actual/pages/$_ /dir/for/backup/$_") or die $!;
# on win: "copy \\dir\\with\\actual\\pages\\$_ \\dir\\for\\backup\\$_"
# Directory delimiters on win always should be set to "\\", even if
# some modules do an automatic conversion.
system("cp /dir/with/new/pages/$_ /dir/with/actual/pages/$_") or die $!;
unlink("/dir/with/new/pages/$_") or die $!;
}
}
-------------------------------------------------------------------------
> answer on my email, pls
public question, public answer. That's the way usenet works.
HTH
Christian
------------------------------
Date: Sun, 14 May 2000 08:48:03 GMT
From: Scott Houck <shouck@bellatlantic.net>
Subject: Re: How do I get a user's home directory with NIS+?
Message-Id: <oupshs0h31k20q88ir3uhr90nbhsn2q312@4ax.com>
This is true. I wasn't suggesting it was robust, I was just playing
around with niscat to see what I got back. I saw some Perl NIS+
modules, so I thought perhaps someone could give me an example using
that. OTOH, it's probably sufficient to use the HOME environment
variable. I should have thought of that! (duh... :-)
abigail@foad.org (Abigail) wrote:
>On Sun, 14 May 2000 06:41:23 GMT, Scott Houck <shouck@bellatlantic.net> wrote:
>++ I have a Perl program where I'd like to store options the user wants
>++ to save in a .dot file in their home directory. This is on Solaris
>++ 2.6 with NIS+, so I can't use getpwent. I know almost nothing about
>++ NIS+, but this sounds like a common task. From browsing through the
>++ manpages, I figured out a brute force way to get it, but it probably
>++ isn't very efficient, and I'm not sure it will always work:
>++
>++ $user = `whoami`;
>++ $nisinfo = `niscat passwd.org_dir | grep $user`;
>++ $home_dir = (split /:/, $nisinfo)[5];
>++
>++ Is there a better way to do this?
>
>
>Well, that's going fail if you have usernames that are substrings of
>other user names, or substrings of (encrypted) passwords, comments,
>shells or home directories.
>
>Imagine what can happen to an account named "home"!
>
>Most shells will set the HOME environment variable.
>
>Of course, the question has not much to do with Perl. You might want to
>ask in a Solaris group.
>
>
>
>Abigail
------------------------------
Date: 14 May 2000 10:01:22 GMT
From: Murvin Ming-Wai Lai <mmlai@sfu.ca>
Subject: How to replace "\" , HELP!
Message-Id: <8flthi$aht$1@morgoth.sfu.ca>
HI,
Thanks all for the help. However, I should describe the problem I have
right now clearly.
I have a page that contains a form with file field. Therefore, user can
choose a file from his/her computer and upload to the server. The problem
I have is that if user upload a file from Windows, the file field name
will be something like this: C:\Directory\File. This string (with
other information )will pass to the perl script as STDIN when user click
"submit". Therefore, my perl script will get the symbol \ from user and I
have no control on what the user input is. Because the \ has a very
special usage in perl, I have difficulty to get rid of it. The reason I
want to do get rid or recognize \ is that I want to extract the file name
or directory name from this input string. Therefore, I have to look for
the sub-string inside the two \ s or after the last \ . As I said, since
I don't have control on how the input file name (with path) looks like, I
don't know what I can do. One of the ideas I have right now (and I have
mention in last reply) is that I run a javascript before submission. This
javascript will convert all \ to / . However, I still have to investigate
on it. I'm not quite sure whether it is a good way. For now, I still
want to know how to solve it in perl. Thanks all. =)
--
.........................................................................
*>>>>Murvin Lai<<<< >>>>--Muffin--<<<< email: murvin_lai@sfu.ca *
*homepage: http://www.sfu.ca/~mmlai mmlai@sfu.ca *
`````````````````````````````````````````````````````````````````````````
------------------------------
Date: Sun, 14 May 2000 11:56:02 +0100
From: "Anne" <anne@robeson.screaming.net>
Subject: JOB Domain Name Ordering Script
Message-Id: <391e8607@news.server.worldonline.co.uk>
We are looking for a totally automated domain name ordering script which
will do
online whois
purchase multiple domains in one application
take payment online with a credit card clearing company
applies for the domain at the nic
sets up email, web forwarding or creates a biz card place holder
We are in need of this quickly so we would like to find someone who knows of
a script which has the majority of these features or has done one before.
Please reply as soon as possible with your offering
Thanks
Hannah
------------------------------
Date: Sun, 14 May 2000 02:51:40 -0700
From: "bay" <bay@datatap.com>
Subject: Location of Dictionaries, Encyclopadias and public domain books in ASCII format on line?
Message-Id: <shstgvuvje426@corp.supernews.com>
I'm interested in developing educational applications that will use
dictionaries (with definitions not just for spelling), Encyclopedias and
literature that is in ASCII or RLDBMS formats?
Will appreciate follow-ups to this post for URL's or Newsgroups for quality
dictionaries, encyclopedias and literature on line.
tia,
jb
------------------------------
Date: Sun, 14 May 2000 07:45:21 -0400
From: "Yevgeniy Leshchinskiy" <webmaster@animationlibrary.com>
Subject: Problems with MySQL and DBD/DBI modules
Message-Id: <8fm3l4$jq1$1@bob.news.rcn.net>
Hi everybody,
I have installed MySQL on my server a little while ago, and I have also
installed the DBI and DBD:MySQL modules. However, when I tried to use a file
which connects to MySQL, I got the following error:
[yl@fubar cgi-bin]$ perl test2.pl
install_driver(mysql) failed: Can't locate loadable object for module
DBD::mysql
in @INC (@INC contains: /usr/lib/perl5/5.00503/i386-linux
/usr/lib/perl5/5.0050
3 /usr/lib/perl5/site_perl/5.005/i386-linux /usr/lib/perl5/site_perl/5.005
.) at
(eval 1) line 3
Perhaps a module that DBD::mysql requires hasn't been fully installed
at test2.pl line 5
Does anyone know what it means and how to fix it?
I hope to hear from you soon.
Sincerely,
Yevgeniy Leshchinskiy
webmaster@animationlibrary.com
Animation Library
http://www.animationlibrary.com
------------------------------
Date: Sun, 14 May 2000 13:04:54 +0200
From: "Salvo Jr" <salvojr@rocketmail.com>
Subject: pure Perl Webserver with CGI & Win32::ODBC - I'm searching
Message-Id: <8fm12f$noh$2@nslave1.tin.it>
can anyone help me to find a pure Perl Webserver with CGI & Win32::ODBC
support (under Win9x)?
I tried "MacPerl" webserver and "HTTPD" webserver but Win32::ODBC don't work
Thank You
Salvo Jr
salvojr@rocketmail.com
------------------------------
Date: Sun, 14 May 2000 12:27:59 GMT
From: malverian@hotmail.com
Subject: Re: Regular Expressions help
Message-Id: <8fm647$8r1$1@nnrp1.deja.com>
In article <slrn8hshm7.92f.abigail@ucan.foad.org>,
abigail@arena-i.com wrote:
> That isn't going to produce the effect you want, because ^ has a
> special meaning in regular expressions.
I know that was just an example...
> If you are looking for fixed strings, use index():
>
> unless (index ($variable, "^$thing^") < 0) {
> print "Good! It is good!";
> }
> else {
> print "No! It's badddd!";
This seems work work, thanks for all of your help.
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: 14 May 2000 07:28:17 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Semantics of terminal /@/ and "@" (Was: Re: Help Needed - Perl Matching Operator)
Message-Id: <8flkih$km8$1@charm.magnus.acs.ohio-state.edu>
[Finally, this message arrived to our server...]
[A complimentary Cc of this posting was sent to Larry Rosler
<lr@hpl.hp.com>],
who wrote in article <MPG.13835855eb54f46a98aa4e@nntp.hpl.hp.com>:
> I cannot find a positive statement about what "@" means, and
> unfortunately "@" behaves differently from "$" (which causes a syntax
> error), for no apparent reason. But /$/ has specific semantics because
> $ is a regex metacharacter
... time to time ;-)
> , while /@/ does not; in that context,
> different behavior is understandable.
>
> I would go by this excerpt from perlop:
>
> For constructs that do interpolate, variables beginning with ``$'' or
> ``@'' are interpolated ...
As Mike note already, this excerpt is wrong: special arrays do not
interpolate:
perl -wle '@, = (1..5); print "@,"'
@,
I managed to squeeze many patches which enable warnings/errors on such
previously undefined/misdocumented through p5p, but these two are out
of question. At least Larry knew about the second one, and I found
the first one after discovering "@" in my program and going into C
debugger to understand why it works OK...
Ilya
------------------------------
Date: Sun, 14 May 2000 08:58:21 GMT
From: andrew-johnson@home.com (Andrew Johnson)
Subject: Re: Silencing module warnings.
Message-Id: <NUtT4.12526$95.170075@news1.rdc1.mb.home.com>
In article <391D829A.C31C154B@ce.mediaone.net>,
Andrew N. McGuire <anmcguire@ce.mediaone.net> wrote:
> Steve wrote:
> >
> > What you're talkin about isn't a warning it's the standard
> > output from that process. You can probably change this
> > behaviour, but you'll have to read the docs first.
>
> No, I have read the docs, it is coming from a specific
> warn() call inside the Find.pm module. I do not want to
> alter the module, I want to squash the warnings from the
> module, by redirecting the STDERR. I have found a way
Rather than redirecting STDERR you could also override
File::Find's warn() function with your own no-op version:
#!/usr/bin/perl -w
use strict;
package File::Find;
use subs 'warn';
sub warn {}
package main;
use File::Find;
# your remaining 'find' script...
This reaches in and diddles with the package, but leaves STDERR
available for other diagnostic messages in your script.
regards,
andrew
--
Andrew L. Johnson http://members.home.net/andrew-johnson/epwp.html
Some people, when confronted with a problem, think 'I know,
I'll use regular expressions.' Now they have two problems.
-- Jamie Zawinski, on comp.lang.emacs
------------------------------
Date: Sun, 14 May 2000 10:17:49 GMT
From: you_know_who_am_i@hotmail.com (SBoyV)
Subject: Re: spoofing identity
Message-Id: <391e7bf7.2553819@news.club-internet.fr>
Hello All
"blah80" <*nospam*blah80@hotmail.com> wrote:
>I know people have bots hitting sites all the time and
>they solve this. How do they do that?
They don't post silly questions in newsgroups.
--
SBoyV
------------------------------
Date: Sun, 14 May 2000 19:50:18 +1000
From: Peter Hill <phill@modulus.com.au>
Subject: Re: Using Net::FTP in a subroutine
Message-Id: <391E76DA.7877@modulus.com.au>
juump@my-deja.com wrote:
>
> Using Net::FTP, I've written a simple script to crawl an FTP server
> looking for certain files. I think this should be doable with a single
> FTP connection, since the subroutine that checks the files in each
> directory only needs to look at the directory one time.
>
> What I thought I could do was open the connection in the main part of
> the script, and then refer to $ftp (my FTP socket) in the subroutine.
> However, the subroutine does not recognize $ftp as anything at all. (The
> command $ftp->cwd(...) fails in the subroutine.)
>
> I'm pretty new to Perl, but I thought variables and objects were global
> unless declared otherwise.
>
> So what I've had to do is create a new Net::FTP socket each pass through
> the subroutine, which through recursion really bogs down the server
> until it no longer accepts new connections. (Although I close/quit the
> socket before I start the recursion.)
>
> How do I get the subroutine to recognize an FTP socket created in the
> main part of the script? Do I need to pass $ftp as a parameter to the
> subroutine? And is there some lag between the time I call "$ftp->close;
> $ftp->quit;" and the time the server actually closes the connection?
I can't see anything wrong with your basic approach, but then again I
also can't see your code. There is no reason why you can't create a
global $ftp which is visible within subroutines. Post some code.
--
Peter Hill,
Modulus Pty. Ltd.,
http://www.modulus.com.au/
------------------------------
Date: Sat, 13 May 2000 14:46:45 +0200
From: Christian Winter <thepoet1@arcormail.de>
Subject: Re: where can i find perl?
Message-Id: <lrijf8.2c9.ln@usenet-autoren.de>
cdgdgjgjd@dydydhy.com schrob:
> where can i find perl?
in a shell?
or maybe also on www.perl.org, for win on www.activestate.com.
Yours
Christian
P.S.:
A real name for real people is a nice thing to have.
------------------------------
Date: 14 May 2000 08:57:20 GMT
From: blah@blah.vom (Blah)
Subject: Re: zen and the art of trolling [OT]
Message-Id: <8F34181A8mbadolatocybernoxcom@206.165.3.80>
nj_kanda@alcor.concordia.ca (Neil Kandalgaonkar) wrote in
<8fl38k$an7$1@newsflash.concordia.ca>:
>In article <391D0DCF.FA1529F2@west.net>, John Callender
><jbc@west.net> wrote:
>she's overcome a lot of hurdles, including mental health problems,
She didn't overcome the mental health problems, as is evident in her
postings/ramblings every day.
------------------------------
Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 16 Sep 99)
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: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.
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 V9 Issue 3041
**************************************