[7830] in Perl-Users-Digest
Perl-Users Digest, Issue: 1455 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Dec 11 14:21:05 1997
Date: Thu, 11 Dec 97 11:00:39 -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 Thu, 11 Dec 1997 Volume: 8 Number: 1455
Today's topics:
Re: a certain bug...!!! <zenin@best.com>
Bug in perl5db.pl (Jason A. Smith)
Re: Bug with my script charlot@SPAM-FREE.org
Re: DBM's + Associative Arrays (Jeff Fisher)
Re: DBM's + Associative Arrays <tchrist@mox.perl.com>
Extraneous Digits From Division Operator (Kevin M Simonson)
Re: Finding the FILE SIZE <rets@meta3.com>
Re: getting list of directories, returned as an array <tchrist@mox.perl.com>
Re: GIFgraph legend <Jacqui.Caren@ig.co.uk>
HASH trouble ? *precious help* <philc@writeme.com>
Help for newbie perl scripter <chester@ican.net>
Re: Help with project (Tushar Samant)
Re: Help with project (Mike Stok)
Re: Learning Perl - How to start <allie@icct.net>
Ora Perl Bug - Help <amit@intrex.net>
Re: Perl 5 Contract Opportunity <Jacqui.Caren@ig.co.uk>
Re: Perl equivalent to "statfs" <Jacqui.Caren@ig.co.uk>
Re: Perl Plug-In for Netscape? <bsugars@canoe.ca>
Re: PERL<-->databases ???(newbie) (Jim Esten)
Re: Please advise. Fastest way to line-count files (Gabor)
Re: quick script (Mick Farmer)
Re: real uid cgiwrap error <rootbeer@teleport.com>
Re: removing duplicate entries from the PATH variable <tchrist@mox.perl.com>
Re: Removing Files older than 14 days (Dennis Black)
Re: Review of CGI/Perl book (Tushar Samant)
what does qq() do? <henry@DotRose.com>
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 11 Dec 1997 18:39:04 GMT
From: Zenin <zenin@best.com>
Subject: Re: a certain bug...!!!
Message-Id: <881865758.228401@thrush.omix.com>
Tom Phoenix <rootbeer@teleport.com> wrote:
: Opening with "+>>" is opening a file for appending, also with the ability
: to read from it. If the file exists, new data may be added at the end. If
: it doesn't exist, it should be created. (As it does when you open with
: ">>".)
>snip<
: Require file Retain data
: No Yes +>>
Part of this is misleading: "with the ability to read from it".
When opened with "+>>" you can ONLY read data that you (or someone
else...) has added since you opened it. You can NOT read the data
already in the file, even with a seek (FH, 0, 0). You'd need to
use sysopen() for that with your own set of flags. See open(2)
for available flags.
: There's no obvious way to require a file whose data you don't want.
: Fortunately, that's not likely to be needed. :-)
sysopen (FH, 'file', O_RDWR|O_TRUNC) or die $!;
--
-Zenin
zenin@best.com
------------------------------
Date: 11 Dec 1997 12:23:56 -0500
From: smithj4@rpi.edu (Jason A. Smith)
Subject: Bug in perl5db.pl
Message-Id: <66p7jc$1j56@hadron4.phys.rpi.edu>
I found a small bug or typo in the perl debugger (perl5db.pl)
that comes with perl5.004_01. I checked the one that comes with
perl5.004_04 and it still has the bug. The bug is in the system
subroutine where it saves the STDIN and STDOUT file handles before
calling system, then restores them. Instead of saving STDOUT, it is
saving OUT, so that after making a system call in the debugger the
STDOUT stream is set to OUT and not restored to STDOUT. I am not sure
who I should notify about this bug so I am posting it here hoping that
the right person will see it. A patch for perl5db.pl from perl5.004_04
is included below:
*** perl5db.pl-dist Fri Oct 3 14:04:41 1997
--- perl5db.pl Thu Dec 11 12:16:36 1997
***************
*** 1342,1348 ****
# We save, change, then restore STDIN and STDOUT to avoid fork() since
# many non-Unix systems can do system() but have problems with fork().
open(SAVEIN,"<&STDIN") || &warn("Can't save STDIN");
! open(SAVEOUT,">&OUT") || &warn("Can't save STDOUT");
open(STDIN,"<&IN") || &warn("Can't redirect STDIN");
open(STDOUT,">&OUT") || &warn("Can't redirect STDOUT");
system(@_);
--- 1342,1348 ----
# We save, change, then restore STDIN and STDOUT to avoid fork() since
# many non-Unix systems can do system() but have problems with fork().
open(SAVEIN,"<&STDIN") || &warn("Can't save STDIN");
! open(SAVEOUT,">&STDOUT") || &warn("Can't save STDOUT");
open(STDIN,"<&IN") || &warn("Can't redirect STDIN");
open(STDOUT,">&OUT") || &warn("Can't redirect STDOUT");
system(@_);
--
Jason Smith E-mail: smithj4@rpi.edu
Physics Department Phone: (518)276-2050
Rensselaer Polytechnic Institute FAX: (518)276-6680
Troy, NY 12180-3590 WWW: http://www.rpi.edu/~smithj4/
------------------------------
Date: 11 Dec 1997 11:12:16 -0500
From: charlot@SPAM-FREE.org
Subject: Re: Bug with my script
Message-Id: <66p3d0$dq6@stratus.CAM.ORG>
In article <01bd05ac$bd4e9700$e605bace@pierrette>,
DIK Distributions <dikdist@microtec.net> wrote:
>When I call my perl script, I got that message :
>
>CGIwrap Error: System Error: execv() failed
>
>Error: No such file or directory (2)
>
This has nothing to do with Perl. The first error message clearly states
that it is a CGIWrap error. The second one gives you more details. (Hint:
if your script works from the command-line, it is very likely not a Perl
problem...)
You'll have a better chance of being answered if you go to a newsgroup devoted
to CGI programming and/or HTTP server setup.
Richard.
--
Richard Bellavance -- charlot(at)cam(dot)org -- http://www.cam.org/~charlot/
"All along this path I tread / My heart betrays my weary head
With nothing but my love to save / From the cradle to the grave"
(Eric Clapton, "From the cradle")
------------------------------
Date: 11 Dec 1997 16:00:37 GMT
From: rzxtlg@dogbert.ies-energy.com (Jeff Fisher)
Subject: Re: DBM's + Associative Arrays
Message-Id: <slrn6903h5.qgm.rzxtlg@dogbert.ies-energy.com>
On Thu, 11 Dec 1997 06:23:56 -0800, Creede Lambard
<$_=qq!fearless\@NOSPAMio.com!;y/A-Z//d;print> said:
>
> This would mean that you could make a dbm that would fill your available
> memory. I can only assume that means physical memory plus virtual memory
> (although this may be different for a Mac -- I don't know whether it will
> just eat unused memory or whether it limits itself to the amount of memory
> you set aside for the program). Would such a file be wieldy? I don't know.
> I've never tried.
If you're using a gdbm/ndbm file this shouldn't be a problem. Most of the
data will remain on the disk, and only loaded into memory when you need it.
i.e. You can fill the disk with the hash, and not run up against your
memory limit.
In my experience, using the DB_File databases tends to be more expensive on
memory, but faster. YMMV.
Also, there is a limit on the size of any single data member with the
SDBM, NDBM, and ODBM files. See the AnyDBM_File man page for details.
>
> CJ wrote in message <348FEEE4.4FA6@visitweb.com>...
> >HELP!
> >
> >I'm thinking of creating a simple db and using something like
> >
> > dbmopen(%MYDB,"mydata",0666);
> > $MYDB{$key}=$data;
> > dbmclose(%MYDB);
You probably want to do:
use Fcntl;
use NDBM_File;
tie( %MYDB, 'NDBM_File', O_CREAT|O_RDWR, 0640);
$MYDB{$key} = $data;
untie( %MYDB);
dbmopen is depreciated, and might disappear from future releases.
> >
> >Also if I perform a sort against such an array, how does perl handle
> >such e.g. is it sorted in memory and therefore a memory sizing limit
> >or does it use a memory/disk base sorting method such as per
> >the Unix sort command.
If you're sorting just the key's it shouldn't be too expensive, as only
the keys will be loaded into memory.
If you want to grow a large database, and keep it sorted, you might want
to look into the BTREE database. It's one type of the DB_File databases.
See the man page DB_File for details on how to create / manage such a
database.
--
Jeff Fisher | ...I want to be on the side of the many.
UNIX Sys Admin - IES Industries | Therefore, I take great pains to explain
http://opus.ies-energy.com/jeff/ | to as many people as possible.
| - Johannes Kepler
------------------------------
Date: 11 Dec 1997 18:05:59 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: DBM's + Associative Arrays
Message-Id: <66pa27$9n3$1@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc, jeff@dogbert.ies-energy.com writes:
:> > dbmopen(%MYDB,"mydata",0666);
:You probably want to do:
:tie( %MYDB, 'NDBM_File', O_CREAT|O_RDWR, 0640);
Actually, 0666 is indeed what he wants.
The 0640 in the docs is usually wrong.
Remember, creation mode will be supplied
argument & ~umask.
:dbmopen is depreciated, and might disappear from future releases.
I doubt whether dbmopen will ever go away. But you might
want it defaulting to use DB_File.
--tom
--
Tom Christiansen tchrist@jhereg.perl.com
People who deal with bits should expect to get bitten. --Jon Bentley
------------------------------
Date: 11 Dec 1997 16:33:41 GMT
From: simonsen_nospam@skopen.dseg.ti.com (Kevin M Simonson)
Subject: Extraneous Digits From Division Operator
Message-Id: <66p4l5$4nl@sf18.dseg.ti.com>
Keywords: divide digit
For a "perl" script that I've just written, I want the results rounded
to just one decimal point. I thought that if I had a value <Value> ex-
pressed as a float, that I could get it rounded to one decimal point by the
following code fragment:
$Rounded = int ($Value * 10.0 + 0.5) / 10;
When I print <Rounded> what I'd like to get is "1.4" for 1.39 or 1.41,
but what I'm getting instead for these two values is "1.3999999999999999."
I've got the problem isolated to my little "DivideByTen" script "cat"ed in
the lines I've appended to this article.
"DivideByTen" also includes a work-around I could use. But I'm just
wondering whether the behavior I'm getting from the division operator is a
bug or not. Opinions, anyone?
---Kevin Simonson
#############################################################################
i46^simonson/Perl} cat DivideByTen
#!/usr/local/bin/perl
if ($#ARGV == 0)
{ $Quotient = $ARGV[0] / 10;
print "Dividing by 10: $ARGV[0] / 10 == $Quotient.\n";
$QuotientIntgr = substr ($ARGV[0], 0, length ($ARGV[0]) - 1);
$QuotientFrctn = substr ($ARGV[0], -1, 1);
print " With \"substr\": $ARGV[0] / 10 == $QuotientIntgr.$QuotientFrctn.\n";
}
else
{ print "Usage is\n DivideByTen <divisor>\n";
}
i46^simonson/Perl} DivideByTen 14
Dividing by 10: 14 / 10 == 1.3999999999999999.
With "substr": 14 / 10 == 1.4.
i46^simonson/Perl} DivideByTen 11
Dividing by 10: 11 / 10 == 1.1000000000000001.
With "substr": 11 / 10 == 1.1.
i46^simonson/Perl}
-------------------------------------------------------------------------
Reverence To send me mail, remove "_nospam" and
the eternal. all the vowels from my login name.
------------------------------
Date: Thu, 11 Dec 1997 09:56:00 -0600
From: Ken Holm <rets@meta3.com>
To: psullivan <psullivan@stlnet.com>
Subject: Re: Finding the FILE SIZE
Message-Id: <34900D10.1CFB@meta3.com>
psullivan wrote:
>
> I was wondering how I find the file size under unix. I tried using stat:
>
Use the -s file test.
my $FileSize = (-s $filename) || "$filename doesn't exist";
print $FileSize, "\n";
--
Kennneth A Holm | META 3 - Webmaster |webmaster@meta3.com
PO Box 1508 |----------------------------------|(601)948.3399 x 227
Jackson, MS 39215|PGP Key finger webmaster@meta3.com|(601)948.5999 (fax)
------------------------------
Date: 11 Dec 1997 17:44:43 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: getting list of directories, returned as an array
Message-Id: <66p8qb$7av$1@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
I've always liked this:
#!/usr/bin/perl -lw
@ARGV = qw(.) unless @ARGV;
use File::Find ();
sub find(&@) { &File::Find::find }
*name = \*File::Find::name;
find { print $name if -d } @ARGV;
--tom
--
Tom Christiansen tchrist@jhereg.perl.com
All language designers are arrogant. Goes with the territory... :-)
--Larry Wall in <1991Jul13.010945.19157@netlabs.com
------------------------------
Date: Thu, 11 Dec 1997 11:44:34 GMT
From: Jacqui Caren <Jacqui.Caren@ig.co.uk>
Subject: Re: GIFgraph legend
Message-Id: <EL0wMA.3sr@ig.co.uk>
Posted and emailed.
In article <348EC42B.5171@ford.com>, Tim Edgren <tedgren@ford.com> wrote:
>I've looked at (and run) the sample scripts for Martien's GIFgraph, but
>don't seem to find a way to build a legend among the option
>documentation. Is there a way to use the logo option (or some other
>way) to show a dynamically-built legend?
>
>I'm currently using gnuplot (which supports legends, albeit rather
>inflexibly) but I'd rather have a bit more control over my various
>graphs.
We use GrafsMan - a high quality business graphics package in order
to produce graphs within DataPublisher.
This is an expensive product, but if you want control over the layout
and presentation of your graphs this product has no competitors.
Jacqui
p.s.
We use Grafsman as part of our DataPublisher product and have a long
and good relationship with the supplier, who have responded to the few
problems quickly, so keeping our DP customers (who are mainly large
corporates and multinationals) happy.
We find the "graph template" model provided by grafsman perfect for
designing graphs (with static test data) before applying live datasets
in the reports - No more guessing what the graph will look like!
Grafsman has an add-on to allow generation of GIF's and related
imagemap files. This is targeted towards those who want to offer
drill down graphs as part of a web application.
<PLUG> :-)
FYI: DP is a high-end DTP system using Perl as an embedded programming
language (with a suite of functionality to allow object based creation
and modification of report contents during the build process.
It also uses DBI to connect to databases - both DP and DBI being Tim
Bunce products :-)
See http://www.ig.co.uk/dp.html for more info
</PLUG>
--
Jacqui Caren Email: Jacqui.Caren@ig.co.uk
Paul Ingram Group Fax: +44 1483 419 419
140A High Street Phone: +44 1483 424 424
Godalming GU7 1AB United Kingdom
------------------------------
Date: Thu, 11 Dec 1997 18:02:45 +0100
From: PhiL CoVaL <philc@writeme.com>
Subject: HASH trouble ? *precious help*
Message-Id: <34901CB5.4C18@writeme.com>
hi
how to fill all hash's keys with values ?
ps: sorry if this mail is not welcome
i dont understand this :
source.pl :
-----------
print "... Make hash \n";
%fiche=(
'specialite', '' ,
'annee' , '' ,
'orientation' , '' ,
'modnum' , ''
);
while ( ($k,$v) = each (%fiche) )
{
$f=$k.".txt" ;
$t = ` cat $f ` ;
$fiche{'$k'}=$t;
print "... f.$k = $t \n";
}
DISPLAY :
---------
*** MAIN / / LoadFromFiles <p>
... Make hash
... f.modnum =
... f.specialite = 1er-Cycle
... f.orientation =
... f.$k =
... f.annee = 1
... Loaded :
--
XxXXxXXXXxXXXxXXxXXxXXXxXXxXXxXXxXxXXxXXXxXXxXxxXxxXxXXXxXxXXXxXxxXXXxxX
X -==PhILiPpE CoVaL==- MailTo:philc@writeme.com IRC: RzR x
x http://rzr.base.org Don't leap us to conclusions, Dale, X
X What makes you think this alien Creature is gonna eat Dr Zark ?!? x
XxxxXxXxXxXxxXxxXxXxXxxXXxXXXxXxXXXxXxxXXXXXxXxxxXxXXxXxxXXXXxxxXXXxXXxX
All Weapons you need to FIND SOMETHING, SOMEWHERE on the internet are at
:
http://hitseeker.base.org
------------------------------
Date: Thu, 11 Dec 1997 10:51:52 -0500
From: Chester-- <chester@ican.net>
Subject: Help for newbie perl scripter
Message-Id: <34900C17.6155FB2B@ican.net>
Hi,
I'm a totally new perl programmer and I have a task for someone who can
help me out. Appreciate is doled out in advance, thank you thank you
thank you.
Here's the situation. I need to cumulate an amount from a hidden
variable on a series of pages. I think I have the url-encoded input
done okay, using post, its split-up into an array, how do take the part
I need to store and dump it into a db file, then when done, how do I
read it out again.
This file needs to be renewed for every new user who hits the page and
it needs to accumulate only one character per dump. I.E. each page will
pass only one character (the letter A, B,C, or D) to the db file. The
db file then will be a string of those characters which will be read and
processed down the line. The processing part is done, but I don't know
how to write to the file or read it.
do I use $DATAOUTFILE or what? and how??
Thanks again for the help,
cheers
Steve Chambers
------------------------------
Date: 11 Dec 1997 10:16:18 -0600
From: scribble@tekka.wwa.com (Tushar Samant)
Subject: Re: Help with project
Message-Id: <66p3ki$1d7@tekka.wwa.com>
You should look at the FAQs, the man page entry for the open function,
and a few other file operations. The SIMPLIFIED summary: you will keep
a file intact if you only ever open it for reading, you will hammer
a file the instant you open it for writing. You can open a file for
appending, and for certain combinations of the above to achieve certain
effects, including creating a file if it doesn't exist. There is no such
thing as editing a file in-place; you must resort to a temp file.
But it's all explained much better in the FAQs and man pages.
bsanant@uclink.berkeley.edu writes:
>
>Hi,
>
>I'm very new to perl, and I recently started a job. A few days ago, I was
>asked to do a small project, and I need help. Basically, the points I
>need help with are:
>
>1. Is there a way to find a certain part of a file, bookended by two
>indicators, and delete the entire part, using the indicators?
> ex. (a) ....... (b) where a and b are the indicators and ... is
>the text in between
>
>
>2. How do I open a file, make some changes, and save under a new name,
>while keeping the original file intact? (I guess this is probably pretty
>easy, but I'm still learning, and I need to complete quickly. I have the
>O'Reilly book, Learning Perl)
>
>
>3. Finally, is there a way to insert this new file into a certain part of
>another file?
> for instance, between (c) and (d) of the third file
>
>
>Please reply to me personally, unless you want to post here.
>
>Thanks for your help in advance,
>
>Birjinder
------------------------------
Date: 11 Dec 1997 11:16:08 -0500
From: mike@stok.co.uk (Mike Stok)
Subject: Re: Help with project
Message-Id: <66p3k8$oe$1@stok.co.uk>
In article <66ogpv$dfp$1@agate.berkeley.edu>,
Birjinder Singh Anant <bsanant@uclink.berkeley.edu> wrote:
>
>Hi,
>
>I'm very new to perl, and I recently started a job. A few days ago, I was
>asked to do a small project, and I need help. Basically, the points I
>need help with are:
>
>1. Is there a way to find a certain part of a file, bookended by two
>indicators, and delete the entire part, using the indicators?
> ex. (a) ....... (b) where a and b are the indicators and ... is
>the text in between
You can use the .. operator in a scalar context (check the perlop man
pages for ehat this does...) as in the following 15 line example:
#!/usr/local/bin/perl -w
$start = quotemeta '(a)';
$finish = quotemeta '(b)';
while (<DATA>) {
print unless /$start/ .. /$finish/;
}
__END__
This is the text read by the DATA filehandle
(a)
This should be deleted...
(b)
... but not this
where the .. flips when a line of data matches (a) - the quotemeta saves
you from worrying that () are netacharacters - and flops back when (b)
matches a line of data. Note that it can flip-flop many times, not just
once.
>2. How do I open a file, make some changes, and save under a new name,
>while keeping the original file intact? (I guess this is probably pretty
>easy, but I'm still learning, and I need to complete quickly. I have the
>O'Reilly book, Learning Perl)
you can read from teh standard input and write to the standard output, so
prog <infile >outfile
will read infile and write outfile (using unix command line redirection)
>3. Finally, is there a way to insert this new file into a certain part of
>another file?
> for instance, between (c) and (d) of the third file
yes, you would do it in much the same way as in any other language, maybe
read teh inoput file a line at a time and either copy it to the output, or
if you discover a marker then open the new file, read it and copy it to
the output, continue reading the original file when the new file is
exhausted.
If the files are small you might read both into arrays in memory and merge
the arrays and write the result out.
Useful things to look at are open and <>
Hope this helps,
Mike
--
mike@stok.co.uk | The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/ | PGP fingerprint FE 56 4D 7D 42 1A 4A 9C
http://www.tiac.net/users/stok/ | 65 F3 3F 1D 27 22 B7 41
stok@colltech.com | Collective Technologies (work)
------------------------------
Date: Thu, 11 Dec 1997 13:01:38 -0600
From: Allie <allie@icct.net>
To: "Jeremy D. Zawodny" <jzawodn@wcnet.org>
Subject: Re: Learning Perl - How to start
Message-Id: <34903891.90EF86E5@icct.net>
Jeremy D. Zawodny wrote:
> On 8 Dec 1997 01:55:10 GMT, "Brett" <brett@moggy.com> wrote:
>
> >Howdy.
> >
> >I intend to begin learning Perl. I've never learnt anything more
> complexed
> >than HTML so I'll need to start from the very basics. I just
> needed to
> >know what I'll need to test the scripts (ie, can I test from win
> 95??)
> >because I don't wanna buggar up the server I'm on.
>
> Pick yourself up a copy of "Learning Perl on Win32 Systems" and
> start
> from there.
Does anyone have any more info on this book? I don't have
programming experience, but I'm eager to start learning Perl. Does
this book start with the very basic basics? Can anyone reccommend a
book that does - I'm going to check out the llama and camel, but
from previous posts it doesn't seem like these really start at basic
basics. I'll be installing Perl on my computer, running Win95. Any
suggestions via email and/or posted appreciated. Thanks, allie
------------------------------
Date: Thu, 11 Dec 1997 13:11:35 -0500
From: amit srivastava <amit@intrex.net>
Subject: Ora Perl Bug - Help
Message-Id: <34902CD7.3317@intrex.net>
We encountered a problem, which maybe a
generic oraperl bug... using a string with
length exceeding 255 in a bind statement hangs. This was when we
were running with HP-UX 10.20 and Oracle 7.3.3.4.1 using Perl4.
This problem did not happen with Oracle 7.1.6 and hp ux 10.01.
When we upgraded someting got lost.
Is there some parameter that oraperl needs to be re-compiled with
thaqt one does not see this kind of problem?
If you can email me an answer, it would be greatly appreciated.
------------------------------
Date: Thu, 11 Dec 1997 14:41:57 GMT
From: Jacqui Caren <Jacqui.Caren@ig.co.uk>
Subject: Re: Perl 5 Contract Opportunity
Message-Id: <EL14ty.47u@ig.co.uk>
In article <01bd0090$62fa3fa0$6f0a010a@LJBWV.best-people.co.uk>,
Simon Kemp <skemp@best-people.co.uk> wrote:
>
>
>I have some excellent contract opportunities for 3-12 months with a rapidly
>expanding small firm who have just landed 6 major contracts for on-line
>credit card clearing. They want both junior and senior programmers with
>UNIX/NT, Internet knowledge, Perl 5 with Object Orientated Programming, C
>and HTTP. Electronic Commerce, Cryptography and SET is prefered.
I undersand that they may also be interested in perm staff as well -
if they are the ones I am thinking of...
There seems to be a massive shortage of good perl programmers in the UK
and salary expectations are high in places such as london, where banks
etc are "getting into the internet". :-)
Of course, living expenses are high and living standards are low. :-(
If you can put up with this, you can probably make a killing for the next
year or so until enough home grown talent appears.
All the best,
Jacqui
--
Jacqui Caren Email: Jacqui.Caren@ig.co.uk
Paul Ingram Group Fax: +44 1483 419 419
140A High Street Phone: +44 1483 424 424
Godalming GU7 1AB United Kingdom
------------------------------
Date: Thu, 11 Dec 1997 11:17:45 GMT
From: Jacqui Caren <Jacqui.Caren@ig.co.uk>
Subject: Re: Perl equivalent to "statfs"
Message-Id: <EL0vDM.3p0@ig.co.uk>
In article <349a0952.31890315@woody.wcnet.org>,
Jeremy D. Zawodny <jzawodn@wcnet.org> wrote:
>[original author automagically cc'd via e-mail]
>
>On Tue, 02 Dec 1997 13:45:26 -0800, Satish Bhagavatula
><sbhagava@cs.uml.edu> wrote:
>
>> Is there any system call in perl equivalent to "statfs in C" to get
>>information about a mounted file system.
>
>I don't believe so.
perldoc -f syscall
in sys/syscall.ph I notice a SYS_statfs.
>Jeremy
>--
>Jeremy D. Zawodny jzawodn@wcnet.org
>Web Server Administrator www@wcnet.org
>Wood County Free Net (Ohio) http://www.wcnet.org/
--
Jacqui Caren Email: Jacqui.Caren@ig.co.uk
Paul Ingram Group Fax: +44 1483 419 419
140A High Street Phone: +44 1483 424 424
Godalming GU7 1AB United Kingdom
------------------------------
Date: Thu, 11 Dec 1997 13:28:50 -0500
From: Benjamin Sugars <bsugars@canoe.ca>
To: lvirden@cas.org
Subject: Re: Perl Plug-In for Netscape?
Message-Id: <349030E2.5E3B@canoe.ca>
[ ... mailed to lvirden@cas.org as well ... ]
lvirden@cas.org wrote:
>
> According to Alex Tang <altitude@ren.us.itd.umich.edu>:
> :I'm not sure if this is what you're talking about, but try
> :http://interact.canoe.ca/~bsugars/nsapi_perl.htm
>
> when I attempt access to that page, I get:
>
> Not Found
Someone somewhere dropped the last 'l' in a link to the
document nsapi_perl.html.
I now have both nsapi_perl.html and nsapi_perl.htm on the
server so either should work.
-Ben
--
Ben Sugars <bsugars@canoe.ca>
Senior Webmaster,
CANOE Canadian Online Explorer,
http://www.canoe.ca/
------------------------------
Date: 11 Dec 1997 10:08:46 -0600
From: jesten@earth.execpc.com (Jim Esten)
Subject: Re: PERL<-->databases ???(newbie)
Message-Id: <66p36e$qp$1@earth.execpc.com>
robban (robnet@hem1.passagen.se) wrote:
: [snip]
: : Grab yourself a copy of Shishir Gundavarum's CGI Programming on the
: : World Wide Web and check out his Sprite.pm module. Gives you SQL-ish
: : control over flat file "databases". Several months ago, I offered up
: : my little in house bug tracker called BugBase as an example of a
: : Sprite.pm based application. Offer still stands. It ain't rocket
: : science and some of it ain't even pretty, but it is a functional
: : example... at least useful as a learning tool.
: If BugBase can handle millions of entries I'm sure MS would be interested
: in it. 8?>
In a recent teaching excursion, I ran across a menu option for the
"Microsoft Anomaly Database". I couldn't imagine there being enough
disk space to hold it! :)
But,, on topic... Sprite.pm based stuff holds up pretty well up to
about 5000 records. Everything beyond that, we're moving to Oracle.
(not that we NEED that much power... yet... but we're optimistic)
Jim
--
Jim Esten
WebDynamic
jesten@wdynamic.com http://wdynamic.com
------------------------------
Date: 11 Dec 1997 15:47:24 GMT
From: gabor@vinyl.quickweb.com (Gabor)
Subject: Re: Please advise. Fastest way to line-count files
Message-Id: <slrn6902b6.3ph.gabor@vinyl.quickweb.com>
In article <348ECCE8.718A@centtech.com>, Ravi Kumar wrote:
- All,
-
- I have 2 sets of files. The first set is a bunch of
- small (<10K lines) files. The second set is a bunch of large
- (> 200K lines ) files. I need to line-count these.
- 1. I have found that perl is faster than wc(1)
You've got to be joking. I just tested it and it isn't tru for the
systems I have access to. What Unix are you running?
- 2. In perl I can do it in two ways.
- A1:
- open FH, $file;
- while (<FH>){$linecount++}
- ...
- OR
- A2:
- open FH, $file;
- @jj = <FH>;
- $linecount = $#jj + 1;
print $.; # should also be fine for line count
and try below to read the file into nothing.
() = <FH>;
gabor.
--
Well, enough clowning around. Perl is, in intent, a cleaned up and
summarized version of that wonderful semi-natural language known as
"Unix".
-- Larry Wall in <1994Apr6.184419.3687@netlabs.com>
------------------------------
Date: Thu, 11 Dec 1997 11:29:19 GMT
From: mick@picus.dcs.bbk.ac.uk (Mick Farmer)
Subject: Re: quick script
Message-Id: <EL0vwv.GCD@mail2.ccs.bbk.ac.uk>
Dear Colin,
For your IP addresses, you could use something like this.
s/([0-9]+\.[0-9]+\.[0-9]+)\.[0-9]+/$1.*/g
This works fine for class C addresses. You should check
the first integer to see if you've got any class B
addresses.
You can use a similar pattern for your DNS entries.
Regards,
Mick
------------------------------
Date: Thu, 11 Dec 1997 10:47:03 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: jocham@cris.com
Subject: Re: real uid cgiwrap error
Message-Id: <Pine.GSO.3.96.971211104555.18770C-100000@user2.teleport.com>
On Thu, 11 Dec 1997 jocham@cris.com wrote:
> CGIwrap Error: Real UID could not be changed!
Sounds like an error from CGIwrap, not from Perl. If you can't find the
answer in the appropriate docs and FAQs, check with a newsgroup about CGI
scripting. Good luck!
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
Ask me about Perl trainings!
------------------------------
Date: 11 Dec 1997 17:52:52 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: removing duplicate entries from the PATH variable
Message-Id: <66p99k$7av$2@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc,
Randal Schwartz <merlyn@stonehenge.com> writes:
:I presume you mean "later occurances", not "first occurance". :-)
No, he meant "later occurREnces". :-)
See my exhausti{ve,ng} posting on this.
--tom
--
Tom Christiansen tchrist@jhereg.perl.com
"We all agree on the necessity of compromise. We just can't agree on
when it's necessary to compromise."
--Larry Wall in <1991Nov13.194420.28091@netlabs.com>
------------------------------
Date: Thu, 11 Dec 1997 11:23:58 -0700
From: dennis.black@ualberta.ca (Dennis Black)
Subject: Re: Removing Files older than 14 days
Message-Id: <dennis.black-1112971123580001@wabamun.ucs.ualberta.ca>
In article <348EA0F6.5E28B484@pc-design.de>, pos@pc-design.de wrote:
> Hugh wrote:
>
> > I am having difficulty writing an efficient script to delete all files in a
> > preset directory over a certain age. If a file is older than 14 days I want
> > to delete it. There are likely to be upwards of a couple of thousand or so
> > files in the directory. How is the best way to check the create dates and
> > delete if appropriate. As I said there is no need to recurse subdirs as they
> > won't exist. All files to be deleted will have a .ABC suffix, the routine
> > should ignore files without this.
>
> If you are running a UNIX system, why not using a simple cron job that
> uses find ./ ... | xargs rm ?
> Try "man find" for an exact synopsis and syntax
Here's one I use for removing one-year-olds on an AIX box;
open(FIND, "find /usr/local/mail/archives/ -mtime +365 -name '*.archive.*' -exec
rm -f {} \\; |") || die "Can't run find command: $!";
close (FIND);
exit;
Dennis.Black@ualberta.ca
Computing and Network Services
Information Resources Consultant
Room 323D General Services Building
University of Alberta, Edmonton
T6G 2H1
ph 403-492-9329
fax 403-492-1729
------------------------------
Date: 11 Dec 1997 10:02:24 -0600
From: scribble@tekka.wwa.com (Tushar Samant)
Subject: Re: Review of CGI/Perl book
Message-Id: <66p2qg$b5@tekka.wwa.com>
comdog@computerdog.com writes:
>In article <66o7rp$7ju@tekka.wwa.com>, scribble@tekka.wwa.com (Tushar Samant) wrote:
>
>>It's incredible how
>>everyone is recommending this extraordinary book for the fulfilment
>>of one's web dreams. It has arrived. Every hacker born in this
>>decade will grow up with an instinctive feel for the CGI/Perl
>>cookbook, or he will be no hacker.
>
>well, everyone excluding Tom C. and me is suppose.
>
>it's a rather bold assertation that this book is requisite for
>hacker-dom though.
No flames here -- I just wanted to say let's meet again in 10 years
(at Internet World) and see who's the hacker.
------------------------------
Date: Thu, 11 Dec 1997 13:18:49 -0500
From: Henry Hartley <henry@DotRose.com>
Subject: what does qq() do?
Message-Id: <34902E89.9D391A21@DotRose.com>
I cannot find any mention of this function except in code examples, as
follows:
$sql = qq(select * from <table> where LastName like '$lastname\%'
order by LastName);
what does the qq do?
I've been using sprintf("select... Why should I use qq instead?
Henry
------------------------------
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 1455
**************************************