[8186] in Perl-Users-Digest
Perl-Users Digest, Issue: 1804 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Feb 4 07:07:31 1998
Date: Wed, 4 Feb 98 04:00:28 -0800
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, 4 Feb 1998 Volume: 8 Number: 1804
Today's topics:
'require' dir same as app's? (Craig Berry)
?redirection by several menu choices & one form? <pmthomas@concentric.net>
Re: can variables be generated on the fly <rjk@coos.dartmouth.edu>
Re: can variables be generated on the fly (Chip Salzenberg)
Re: can variables be generated on the fly (Brendan O'Dea)
Can't log on to Active Messaging Library in NT timed jo (Markus Laker)
eval FAQ??? Hardest part of perl to figure out (Chris Sherman)
Re: Help on Perl on Win32 with ODBC32 <e.christensen@netjob.dk>
HELP! <glowatts@eatel.net>
Re: How Do I Tell Whether a Key Is Valid for an Associa (Martien Verbruggen)
Is this correct? File Locking <bill@fathead.net>
KERMIT <patrick@husi.ch>
killing a child process after a timeout <troostwyk_rajan@jpmorgan.com>
Re: Perl and Databases <mishra.aditya@emeryworld.com>
Perl and DBM problem <rodion@incoma.ru>
Re: perl and file system <fabrice.gonton@aigf.sncf.fr>
Perl for win-32 Subrat_Ghosh@inf.com
Perl Net::FTP error from Linux upgrade <guertin@middlebury.edu>
Rename a directory not empty <mauro@franchisetech.com>
Re: Rename a directory not empty (Honza Pazdziora)
Re: Retrieving remote page using CGI Script (Francois Trousset)
searching by file creation/modification date? <jess@links.magenta.com>
Re: sending mail from html-form? (Martin Vorlaender)
Re: set up perl on my win95 system (sorry, rageclan.geo <rsgdata@worldnet.fr>
Re: setlocale warnings (Martien Verbruggen)
Re: solution for multiline comments??? <rjk@coos.dartmouth.edu>
Re: solution for multiline comments??? (Chip Salzenberg)
Re: Survival Of perl <rjk@coos.dartmouth.edu>
Re: TYP21D (was: substitute...) (Chip Salzenberg)
Using Bcc header in perl mail script (David Staschover)
Who can give me a Pl. cgi example on NT to change Linux <mrlee@cycloria.com.tw>
Re: Win32 CGI compiler ? <mishra.aditya@emeryworld.com>
Re: Win32 CGI compiler ? <rsgdata@worldnet.fr>
Re: Word -> HTML <internet@reimer.ch>
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 4 Feb 1998 07:43:14 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: 'require' dir same as app's?
Message-Id: <6b966i$r43$1@marina.cinenet.net>
I'm bulding a fairly complex app incrementally in response to feature
requests and the like, and have hit a problem in my attempt to partion
the app into multiple files (purely for convenience and config control).
I have a main file 'foo' which does 'require bar.pl' to yank in some
additional functions. I know I should probably use 'use' instead, and
likely will soon, but as I said, this is an incremental development
situation, and require got the job done for the moment.
Now, the problem: When run from the directory containing the two source
files mentioned above, all is well. However, when run from any other
dir, the 'require' can't find 'bar.pl'. Now, obviously, that's because
the dir where my app lives isn't in @INC, nor should it be in general.
However, I'd love to convey to Perl the idea 'look in the same dir you
got the current file from' without having to fall back on 'require
/path/to/bar.pl', which I'm doing now as a stopgap.
So, what should I do?
---------------------------------------------------------------------
| Craig Berry - cberry@cinenet.net
--*-- Home Page: http://www.cinenet.net/users/cberry/home.html
| Member of The HTML Writers Guild: http://www.hwg.org/
"Every man and every woman is a star."
------------------------------
Date: Wed, 04 Feb 1998 01:36:51 -0500
From: pmthomas <pmthomas@concentric.net>
Subject: ?redirection by several menu choices & one form?
Message-Id: <34D80C83.734E17C9@concentric.net>
Hello,
I have committed myself to learning perl as I come to know the power of
the scripting language. However, a newbie I still am while
simultaneously knowing that someone has probably already done what I
would like to accomplish. I am hoping there is a script out there that
will do the following and, if anyone can point me to it, I would be
extremely happy!
I hate having to click a million times to ultimately reach one page. I
would like to use a form to do a single jump by navigating through a
path that is constructed by the user making several choices in one
form. Each choice would take them one level deeper down a subdirectory
path and ultimately point to a single page. What I have is a site that
has repeated (or similar) subdirectory structures under differing top
level directories. I would like to be able to provide visitors to the
site the ability to navigate to a single index.html by choosing several
dropdown menus in one form that construct the url. They would choose
the top level directory from one menu (hopefully that choice would limit
the choices then available from the remaining menus) and the several
options that would navigate them down a subdirectory path from other
dropdowns that would, on processing, lead the server to return a single
index.html from the deepest level of the directory path they have
constructed using the dropdown menus.
Essentially I would like to be able to construct a url from those
several menu choices the processing server would then read to return a
single index page. I imagine this is best done through a database but I
don't know perl and don't yet know how to put the elements together to
accomplish such a thing. I know there are redirectors that accomplish
the feat by allowing users to choose the predefined url from a list of
choices but is there a redirecting script available that would construct
the url from several menu choices? Sorry for the redundancy in the
description, I am not fully cognizant of the terminology and want to be
sure my idea comes across.
If anyone can help me or point me to such a script, it would be a HUGE
help - big enough to prompt my posting to the group using an
unadulterated spammable email address for a cc.
TIA
Paul Thomas
------------------------------
Date: Wed, 04 Feb 1998 01:24:30 -0500
From: Chipmunk <rjk@coos.dartmouth.edu>
Subject: Re: can variables be generated on the fly
Message-Id: <34D8099F.DFF421BE@coos.dartmouth.edu>
Chip Salzenberg wrote:
>
> According to aml@world.std.com (Andrew M. Langmead):
> >
> >Well, its a little easier to turn input into a soft reference than a
> >hard reference. To get the hard reference, you have to set some sort
> >of mapping between string and the reference.
> >
> >%hash = (sub_a => \&sub_a, sub_b => \&sub_b);
>
> Any place you would say
>
> $ref = $input;
>
> Just say:
>
> $ref = do { no strict 'refs'; \$$input };
>
> Yes, it's a bit tedious, but it allows you to C<use strict> for the
> rest of the program, and that's definitely worth the effort.
In which case you're back to using soft references. I thought the point
of this thread was that you should avoid using soft references. :-P
Chipmunk
------------------------------
Date: Wed, 04 Feb 1998 07:00:05 GMT
From: chip@mail.atlantic.net (Chip Salzenberg)
Subject: Re: can variables be generated on the fly
Message-Id: <6b93ot$taj$1@cyprus.atlantic.net>
According to rjk@coos.dartmouth.edu:
>Chip Salzenberg wrote:
>> $ref = do { no strict 'refs'; \$$input };
>
>In which case you're back to using soft references. I thought the point
>of this thread was that you should avoid using soft references. :-P
In the specific cases where soft references work and are correct, the
example I give allows their use to be carefully circumscribed. That
was all I intended to demonstrate.
Of course, using the hash trick { foo => \$foo } is more appropriate
in most cases, since it protects against unexpected names.
--
Chip Salzenberg - a.k.a. - <chip@pobox.com>
"Boy, is it ever dark." "I hope they don't get a moonburn." // MST3K
-> Ask me about Perl training and consulting <-
Like Perl? Want to help out? The Perl Institute: www.perl.org
------------------------------
Date: 4 Feb 1998 19:51:17 +1100
From: bod@compusol.com.au (Brendan O'Dea)
Subject: Re: can variables be generated on the fly
Message-Id: <6b9a65$neh$1@duende.compusol.com.au>
In article <34D8099F.DFF421BE@coos.dartmouth.edu>,
Chipmunk <rjk@coos.dartmouth.edu> wrote:
>Chip Salzenberg wrote:
[snip]
>> Any place you would say
>>
>> $ref = $input;
>>
>> Just say:
>>
>> $ref = do { no strict 'refs'; \$$input };
>>
>> Yes, it's a bit tedious, but it allows you to C<use strict> for the
>> rest of the program, and that's definitely worth the effort.
>
>In which case you're back to using soft references. I thought the point
>of this thread was that you should avoid using soft references. :-P
You use:
$ref = eval "\\\$$input";
instead, which works even if $input contains the name of a lexical (my)
variable.
Regards,
--
Brendan O'Dea bod@compusol.com.au
Compusol Pty. Limited (NSW, Australia) +61 2 9809 0133
------------------------------
Date: Wed, 04 Feb 1998 11:16:32 GMT
From: sneezy@contax.co.uk (Markus Laker)
Subject: Can't log on to Active Messaging Library in NT timed job
Message-Id: <34d834d1.410001571@mahler>
I've written a Perl script that uses the Active Messaging Library to
send mail from the command line, much like the sendmail.exe that comes
with Exchange 4. (I've released it under the GNU Public License and
put a copy at <http://www.contax.co.uk/temp/sendmail.pl>, in case
anyone else has a use for it.)
The script works if I'm logged on as myself, SOUTH\MSL. It works if I
use 'su' to to run it as an administrator. It works if I run while
logged on as an administrator. But if I try to send mail from a timed
job, the script fails to log on to MAPI. (My schedule service logs on
as an administrator, using the same logon ID as I tried in the
previous steps.)
So I have two questions:
1. One for the Microsoft groups: what is special about timed jobs that
stops me logging on to MAPI? Is there a way round it?
2. One for the Perl group: is there a way of getting useful error
returns from Win32::OLE.pm so that I can get a better idea of what's
going on?
--
This email address is genuine but it will be changed as soon as
it starts to receive email spam.
------------------------------
Date: Wed, 4 Feb 1998 06:13:22 GMT
From: sherman@unx.sas.com (Chris Sherman)
Subject: eval FAQ??? Hardest part of perl to figure out
Message-Id: <EnuByA.Mvo@unx.sas.com>
I'm usually ok with eval, but sometimes I just can't figure why it
doesn't work the way I want it to sometimes.
Does anyone of an eval FAQ or an eval cookbook of, say, 50 different ways
of using eval in all kinds of different situations? Even a "top 10 things
to remember when putting together an eval line"-type thing would be
great...
I've again blown a large amount of time working on a single eval line. I
finally (Finally!!) got something that works. Seems obvious now, but I
must of tried dozens different combinations of things before this one
finally worked.
eval "\$some_var = \"$fred\"";
or
$some_var = eval "\"$fred\"";
I haven't found a way of using the block version of eval (that is,
using curly braces).
$fred is set to something that looks like "os_$reg->{OSNAME}" (which
is an entry in a config-like structure) which I then want expand to
something like "os_hpux", which is then used to dereference another part
of the config structure.
I got it to work pretty quickly of the variable "$reg->{OSNAME}" was the
only thing in $fred, but I couldn't get it to expand for "os_$reg->{OSNAME}".
The trick (this time!) was the \" (back-slash double-quotes) around $fred.
It wouldn't work (for some reason) otherwise.
Sometimes, I think eval is just black magic, and is the hardest part of
perl to get my mind around. ;-)
Any help is great appreciated....
--
____/ / / __ / _ _/ ____/
/ / / / / / / Chris Sherman
/ ___ / _/ / /
_____/ __/ __/ __/ _\ _____/ _____/ sherman@unx.sas.com
------------------------------
Date: Wed, 04 Feb 1998 11:51:22 +0100
From: Ernst <e.christensen@netjob.dk>
Subject: Re: Help on Perl on Win32 with ODBC32
Message-Id: <34D8482A.5BEF@netjob.dk>
Steve Linberg wrote:
>
> In article <01bd30cb$6b3c9a30$190d47a5@rasokol>, "Alex Sokol"
> <asokol@jhancock.com> wrote:
>
> > I just installed Perl 5 Win32 by ActivateState, build 315 and
> > ODBC32 version 970208 to connect to my MS SQL server.
> >
> > I use "use Win32::ODBC"
> >
> > when i start up my script i get an error (text is not exact):
> > "Can not locate module Win32/ODBC.pm"
>
> Standard stupid questions here: are you sure you put the OBDC module in
> the right place, and ODBC.pll? That would be the main culprit in my
> mind. The readme file explains where they go.
>
> --
> Steve Linberg | National Center on Adult Literacy
> Systems Programmer etc. | University of Pennsylvania
> linberg@literacy.upenn.edu | http://www.literacyonline.org
I have had the same problem. In the ODBC FAQ and other newsgroups state
that the problem is that the version of Perl and ODBC is not matching.
reg
------------------------------
Date: Tue, 03 Feb 1998 16:57:09 -0800
From: "Glen O. Watts" <glowatts@eatel.net>
Subject: HELP!
Message-Id: <34D7BCDF.C777D099@eatel.net>
I am trying to use a cut-and-paste script for verifying authorization
codes. The user (subscriber) enters his authorization code into a form
and it is then matched against a list of valid authorization codes. The
script works just fine until it attempts to open the file that contains
the valid codes ($webfile) as shown below:
unless (open (WEB, "+<$webfile")) { &system_error ("Could
not open web data file $webfile.\n"); exit;} (there is
more, of course...)
I have tried changing permissions in my FTP program and as far as I can
tell "$webfile" is properly defined in earlier expressions, although I
have not been able to determine what "WEB" is supposed to represent (the
first expression of the actual script is $WEBLEN = 8; ---if that means
anything.) The curious thing is that I can access this file directly
as an end-user when I set the permissions to allow it, which makes me
think there is a problem with the "+<" in front of "$webfile" (also,
the error message actually given when running the script is "Could not
open web data file +" instead of "Could not open web data file
/filepath/filename.") I have spent entirely too much time on this
problem, and need to get on with my life! Please post a response or
email me if you can help. THANKS!
------------------------------
Date: 4 Feb 1998 05:40:18 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: How Do I Tell Whether a Key Is Valid for an Associative Array?
Message-Id: <6b8v02$5lh$1@comdyn.comdyn.com.au>
In article <6b7v8f$ogb@sf18.dseg.ti.com>,
simonsen_nospam@skopen.dseg.ti.com (Kevin M Simonson) writes:
> I also noticed that there's no reference to function "exists" in ei-
> ther of the two reference books on Perl (both by Randal Schwartz) I have at
> my disposal. Is "exists" not a part of standard Perl?
What sort of perl are you running onthe machine where nothing works?
perldoc -f exists
=item exists EXPR
Returns TRUE if the specified hash key exists in its hash array, even
if the corresponding value is undefined.
print "Exists\n" if exists $array{$key};
print "Defined\n" if defined $array{$key};
print "True\n" if $array{$key};
A hash element can be TRUE only if it's defined, and defined if
it exists, but the reverse doesn't necessarily hold true.
Note that the EXPR can be arbitrarily complicated as long as the final
operation is a hash key lookup:
if (exists $ref->[$x][$y]{$key}) { ... }
Martien
--
Martien Verbruggen | My friend has a baby. I'm writing down
Webmaster www.tradingpost.com.au | all the noises the baby makes so later
Commercial Dynamics Pty. Ltd. | I can ask him what he meant - Steven
NSW, Australia | Wright
------------------------------
Date: Tue, 3 Feb 1998 23:23:37 -0600
From: "Bill Genzer" <bill@fathead.net>
Subject: Is this correct? File Locking
Message-Id: <6b8udl$4h$1@news1.iamerica.net>
I'm still new at CGI and I've looked at several different FAQs trying to
figure out file locking and I think I finally got it, this is a broken down
version of what I'm doing, I just wanted to make sure it looks correct.
open (FILE,">$filepath");
#Lock File Before Updating
flock(FILE,2);
seek(FILE, 0, 2);
print FILE "$FORM{'datafield'}\n";
#UnLock File After Updating
flock(FILE,8);
CLOSE(FILE);
Does it matter where you lock and unlock the file? (either before or after
you open or close the file?) This is how it was in the FAQ I found and as
far as I can tell it works fine.
Thanks,
-Bill
------------------------------
Date: Wed, 04 Feb 1998 10:25:00 +0000
From: Patrick Husi <patrick@husi.ch>
Subject: KERMIT
Message-Id: <34D841FB.BD0584A7@husi.ch>
Does anybody know how I can send a file in my perl script with KERMIT.
Is there a KERMIT library in perl?
Patrick
------------------------------
Date: Wed, 04 Feb 1998 10:51:31 +0000
From: "Rajan Troostwyk [8000885]" <troostwyk_rajan@jpmorgan.com>
Subject: killing a child process after a timeout
Message-Id: <34D84833.7ED4@jpmorgan.com>
Hi,
could someone help me please ?
I have writen a perl program that has top do a large number of system
calls (anonymous pipes) to my solaris operating system !
I found that the system calls would sometimes hang, so I added the
"manage_proc" and a "kill_child" functions included below. This seemed
to kill the child processes sometimes but other times I would get a
defunct child process and "manage_proc" function would hang at the
waitpid line ???.
The kill_child function did get called but the hang occured after
returning to waitpid in the manage_proc function.
What am I doing wrong ??
Thanks
Raj
********************************************************
This should rsh to "ahost" do a ls of /tmp/*.old and be killed after 60
seconds if the child has not exited.
There is also a bumber of retries before erroring ( 2 in this case ).
$op=manage_proc("rsh ahost ls -l /tmp/*.old",60,2);
sub manage_proc
{
local($proc,$timeout,$retries)=@_;
local( $op="",$rv="",$sleep_count=0,$retry_count=$retries );
$child_killed=0;
print ERRLOG "Debug - command = \"$proc\"\n";
while ( $retry_count-- > 0 ){
do {
$child_pid=open( PROC, "$proc|");
unless (defined $child_pid) {
print ERRLOG "Problem forking \"$proc\" ( $!
)\n";
sleep 1;
}
if ( $sleep_count > 6 ){
print ERRLOG "Failed to fork \"$proc\" ( $! )
$sleep_count attempts\n";
break;
}
}until defined $child_pid;
if ( $child_pid ) {
$SIG{ALRM} = "kill_child_pid";
print ERRLOG "Debug - alarm $timeout\n";
alarm $timeout;
$op=<PROC>;
print ERRLOG "Debug - \$rv=waitpid ($child_pid,0)\n";
close ( PROC ) or print ERRLOG "$proc - exited $?\n";
$rv=waitpid ($child_pid,0) ;
print ERRLOG "Debug - \$rv=$rv\n";
alarm 0;
print ERRLOG "Debug - wait has finished\n";
}else{
exit;
}
print "Debug - $op = \"$op\"\n";
return $op if ( $child_pid != $child_killed);
print ERRLOG "Restarting \"$proc\" after timeout of $timeout
seconds $retry_count attempts remain\n";
}
print ERRLOG "Failed to exec \"$proc\" after $retries attempts\n";
return "TIMEDOUT";
}
sub kill_child_pid
{
local ($sig) = @_;
print ERRLOG "Debug - about to kill child_pid $child_pid\n";
$child_killed=$child_pid;
$signals = $signals . $sig;
kill 9,$child_pid;
print ERRLOG "Debug - killed child_pid $child_pid\n";
}
------------------------------
Date: 4 Feb 1998 08:44:28 GMT
From: "Aditya Mishra" <mishra.aditya@emeryworld.com>
Subject: Re: Perl and Databases
Message-Id: <01bd307f$a8fbdc60$45225fd1@adikiran>
You should get The DBI module also please read the perl FAQ's. A visit to
www.perl.com would be quite useful
Ads
J. Shawn Pope <jpope@harris.com> wrote in article
<6b81mg$p09@su102w.ess.harris.com>...
> I have been teaching myself to write Perl scripts over the past few days.
I am using
> Perl 5 on UNIX. I need to query an Oracle database that resides on a
Windows NT
> machine. I have downloaded a module called Oraperl that can act as an
ODBC for
> databases however, I have been having difficulties understanding it. Do
you have to
> use a module such as this or can you embedd SQL statements in a Perl
script?
>
>
------------------------------
Date: 4 Feb 1998 08:30:08 GMT
From: "Rodion Levotchka" <rodion@incoma.ru>
Subject: Perl and DBM problem
Message-Id: <01bd3146$c7c39f80$5202a8c0@rodion.incoma.ru>
Hello!
I've bought a book 'Learninng Perl' and read there about using DBM bases.
I'm tring to open a dbm file and link i to hash but always getting message:
AnyDBM_File doesn't define a TIEHASH method at dbmtest.pl line ...
The text of programm is:
--------------------------------------------------------------------
#!/usr/local/bin/perl
dbmopen (%books,"libbase",0666) || die "can't open libbase: $!";
$books{new} = "Just_the_string_to_add";
dbmclose(%books) || die "can't close libbase: $!";
--------------------------------------------------------------------
I'm using Perl 5.00404 and FreeBSD 2.1.7.1. What's wrong? What should i do?
Please, help!!!
I would really appreciate a copy of your answers sent via e-mail.
Thanks
Rod.
------------------------------
Date: 04 Feb 1998 10:45:18 +0100
From: Fabrice Gonton <fabrice.gonton@aigf.sncf.fr>
Subject: Re: perl and file system
Message-Id: <90rrputt.fsf@aigf.sncf.fr>
mgjv@comdyn.com.au (Martien Verbruggen) writes:
>
> In article <ra5muho6.fsf@aigf.sncf.fr>,
> Fabrice Gonton <fabrice.gonton@aigf.sncf.fr> writes:
> [snip]
>
> > Is there a simple way to determine the fs ?
>
> Where is the perl question?
Well, I should have said how determine the TYPE of fs
(i.e ufs jfs tmpfs nfs ...) with a PERL command, that works on nearly
all Un*x systems
--
Fabrice
All opinions expressed here are mine ...
------------------------------
Date: Wed, 04 Feb 1998 00:11:44 -0600
From: Subrat_Ghosh@inf.com
To: basantakb@inf.com
Subject: Perl for win-32
Message-Id: <886520367.1629814793@dejanews.com>
I want to know whether the personal web server "Website" of O'Reilly
Associates supports Perl for Win32. Please also tell me what version of
Perl is to be used for the same, and other such useful information. Can I
use Microsoft FrontPage instead as a personal WebServer to support Perl?
Please reply to my personal mail-id.
Thanks in anticipation.
-------------------==== Posted via Deja News ====-----------------------
http://www.dejanews.com/ Search, Read, Post to Usenet
------------------------------
Date: 04 Feb 1998 01:13:25 -0500
From: David Guertin <guertin@middlebury.edu>
Subject: Perl Net::FTP error from Linux upgrade
Message-Id: <x6id8h328ze.fsf@caddis.middlebury.edu>
Hello,
I just upgraded my Linux box from Red Hat 4.2 to 5.0, and in the
process I installed the newest available perl package, perl-5.004-2.
This has broken a perl script that I have used a my Web site for some
time, and I'm hoping someone can point me to a solution.
The perl script is called by a Web page and downloads some weather
data via anonymous FTP. It uses the "Net::FTP" module. Since the
Red Hat and perl upgrade, I get the following errors when I run the
script:
1)
Cannot open Local file /home/httpd/html/foobar/foo: Permission denied
at ./myscript.pl line 24
2)
Your vendor has not defined Socket macro MSG_OOB, used at
/usr/lib/perl5/site_perl/Net/FTP.pm line 271
The directory "foobar" is world readable and writable, so I suspect
that the permission problem is a red herring (especially since it has
worked up to now).
My main concern is the "socket macro MSG_OOB" problem. What is this?
Is there a fix somewhere?
(BTW, I tried downgrading to older perl packages, but that just
resulted in seg faults.)
Many thanks for ideas,
Dave Guertin
---- Perl script follows: ----
#!/usr/bin/perl
print "Content-type: text/plain", "\n\n";
require Net::FTP;
$host = "weather.noaa.gov";
$user = "anonymous";
$password = "name@domain";
$pub_dir = "/data/observations/metar/stations";
$ftp = Net::FTP->new("$host");
#
# ftp session
#
$ftp->login($user, $password) || die "can't login to $host";
$ftp->binary();
$ftp->cwd($pub_dir);
$filenum = 0;
(@filenames = ("foo","bar")) || die "cannot read directory";
foreach (@filenames) {
if (/^\./) {
} else {
$ftp->get($filenames[$filenum], "/home/httpd/html/foobar/$filenames[$filenum]") || die
"cannot ftp remote file @filenames[$filenum]";
}
$filenum++;
}
exit(0);
--
Dave Guertin
guertin@middlebury.edu
------------------------------
Date: Wed, 04 Feb 1998 11:42:15 +0100
From: Mauro Quartini <mauro@franchisetech.com>
Subject: Rename a directory not empty
Message-Id: <34D84607.20FE@franchisetech.com>
Hey guys,
I'm a beginner in perl and i have the following problem:
I created a perl code that rename a directory using "system" command :
$rc=0xffff & system ("move $some_dir $other_dir"); # NT world
$rc=0xffff & system ("mv $some_dir $other_dir"); # UNIX world
... but if the $some_dir is not empty an error occured in NT world (i
didnt test in UNIX world). the error says : "A duplicate file name
exists, or the file cannot be found."
Any idea to workaround this problem?
Thank you all in advance.
Mauro Qaurtini
------------------------------
Date: Wed, 4 Feb 1998 11:42:01 GMT
From: adelton@fi.muni.cz (Honza Pazdziora)
Subject: Re: Rename a directory not empty
Message-Id: <adelton.886592521@aisa.fi.muni.cz>
Mauro Quartini <mauro@franchisetech.com> writes:
> Hey guys,
>
> I'm a beginner in perl and i have the following problem:
> I created a perl code that rename a directory using "system" command :
>
> $rc=0xffff & system ("move $some_dir $other_dir"); # NT world
> $rc=0xffff & system ("mv $some_dir $other_dir"); # UNIX world
>
> ... but if the $some_dir is not empty an error occured in NT world (i
> didnt test in UNIX world). the error says : "A duplicate file name
> exists, or the file cannot be found."
>
> Any idea to workaround this problem?
Why don't you simply use Perl's great, builtin, portable, working
function rename.
Check man perlfunc (or whatever you have on Windoze instead of man).
Hope this helps,
--
------------------------------------------------------------------------
Honza Pazdziora | adelton@fi.muni.cz | http://www.fi.muni.cz/~adelton/
I can take or leave it if I please
------------------------------------------------------------------------
------------------------------
Date: 4 Feb 1998 11:16:30 GMT
From: trs@eerie.fr (Francois Trousset)
Subject: Re: Retrieving remote page using CGI Script
Message-Id: <6b9ime$n0p$1@anais.eerie.fr>
In article <886115193.1961033729@dejanews.com>,
marlontan@hotmail.com writes:
> Good day! My question is: How do you retrieve (save to local drive) a
> remote homepage to the local hardrive without using the save menu of your
> browser (by using program code)?
>
> If the page I want to save is just generated by a CGI Script, it means
> that the page is "physically" not there (am I right?), and I want to
> retrieve that file, how do we do that?
Hi,
The packages URI::URL, LWP::UserAgent and LWP::Simple may
answer your question.
Francois TROUSSET
------------------------------
Date: Tue, 03 Feb 1998 22:47:20 -0700
From: Jess Askey <jess@links.magenta.com>
Subject: searching by file creation/modification date?
Message-Id: <34D800E8.7D03@links.magenta.com>
Hi all,
Im completely at a loss to find a way within perl to look at file
creation dates and sort them out into an HTML file. Im trying to create
a perl program that will automatically create a "Whats New" section on a
web page, based on date stamps of all files within a tree. Im a novice
at this but have spent hours looking through books and searching
dejanews for anything relating to this process but I can't seem to find
anything.
Thanks in advance for any suggestions and the time.
jess
--
Jess M. Askey *** Coming Soon - The Game Archive ***
Game Spot/Audio Analyst * Pinball, Video, Parts, Collecting *
509 S. 2nd Street Unit B * http://www.gamearchive.com *
Laramie WY 82070 **************************************
------------------------------
Date: Wed, 04 Feb 1998 07:12:24 +0100
From: martin@RADIOGAGA.HARZ.DE (Martin Vorlaender)
Subject: Re: sending mail from html-form?
Message-Id: <34d806c8.524144494f47414741@radiogaga.harz.de>
Raphael Breiting (totalrel@hrz1.hrz.tu-darmstadt.de) wrote:
: is there a way to send an email from a html-form without using unix4s
: sendmail. I need to do this on a win nt server.
I successfully sent mails from an NT machine using the Net::SMTP routines.
It's a minor rewrite to change all "print MAIL" statements to "push @data".
cu,
Martin
--
| Martin Vorlaender | VMS & WNT programmer
Ceterum censeo | work: mv@pdv-systeme.de
Redmondem delendam esse. | http://www.pdv-systeme.de/users/martinv/
| home: martin@radiogaga.harz.de
------------------------------
Date: Wed, 04 Feb 1998 12:35:23 -0500
From: rsgdata <rsgdata@worldnet.fr>
Subject: Re: set up perl on my win95 system (sorry, rageclan.geocites.com@vortex.lightstream.net not found)
Message-Id: <34D8A6DB.1D41@worldnet.fr>
rageclan.geocites.com@vortex.lightstream.net wrote:
>
> Christophe,
>
> I dont have an answer to your quetsion..but i was wondering if
> youcould help me?
>
> I am a novice also.
>
> I am trying to set up perl on my win95 system..but im a bit off in my
> efforts.
>
> Would u mind telling me how u have it set up
> specificly
> I need to know how to make the (#!/usr/local/bin/perl) scrpt point in
> the corrcect place.
>
> or a good link would do.
>
> thanks
>
> On Tue, 03 Feb 1998 14:38:05 -0500, in comp.lang.perl.misc you wrote:
>
Hi,
I'm working with :
- Netscape or IE browsers.
- Perl 5 compiled for PC
create a c:\perl directory
add a "SET PERLLIB=C:\PERL\LIB" to autoexec.bat
add "c:\perl\bin" to your path in autoexec.bat
- Use a local web server (Apache for windows or other)
I use OmniHttpd for Win95
URL (http://www.fas.harvard.edu/~galu/httpd/)
- For OmniHttpd, just enter the path of perl with .pl
association
(don't have to change the !#command line)
- For Apache, just configure your cgi-bin path and use a
!#c:/perl/bin/perl.exe command line (warn with / and no \).
- Your CGI scripts must return a string with a print command
(the
server catch the stdout to the browser). Think about a "Content-type:"
string at the beginning. Ex :
$genere = "Content-type: text/html\n\n";
$genere .= qq~
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<BODY>
</BODY>
</HTML>
~;
print $genere;
- The local server must have a 127.0.0.1 IP adresse (local
machine)
- From you browser, use a "http://127.0.0.1/" address or a
"http://localhost/" one. It'll open the dafault file (generaly index.htm
or index.html").
- For CGI, use a "http://127.0.0.1/cgi-bin/script.pl?params". If
all is
right, it'll work.
Other questions, email me.
Christophe - rsgdata@worldnet.fr
------------------------------
Date: 4 Feb 1998 05:44:32 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: setlocale warnings
Message-Id: <6b8v80$5lh$2@comdyn.comdyn.com.au>
In article <6owwfccuoz.fsf@sycon-design.com>,
sayuj@sycon-design.com writes:
> warning: setlocale(LC_CTYPE, "") failed.
> warning: LC_ALL = "(null)", LC_CTYPE = "(null)", LANG = "us",
> warning: falling back to the "C" locale.
I just answered another post with the same question. Same person? (I
am too lazy to look up the other one)
perldoc perllocale
look for the LANG and PERL_BADLANG env variables, read the warning
that goes with the second.
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | If it isn't broken, it doesn't have
Commercial Dynamics Pty. Ltd. | enough features yet.
NSW, Australia |
------------------------------
Date: Wed, 04 Feb 1998 01:45:56 -0500
From: Chipmunk <rjk@coos.dartmouth.edu>
Subject: Re: solution for multiline comments???
Message-Id: <34D80EA5.50C2664F@coos.dartmouth.edu>
Chip Salzenberg wrote:
>
> According to s93bni@csd.uu.se (Bjvrn Nilsson):
> >i.e. a notation like the /* C, C++, Java etc */ commenting be a nice
> >feature in Perl as well?
>
> No.
I think it would be a very nice feature. In my opinion, the POD method
is extremely ugly for block comments. It distorts the intended use of
POD, and it's not part of the Perl language.
I should be able to comment out large blocks of code without making them
part of the documentation.
Chipmunk
------------------------------
Date: Wed, 04 Feb 1998 07:02:16 GMT
From: chip@mail.atlantic.net (Chip Salzenberg)
Subject: Re: solution for multiline comments???
Message-Id: <6b93t6$tb6$1@cyprus.atlantic.net>
According to rjk@coos.dartmouth.edu:
>In my opinion, the POD method is extremely ugly for block comments.
There's no accounting for taste.
>It distorts the intended use of POD, and it's not part of the Perl language.
Pod (or rather =... =cut) *is* very definitely part of the Perl language.
That _is_ Perl's multiline comment syntax. It just so happens that there
are tools that can read those comments and use them as documentation, but
Perl doesn't know that.
>I should be able to comment out large blocks of code without making them
>part of the documentation.
That's possible if you real perlpod.
--
Chip Salzenberg - a.k.a. - <chip@pobox.com>
"Boy, is it ever dark." "I hope they don't get a moonburn." // MST3K
-> Ask me about Perl training and consulting <-
Like Perl? Want to help out? The Perl Institute: www.perl.org
------------------------------
Date: Wed, 04 Feb 1998 01:13:15 -0500
From: Chipmunk <rjk@coos.dartmouth.edu>
Subject: Re: Survival Of perl
Message-Id: <34D806FB.4E266315@coos.dartmouth.edu>
Zenin wrote:
>
> Chip Salzenberg <chip@mail.atlantic.net> wrote:
> : Well, even then, you could run Linux on your Sun.
> >snip<
>
> <shutters> :-)
Yes, if you're running Linux on your Sun, you probably
should close the shutters.
Chipmunk
------------------------------
Date: Wed, 04 Feb 1998 06:56:08 GMT
From: chip@mail.atlantic.net (Chip Salzenberg)
Subject: Re: TYP21D (was: substitute...)
Message-Id: <6b93gj$t9q$1@cyprus.atlantic.net>
According to mgjv@comdyn.com.au (Martien Verbruggen):
>Well, it is not for nothing that the perl bug list mentions as it's
>first entry that 'the -w switch is not mandatory'. In my opinion the
>second entry should be 'use strict is not mandatory'.
Larry prefers to encourage virtue rather than impose it.
--
Chip Salzenberg - a.k.a. - <chip@pobox.com>
"Boy, is it ever dark." "I hope they don't get a moonburn." // MST3K
-> Ask me about Perl training and consulting <-
Like Perl? Want to help out? The Perl Institute: www.perl.org
------------------------------
Date: 4 Feb 1998 00:09:45 -0500
From: das@panix.com (David Staschover)
Subject: Using Bcc header in perl mail script
Message-Id: <6b8t6p$og1@panix.com>
Is there a way to have a "Bcc" field in a perl mail script? (using
sendmail as the program).. I've used:
From: name@domain
To: name@domain
Subject: subject
Thanks in advance. Please answer via email if possible..
David Staschover
das@panix.com
------------------------------
Date: Wed, 4 Feb 1998 19:03:23 +0800
From: "mrlee" <mrlee@cycloria.com.tw>
Subject: Who can give me a Pl. cgi example on NT to change Linux server email password.
Message-Id: <6b9i68$4iq@netnews.hinet.net>
Hi,
I have a NT 4.0 - IIS 3.0 Web server, and a Linux mail server.
Now, I want to support a CGI, using pl language, on IIS home page
to change email account password, which on another Linux server.
see the illustration,
network
----------------------------------------------------------------------
-------
|
|
| ---------------|
|----------------|
| NT 4.0 | | Linux
|
| Web server | -- | ------>| mail server
|
| ---------------| | |
|----------------|
| |
|-----------------| |
| Pl. cgi | -----
| to change |
| mail passwd |
|-----------------|
If anyone know this kind of Pl. examples, please give me a hand !
Please mail to mrlee@cycloria.com.tw
Thanks !
------------------------------
Date: 4 Feb 1998 08:42:43 GMT
From: "Aditya Mishra" <mishra.aditya@emeryworld.com>
Subject: Re: Win32 CGI compiler ?
Message-Id: <01bd307f$6a4aaaa0$45225fd1@adikiran>
> If not, how can I protect my sources (binary encryption or other ?)
Use a perl source mangler.
Search archives for a perl obfuscator (I hope I got the spelling
rite...write..whatever). I have seen postings about it on this newsgroup
sometime back
Ads
------------------------------
Date: Wed, 04 Feb 1998 12:38:43 -0500
From: rsgdata <rsgdata@worldnet.fr>
Subject: Re: Win32 CGI compiler ?
Message-Id: <34D8A7A3.28B2@worldnet.fr>
Aditya Mishra wrote:
>
> > If not, how can I protect my sources (binary encryption or other ?)
>
> Use a perl source mangler.
> Search archives for a perl obfuscator (I hope I got the spelling
> rite...write..whatever). I have seen postings about it on this newsgroup
> sometime back
> Ads
Thanks very much. I found a perl2exe on dejanews with your keyword "perl
obfuscator" (you've got the right spelling).
Christophe.
------------------------------
Date: Wed, 04 Feb 1998 10:47:28 +0000
From: Patrick Stalder <internet@reimer.ch>
To: scott@softbase.com, Cameron Dorey <camerond@mail.uca.edu>
Subject: Re: Word -> HTML
Message-Id: <34D84740.67260151@husi.ch>
Cameron Dorey wrote:
> scott@softbase.com wrote:
> >
> > Patrick Husi (patrick@husi.ch) wrote:
> >
> > > I'm looking for a converter from Word format (i.e. .doc files) to
> > HTML, preferably for Perl or Java. Anyone ??
> >
> > I almost hate to say this, but ...
> >
> > IT IS BUILT INTO WORD! All you do is File/Save As HTML!
> >
>
> Not Word 95, it isn't. You're thinking of Word 97 (which I, for one,
> haven't seen the need to shell out *more* bucks for).
>
> What I do (swing around elbow, approach ear) is to use Corel WP 8 to
> open the Word 95 doc, then print as HTML. Corel's translation program is
> generally very good. I'm working on automating it, but haven't gotten
> too far, yet.
>
> Cameron Dorey
> camerond@mail.uca.edu
I want to convert about 10,000 *.doc-files to HTML on the fly from a CGI
script on the server side. This process must be repeated continuously and
cannot be done inside a Word program etc.
------------------------------
Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 8 Mar 97)
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.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 1804
**************************************