[12990] in Perl-Users-Digest
Perl-Users Digest, Issue: 400 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Aug 6 10:07:21 1999
Date: Fri, 6 Aug 1999 07:05:11 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Fri, 6 Aug 1999 Volume: 9 Number: 400
Today's topics:
$ARGV HELP... <shaffer2@ptd.net>
Re: $ARGV HELP... (Andreas Fehr)
Re: $ARGV HELP... (Abigail)
Re: 5.005.03 compile problem (Anno Siegel)
Re: [Perl] How to find the Perl FAQ <codeman@gol.com>
Re: Activestate Perl/Dos? Question <randy@theoryx5.uwinnipeg.ca>
Re: Activestate Perl/Dos? Question mknickelbein@my-deja.com
Re: clone() in Perl (Duplicating a data structure) (Benjamin Franz)
Re: clone() in Perl (Duplicating a data structure) <tchrist@mox.perl.com>
ftp issue slmlambert@my-deja.com
Re: ftp issue (Andreas Fehr)
Re: ftp issue (Malcolm Ray)
Re: Hackers and Gurus and Wizards <cmcurtin@interhack.net>
How to find out if file is open? <hiwi2krg@iitb.fhg.de>
Re: How to find out if file is open? <tchrist@mox.perl.com>
I guess this is a Misc question: Cgi-bin (AGGTA B.O.D)
Re: I guess this is a Misc question: Cgi-bin (Anno Siegel)
Re: I guess this is a Misc question: Cgi-bin (Matthew Bafford)
Re: Insecure $ENV{PATH} while running setuid (Hasanuddin Tamir)
Re: Interesting database manipulation problem (Michel Dalle)
Re: looking for XML comments <chris@inta.net.uk>
Making small changes to big files. (Brian Orpin)
Re: Nastiness contrary to the spirit of perl? <cmcurtin@interhack.net>
net:FTP install <jeffm641@ibm.net>
Re: net:FTP install (Andreas Fehr)
Re: net:FTP install <jeffm641@ibm.net>
Re: newbie question: splitting hairs <bklimov@mitre.org>
Re: Perl is Not Opening a file (Bart Lateur)
Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 6 Aug 1999 08:35:35 -0400
From: Dave Shaffer <shaffer2@ptd.net>
Subject: $ARGV HELP...
Message-Id: <37AAD674.DC7A7F73@ptd.net>
I have a PERL script that does different actions based on the argument
it was called with. For example, the following hyperlink calls the
script with "Edit" as an argument. The script works on a test box but
the $ARGV variables are not getting set on the productin box.
<A HREF="notices.pl?Edit">Edit Notices</A>
In notices.pl the following code looks for the argument passed and
performs the appropriate action.
if ($ARGV[0] eq "Edit") {
&editNotices;
}elsif ($ARGV[0] eq "Update"){
&updateNotices;
} else {
&displayNotices;
}
The $ARGV variable does not seem to getting set.
Any ideas???
------------------------------
Date: Fri, 06 Aug 1999 13:16:23 GMT
From: backwards.saerdna@srm.hc (Andreas Fehr)
Subject: Re: $ARGV HELP...
Message-Id: <37aadb46.27343127@news.uniplus.ch>
On Fri, 6 Aug 1999 08:35:35 -0400 , Dave Shaffer <shaffer2@ptd.net>
wrote:
>
>The $ARGV variable does not seem to getting set.
>
>Any ideas???
Read the documentation about CGI.pm and use CGI;
Andreas
------------------------------
Date: 6 Aug 1999 09:04:35 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: $ARGV HELP...
Message-Id: <slrn7qlqqd.8m9.abigail@alexandra.delanet.com>
Dave Shaffer (shaffer2@ptd.net) wrote on MMCLXVI September MCMXCIII in
<URL:news:37AAD674.DC7A7F73@ptd.net>:
@@ I have a PERL script that does different actions based on the argument
The language isn't called PERL. Please read the FAQ and spell the
language correctly.
@@ it was called with. For example, the following hyperlink calls the
@@ script with "Edit" as an argument. The script works on a test box but
@@ the $ARGV variables are not getting set on the productin box.
@@
@@ <A HREF="notices.pl?Edit">Edit Notices</A>
@@
@@ The $ARGV variable does not seem to getting set.
$ARGV contains the filename of current file when reading from <>.
What does that have to do with your program?
Perhaps you mean @ARGV. @ARGV *is* set. It just doesn't contain
what you think it contains.
Your question isn't a Perl question, but stems from a lack of
understanding the CGI protocol. You would have had the same problem
had you written your program in C. Please ask your question in a group
dealing with CGI issues.
Abigail
--
perl -MNet::Dict -we '(Net::Dict -> new (server => "dict.org")
-> define ("foldoc", "perl")) [0] -> print'
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: 6 Aug 1999 12:54:00 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: 5.005.03 compile problem
Message-Id: <7oelt8$g0g$1@lublin.zrz.tu-berlin.de>
[posted and mailed]
Steve Manes <smanes@NOSPAM.HEREmagpie.com> wrote in comp.lang.perl.misc:
>On Thu, 05 Aug 1999 02:41:27 GMT, smanes@NOSPAM.HEREmagpie.com (Steve
>Manes) wrote:
>>I had this compiled and running fine under Linux 2.0.34. Yesterday, I
>>got Dell P3 for the network and installed Redhat 6.0 on it for a
>>starter system.
>...
>>Actually, Perl compiles without gripes. It just fails one test in
>>'anydbm.t'. This test assigns a string value to a hash, h, with a
>>null key, i.e.
>
>Addendum: this is a confirmed problem with Redhat 6.0, as indicated by
>its bug tracking web site. 6.0's dbm libraries are all screwed up
>with a mix of db1, db2, missing header files, etc. It looks like I'm
>going to have to rebuild all them from fresh sources. Sheesh.
>
Yes. And switch on compatibility mode, because even though perl
doesn't need it, sendmail does. And build a shared library, which
the default build doesn't. And put the header file in place and
re-build the DB_File extension.
I guess you know the sources are at www.sleepycat.com.
Anno
------------------------------
Date: Fri, 6 Aug 1999 21:49:34 +0900
From: "Scott" <codeman@gol.com>
Subject: Re: [Perl] How to find the Perl FAQ
Message-Id: <7oell4$opp$1@nn-tk001.ocn.ad.jp>
Hi,
Id like to write a perl program to
handle
A list of teachers who on a certain date who recorded certain averages.
would this be an array of arrays or
a list of hashes. Im not sure.
Any advice appreciated.
I need to update the dates in code and add the averages for each
teacher on a certain date.
Scott.
codeman@gol.com
------------------------------
Date: 6 Aug 1999 13:46:06 GMT
From: Randy Kobes <randy@theoryx5.uwinnipeg.ca>
Subject: Re: Activestate Perl/Dos? Question
Message-Id: <7oeouu$5jt$1@canopus.cc.umanitoba.ca>
In comp.lang.perl.misc, elephant <elephant@squirrelgroup.com> wrote:
> David Cassell writes ..
>>mknickelbein@my-deja.com wrote:
[snip]
>>
>>And this is because errors go to STDERR instead, and '>' doesn't
>>redirect them. There's no nice way aorund this if you insist on
>>sticking to a strictly-DOS solution.
> I think that this may be a bit of misinformation David .. although I
> don't have a Win9x box to test on - so I cannot say conclusively for all
> versions of DOS
> but my NT version of command.com - which is DOS supports the Bourne shell
> file-descriptor redirection thusly
> perl perlfile 1>outputfile 2>&1
Hi,
On Win 95/98, this won't work with command.com, unfortunately.
However, one can get the 4NT tools from http://www.jpsoft.com/
which does support STDERR redirection in this way, along with
some other nice features like command history. Despite the
warnings about using these tools on Win95/98, I've used them
on my Win98 machine without a problem so far.
best regards,
Randy Kobes
--
Physics Department Phone: (204) 786-9399
University of Winnipeg Fax: (204) 774-4134
Winnipeg, Manitoba R3B 2E9 e-mail: randy@theoryx5.uwinnipeg.ca
Canada http://theory.uwinnipeg.ca/
------------------------------
Date: Fri, 06 Aug 1999 13:51:51 GMT
From: mknickelbein@my-deja.com
Subject: Re: Activestate Perl/Dos? Question
Message-Id: <7oep9j$6hd$1@nnrp1.deja.com>
Perhaps if I state my purpose there might be a totally easier way to do
this:
I'm programming in a dumb programming language (not Perl) where I want
to use Activestate's Perl results from running a Perl file in my
program.
With this dumb programming language, the only way I see doing this is
by having Perl write it to a file, and then load that file up.
So, I made a .bat file, and I'd like it to be able to record any
results from running Perl to a file. Maybe there is an easier way to
do this? Maybe even with Perl somehow?? :)
Thanks anyways
In article <7ocd0g$gbv$1@nnrp1.deja.com>,
mknickelbein@my-deja.com wrote:
> Hi,
> I'm sorry if this is offtopic, but I'm not sure if it applies to Perl
> or to DOS.
>
> When I type in at the dos prompt:
> perl myperlfile.pl > myoutputfile.dat
> If there were no errors in the PL file, myoutputfile.dat will contain
> the output of my Perl file, and nothing will be printed to the screen.
> But if there were errors, if will print to the screen and not to the
> file. How can I make it -always- print to the file?
>
> Thanks,
> Mark
>
> Sent via Deja.com http://www.deja.com/
> Share what you know. Learn what you don't.
>
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Fri, 06 Aug 1999 13:09:45 GMT
From: snowhare@long-lake.nihongo.org (Benjamin Franz)
Subject: Re: clone() in Perl (Duplicating a data structure)
Message-Id: <t8Bq3.835$m4.78769@typhoon01.swbell.net>
In article <37AAB138.3EF10631@echange.fr>,
Nicolas MONNET <nico@echange.fr> wrote:
>How can I simply clone a data structure in Perl?
>
>In particular, I'm making heavy use of XML::Groves, and I don't want
>to reparse the trees every time, it's a waste. But before I duplicate
>it "by hand", I wanna know if there is a simple, more or less std
>way to do it in Perl? I'm so surprised I can't think of one actually.
Look for the 'dclone' method in the Storable module.
--
Benjamin Franz
------------------------------
Date: 6 Aug 1999 07:26:51 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: clone() in Perl (Duplicating a data structure)
Message-Id: <37aae29b@cs.colorado.edu>
[courtesy cc of this posting mailed to cited author]
In comp.lang.perl.misc,
Nicolas MONNET <nico@echange.fr> writes:
:How can I simply clone a data structure in Perl?
:
:In particular, I'm making heavy use of XML::Groves, and I don't want
:to reparse the trees every time, it's a waste. But before I duplicate
:it "by hand", I wanna know if there is a simple, more or less std
:way to do it in Perl? I'm so surprised I can't think of one actually.
Excerpt from the Perl Cookbook, Chapter 11:
Copying Data Structures
Problem
You need to copy a complex data structure.
Solution
Use the dclone() function from the Storable module from CPAN.
use Storable;
$r2 = dclone($r1);
--tom
--
If you want to program in C, program in C. It's a nice language. I
use it occasionally... :-)
--Larry Wall in <7577@jpl-devvax.JPL.NASA.GOV>
------------------------------
Date: Fri, 06 Aug 1999 11:04:01 GMT
From: slmlambert@my-deja.com
Subject: ftp issue
Message-Id: <7oefet$vhq$1@nnrp1.deja.com>
using the Net::FTP is it possible to transfer a scalar to the remote
server without sending it as a file.
Let me clarify...
I am aware that this is how ftp in perl works: $ftp->put($localfile,
$remotefile); but is it possible to do something like this:
$gibberish = "this is a load of rubbish. Blah blah blah, yadda yadda
yadda2;
$ftp->put($gibberish, $remotefile);
I would try this out for myself but I currently do not have the FTP
permissions, and I do not want to write a huge script for it to
completely fail because of one small fault that I did not anticipate
before I started.
Thanks,
Simon
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Fri, 06 Aug 1999 12:41:36 GMT
From: backwards.saerdna@srm.hc (Andreas Fehr)
Subject: Re: ftp issue
Message-Id: <37aad729.26289502@news.uniplus.ch>
On Fri, 06 Aug 1999 11:04:01 GMT, slmlambert@my-deja.com wrote:
>using the Net::FTP is it possible to transfer a scalar to the remote
>server without sending it as a file.
>
I guess the 'f' in ftp comes from file.
Create a client and a server with your own socket connection
and protocol. You can read from and write to sockets as to a
file.
Andreas
------------------------------
Date: 6 Aug 1999 13:20:37 GMT
From: M.Ray@ulcc.ac.uk (Malcolm Ray)
Subject: Re: ftp issue
Message-Id: <slrn7qlo95.c60.M.Ray@carlova.ulcc.ac.uk>
On Fri, 06 Aug 1999 12:41:36 GMT, Andreas Fehr <backwards.saerdna@srm.hc>
wrote:
>On Fri, 06 Aug 1999 11:04:01 GMT, slmlambert@my-deja.com wrote:
>
>>using the Net::FTP is it possible to transfer a scalar to the remote
>>server without sending it as a file.
>>
>
>I guess the 'f' in ftp comes from file.
>
>Create a client and a server with your own socket connection
>and protocol. You can read from and write to sockets as to a
>file.
Well, Net::FTP's put method can take an open filehandle instead of a
filename, so you *could* play tricks with tied filehandles or with pipes.
Dumb example follows:
#!/usr/bin/perl -w
use strict;
use Net::FTP;
my $gibberish = 'this is a load of rubbish. Blah blah blah, yadda yadda';
my $remote_host = 'myhost';
my $username = 'myuser';
my $password = 'fatchance';
my $remote_filename = 'example';
my $pid = open(CHILD, '|-');
die "Error creating child: $!" unless defined $pid;
if ($pid)
{
print CHILD $gibberish;
close CHILD or die "Child died: $?";
}
else
{
my $ftp = Net::FTP->new($remote_host)
or die "ftp connection failed";
$ftp->login($username, $password)
or die "ftp login failed";
$ftp->put(\*STDIN, $remote_filename)
or die "ftp put failed";
$ftp->quit;
exit 0;
}
__END__
--
Malcolm Ray University of London Computer Centre
------------------------------
Date: 06 Aug 1999 09:39:39 -0400
From: Matt Curtin <cmcurtin@interhack.net>
Subject: Re: Hackers and Gurus and Wizards
Message-Id: <xlxn1w5c9k4.fsf@gold.cis.ohio-state.edu>
>>>>> On 5 Aug 1999 07:49:29 -0700,
Tom Christiansen <tchrist@mox.perl.com> said:
chuckle. It never ceases to amaze me how the Truly Classic stuff is
funny when it comes 'round again. (Unlike movie sequels, I hasten to
add.)
Tom> Perl Hierarchy
Tom> ==============
Tom> * Novice
o Spells Perl "PERL"
(Now that we've got a test, does this mean that I can write "Perl
Hacker/Guru" on my resumé and expect it to be understood? :-)
--
Matt Curtin cmcurtin@interhack.net http://www.interhack.net/people/cmcurtin/
------------------------------
Date: Fri, 6 Aug 1999 14:36:32 +0200
From: "hiwi2krg" <hiwi2krg@iitb.fhg.de>
Subject: How to find out if file is open?
Message-Id: <7oekpm$mpo$1@news.fhg.de>
Hello World
I'm trying to make a sub that closes files that might be open. All files are
NOT necessary open. So I need to know if file is open or not, but the
question is how do I know if file is open?
(I want to do this on one sub, because I dont want 300 lines of
<close(FILE_X)>)
Code is something like this.
open files
do something
open and close files
IF error_occured_somewhere
close_open_files
exit
do something
end
sub close_open_files{
my $error;
if(file1_is_open){
close(FILE1)
or $error .= "failed close $file1: $!";
}
}
#
# close other files
#
if(fileN_is_open){
close(FILEN)
or $error .= "failed close $fileN: $!";
}
}
if($error){
return $error;
}
}
Thanks for any Help
------------------------------
Date: 6 Aug 1999 07:50:46 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: How to find out if file is open?
Message-Id: <37aae836@cs.colorado.edu>
[courtesy cc of this posting mailed to cited author]
In comp.lang.perl.misc,
"hiwi2krg" <hiwi2krg@iitb.fhg.de> writes:
:Hello World
:
:I'm trying to make a sub that closes files that might be open. All files are
:NOT necessary open. So I need to know if file is open or not, but the
:question is how do I know if file is open?
:(I want to do this on one sub, because I dont want 300 lines of
:<close(FILE_X)>)
Do you have a data structure that contains references to all these
open files? If so, it's easy:
for $fh (@array_of_filehandles) {
if (defined(fileno($fh)) && !close($fh)) {
warn "couldn't close $fh: $!";
}
}
of course, @array_of_filehandles could be precalculated somehow, like
@array_of_filehandles = keys %filenames_to_filehandles;
or even fancier stuff like:
@array_of_filehandles = map {
keys % { $_->{connections}->{opensockets} }
} values %big_hulking_datastructure;
But if you really need to get at things you don't know are opened, you're
in for rather less fun, generally involving funny fdopens on =&$FDN
and the like, but I'm never convinced that this is the right thing on
existing stdio buffers. Are you truly sure you really need to do that?
I'd make the data structures instead.
--tom
--
The reductionist approach has its place, as does the holistic approach.
Render therefore unto Unix the things which are Unix's, and unto Perl
the things that are Perl's. :-) Larry Wall in <1994Nov10.185030.16615@netlabs.com>
------------------------------
Date: Thu, 5 Aug 1999 21:01:59 +0100
From: "Ben Quick (AGGTA B.O.D)" <newsgroup@bigwig.net>
Subject: I guess this is a Misc question: Cgi-bin
Message-Id: <37aaf0ac.0@news2.cluster1.telinco.net>
Could anyone remind me of what my cgi-bin should be chmoded to. I have had
to create my own, therefore I have to chmod it. 755 seems to be the norm,
but is it different for the bin?
Cheers
BQ
--
----
http://come.to/noname.net
http://drive.to/bq
ICQ 37863699
----
------------------------------
Date: 6 Aug 1999 13:28:13 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: I guess this is a Misc question: Cgi-bin
Message-Id: <7oentd$g34$1@lublin.zrz.tu-berlin.de>
Ben Quick (AGGTA B.O.D) <newsgroup@bigwig.net> wrote in comp.lang.perl.misc:
>Could anyone remind me of what my cgi-bin should be chmoded to. I have had
>to create my own, therefore I have to chmod it. 755 seems to be the norm,
>but is it different for the bin?
Too misc for this ...perl.misc group. Find one with cgi in its name.
Anno
------------------------------
Date: Fri, 06 Aug 1999 13:39:14 GMT
From: *@dragons.duesouth.net (Matthew Bafford)
Subject: Re: I guess this is a Misc question: Cgi-bin
Message-Id: <slrn7qlo70.sq5.*@dragons.duesouth.net>
On Thu, 5 Aug 1999 21:01:59 +0100, Ben Quick (AGGTA B.O.D)"
<newsgroup@bigwig.net> was attempting to recharge the laptop battery by
typing:
: Could anyone remind me of what my cgi-bin should be chmoded to. I have had
: to create my own, therefore I have to chmod it. 755 seems to be the norm,
: but is it different for the bin?
This is entirely dependent on your particular webserver and configuration.
: Cheers
HTH,
: BQ
--Matthew
------------------------------
Date: 6 Aug 1999 12:26:36 GMT
From: hasant@trabas.co.id (Hasanuddin Tamir)
Subject: Re: Insecure $ENV{PATH} while running setuid
Message-Id: <slrn7qktaq.103.hasant@borg.intern.trabas.co.id>
On Wed, 21 Jul 1999 14:22:24 -0400, Kelvin Tu <kelvin.tu@rnb.com> wrote:
## Hi All
##
## I have encountered the problem by executing the following command in
## perl script while using setuid.
##
## print `ls -l *_out.csv`;
##
## The error message is :
##
## Insecure $ENV{PATH} while running setuid at KT.pl line 3.
##
## It looks like that perl sees setuid as an insecure operation and tried
## to prevent it. Any one knows how to turn this check off.
As Perl says, you have insecure PATH environment variable.
When Perl enters taint mode or detects set(u|g)id bit, it
doesn't trust the value in $ENV{PATH} (as one of preventive
actions).
The solution is not ``to turn off this check off'', but
rather, ``to make Perl trusts $ENV{PATH}'', that is,
secure $ENV{PATH}. (Of course, if we're talking about
security and that's what I assume. Otherwise, I would
have just talked about turning off the set(u|g)id bit or
remove -T switch, whichever applies).
As perlsec manpage says (finally I (explicitly) refer to
the official (information source) (and standard) manpage),
For "Insecure $ENV{PATH}" messages, you need to set
$ENV{'PATH'} to a known value, and each directory in
the path must be non-writable by others than its owner
and group.
`a known value' refers to what the programmer knows (or
believes) as safe value. This is usually the standard
locations of system commands, such as `bin', `/usr/bin',
or `/usr/local/bin'. So $ENV{PATH} must be set manually
to one of these values or combination of them before any
calling to external program, or right after the shebang
line for the sake of Perl, since one might use() a module
that calls external program.
#!/usr/bin/perl -Tw
$ENV{PATH} = '/bin:/usr/bin';
You can even set $ENV{PATH} to empty value,
$ENV{PATH} = '';
but then you have to call the external command with its
full path,
print `/bin/ls -l`;
perlsec manpage (man perlsec or perldoc perlsec) talks
about this better and more comprehensive as other security
documents (e.g. www-security-faq). I'm also sure that
this kind of question has been answered many times in
this group so one is able to search the answer (in Deja
for example).
HTH,
-hasan-
--
uhm, no more sig(h)
------------------------------
Date: Fri, 06 Aug 1999 12:19:31 GMT
From: michel.dalle@usa.net (Michel Dalle)
Subject: Re: Interesting database manipulation problem
Message-Id: <7oek0j$nlr$1@news.mch.sbs.de>
In article <37AA895E.8F09DA7C@iaea.org>, Paul Gillingwater <P.Gillingwater@iaea.org> wrote:
>Abigail wrote:
>
>> Paul Gillingwater (P.Gillingwater@iaea.org) wrote on MMCLXV September
>> MCMXCIII in <URL:news:37A9A50B.CBE528F6@iaea.org>:
>> !!
>> !! The question is: given that there is some overlap, i.e., some people do
>> !! the same jobs as other people, create a report that lists the areas of
>> !! greatest overlap, i.e., a set of jobs and people in common with the
>> !! greatest number of jobs in common. Now do it again, for one less job.
>> !! Then again, until no more than 5 jobs are in common.
>>
>> Uhm, why not do it in SQL?
>>
>> (And ask in an SQL group for the how)
>
>I already decided that SQL can't do this, no matter how many funky outer joins
> are
>used. I'm not an SQL expert, although I've use it for over a dozen years. I
> am
>convinced however that Perl is the best tool for this job, and would appreciate
> some
>guidance in how best to use the Perl language to approach this problem, which
> is why
>I posted solely in comp.lang.perl.misc.
>
Have you had a look at the Set:: modules on CPAN ? They contain
methods like intersection, subset etc. that might help you build a
more efficient program...
Of course, basic knowledge of set theory might help :-)
Just a question : how many people and jobs are you talking about ?
Michel.
------------------------------
Date: Fri, 6 Aug 1999 13:09:55 +0100
From: "Chris Denman" <chris@inta.net.uk>
Subject: Re: looking for XML comments
Message-Id: <7oej8k$2070$1@news2.vas-net.net>
I'm sorry, I didn't realise that you had to be a 'member' to ask questions
in this newsgroup.
Also, what makes everyone so sure that this query is not perl related? I
have spent the last 6 months developing a content management system using
perl, and watched this group along the way for useful information. I have
to upgrade my system so that the storage medium is XML and as perl has xml
modules, comment on this situation from this group would have been
comforting for myself, and maybe others that are in a simular situation.
Thanks for nothing comp.lang.perl.MISC
Chris Denman
------------------------------
Date: Fri, 06 Aug 1999 11:03:39 GMT
From: abuse@borpin.demon.co.uk (Brian Orpin)
Subject: Making small changes to big files.
Message-Id: <37acbfd9.14882943@news.geccs.gecm.com>
Plenty of bits recently about not reading in big files to memory - fine.
The thing I have never solved is how to make a small change to a big
file. I still labouriously go through each file, line by line looking
for the item to do a substitution on writing each line out to a temp file
then changing the name of the file at the end.
I know there must be a better (quicker) way to do this but I have never
found it.
Any help (or pointers) please?
--
Brian Orpin **Reply to address is valid***
Selfbuilding and It'll be finished one day.
http://www.borpin.demon.co.uk/
------------------------------
Date: 06 Aug 1999 09:51:44 -0400
From: Matt Curtin <cmcurtin@interhack.net>
Subject: Re: Nastiness contrary to the spirit of perl?
Message-Id: <xlxk8r9c8zz.fsf@gold.cis.ohio-state.edu>
>>>>> On Thu, 05 Aug 1999 21:50:21 GMT, why@invite.flames said:
why> Nastiness contrary to the spirit of perl? - YES - Open source is
why> about cooperation, not control.
It's also about self-sufficiency. We are doing the newbies a favor by
pointing them in the direction of The Fine Manual. People who expect
to be spoon-fed are not ready for programming languages. If you think
that we're rude, try interfacing with a compiler sometime.
Further, if we answer questions on a one-by-one basis, two important
things have occurred:
1 We have wasted our efforts writing things and making them available
on the web and in print. We have spent energy needlessly, thus
failing to be appropriately lazy.
2 The newbie doesn't get anything except an answer to one question.
He had to wait for hours, days, or weeks to get the answer. If we
show him the manual, not only will he find more complete
explanations, but he will find them more readily, and have greater
opportunity to understand what's happening. He's going to be
orders of magnitude more productive.
Tolerating either of these conditions would be both rude and contrary
to the spirit of Perl.
--
Matt Curtin cmcurtin@interhack.net http://www.interhack.net/people/cmcurtin/
------------------------------
Date: Fri, 06 Aug 1999 08:10:57 -0400
From: Jeff Miller <jeffm641@ibm.net>
Subject: net:FTP install
Message-Id: <37AAD0D1.50E3C77E@ibm.net>
Hello,
I am in need of the net::FTP module, which is not installed on my
server, not will it be. My question is how and what do I need to install
in my own cgi-local directory to get this to run. Second, not
necessarily Perl related, is there a way to tar and gunzip a tar.gz file
in a windows/dos envrionment?
I have downloaded the module, and the readme, but most of the
instructions refer to a system wide instillation. I do have access to a
unix machine for the above commands, but may not have that forever.
Thanks, Jeff Miller
------------------------------
Date: Fri, 06 Aug 1999 12:50:27 GMT
From: backwards.saerdna@srm.hc (Andreas Fehr)
Subject: Re: net:FTP install
Message-Id: <37aad853.26587991@news.uniplus.ch>
On Fri, 06 Aug 1999 08:10:57 -0400, Jeff Miller <jeffm641@ibm.net>
wrote:
> I am in need of the net::FTP module, which is not installed on my
>server, not will it be.
If you use ActivePerl, load 'libnet' it with ppm or from
<URL:http://www.activestate.com/packages/zips/>
> My question is how and what do I need to install
>in my own cgi-local directory to get this to run.
The cgi directory is probably not the best choice to install a module.
Check perldoc -q module for more information.
> Second, not
>necessarily Perl related, is there a way to tar and gunzip a tar.gz file
>in a windows/dos envrionment?
Yes, use Tar.pm with Perl or gzip.exe and tar.exe.
>I have downloaded the module, and the readme, but most of the
>instructions refer to a system wide instillation. I do have access to a
>unix machine for the above commands, but may not have that forever.
So which module do you have?
Anyway, check perldoc -q own module
Andreas
------------------------------
Date: Fri, 06 Aug 1999 09:42:58 -0400
From: Jeff Miller <jeffm641@ibm.net>
Subject: Re: net:FTP install
Message-Id: <37AAE662.1F761F85@ibm.net>
Thanks for your help on tar.exe and gzip.exe...
The perl module that I have is libnet-1.0606 that contains the net::FTP
module. My web hosting company said that they will not install the
module,
but I am free to try to install it myself in my own space. I read the
docs
that you have mentioned, and I believe that if I had telnet it would be
fairly straightforward to install in my webspace on my server. I am not
sure
how to accomplish this with just FTP access. I am trying to install the
net::FTP so that I can transfer some files from the PC to the web host
using
a perl-cgi script called from html.
Thanks again for your help! Jeff Miller
Andreas Fehr wrote:
> On Fri, 06 Aug 1999 08:10:57 -0400, Jeff Miller <jeffm641@ibm.net>
> wrote:
>
> > I am in need of the net::FTP module, which is not installed on my
> >server, not will it be.
>
> If you use ActivePerl, load 'libnet' it with ppm or from
> <URL:http://www.activestate.com/packages/zips/>
>
> > My question is how and what do I need to install
> >in my own cgi-local directory to get this to run.
>
> The cgi directory is probably not the best choice to install a module.
> Check perldoc -q module for more information.
>
> > Second, not
> >necessarily Perl related, is there a way to tar and gunzip a tar.gz file
> >in a windows/dos envrionment?
>
> Yes, use Tar.pm with Perl or gzip.exe and tar.exe.
>
> >I have downloaded the module, and the readme, but most of the
> >instructions refer to a system wide instillation. I do have access to a
> >unix machine for the above commands, but may not have that forever.
>
> So which module do you have?
> Anyway, check perldoc -q own module
>
> Andreas
------------------------------
Date: Fri, 06 Aug 1999 08:43:18 -0400
From: Boris Klimovitsky <bklimov@mitre.org>
Subject: Re: newbie question: splitting hairs
Message-Id: <37AAD864.283CACA4@mitre.org>
David Cassell wrote:
> Good! Now you can learn about 'use strict;' and you will be moving
> toward perl enlightenment.
I'll see what I can do.
> Okay, you're confusing a couple things. One, 'using' a regex is not
> at all the same as 'being parsed within a regex'. And even if you do
> use a regex in a construction such as m// or s/// you still won't have
> $1 and $2 set unless you use capturing parentheses.
Yes. I understand this. I understood this when I tried writing something
equivalent to /(\w+)\s+ ... / and only then got the values for $1, etc
to actually
be set, and could not have them set just by using split.
I'd been (obviously mistakenly) laboring under the assumption that you could
use perl similarly to awk in this respect: awk '{print $2,$3}' file
and thought it would be simpler to extract columns as I had been trying
to do.
My question wasn't how to do it... I realized it couldn't be done, and
went with
the solution I'd previously written. My question was: WHY are these expressions
not set? I confess to ingorance in this matter, and am merely curious if there's
something to this more than just the superficial issue I've asked about.
And while I'm at it, what's the difference between 'using' a regex and
being parsed
within a regex? Either way you're using a regex to parse a line and
return the values.
But with one the values are stored in special variables $1 $2 ... while
in the other
they're stored in consecutive elements of some array: @foo[0], @foo[1] ....
I understand there IS a difference. I don't understand why the
difference is there.
> David
Boris
My opinions are my own, and not of my employer.
------------------------------
Date: Fri, 06 Aug 1999 11:33:36 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Perl is Not Opening a file
Message-Id: <37aac701.7556691@news.skynet.be>
elephant wrote:
>craig_davids@my-deja.com writes ..
>
>>open(USER_DATA,"test.txt") || die("can't open datafile: $!");
>
>the user that your CGI scripts are executed under (usually IUSER_<machine
>name> on NT) is not able to see your datafile .. either because the file
>doesn't exist or because IUSER_ doesn't have permission to see it
>
>assuming you're using IIS then my guess is the latter .. especially if
>that's actually your code .. because you'll usually find that there's no
>read access in the CGI directory for the IUSER_ account to cover up the
>holes in IIS security
Yeah, that's right. IIS is a bit weird, in this regard. In order for CGI
scripts to run, you MAY NOT have read access to that directory.
Otherwise, you'd just see the contents of the script as a text file.
The best solution is, IMO, to move the data files to another directory,
one that isn't even in your web space. You didn't really want the users
to be able to access your datafile directly, do you?
Bart.
------------------------------
Date: 1 Jul 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 1 Jul 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.
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 V9 Issue 400
*************************************