[7850] in Perl-Users-Digest
Perl-Users Digest, Issue: 1475 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Dec 15 10:17:16 1997
Date: Mon, 15 Dec 97 07:00:47 -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 Mon, 15 Dec 1997 Volume: 8 Number: 1475
Today's topics:
"sh.exe: syntax error" But I don't even use sh.exe! <koos_pol@bigfoot.com>
[THANKS] Re: Problem: My mailbot dropping lines (Grey Cloak)
Re: Another Sort problem, this time with numbers vipul@pobox.com
Re: can perl do multi-threaded programming? <Jacqui.Caren@ig.co.uk>
DATABASE HELP!! <mystery@nb.net>
Re: Dynamically Sending an Adobe Acrobat PDF File to th <danvdw@microsoft.com>
Extended character (?) <xcaslavs@fi.muni.cz>
Re: Extended character (?) <$_=qq!fearless\@NOSPAMio.com!;y/A-Z//d;print>
Re: File test operators with symbolic links <hietanie@koah.research.nokia.com>
Re: German characters <rra@stanford.edu>
Re: German characters (Honza Pazdziora)
Re: German characters <rra@stanford.edu>
Re: help me <$_=qq!fearless\@NOSPAMio.com!;y/A-Z//d;print>
How to do a "rollback" with Win32::ODBC (Bruce Sams)
Re: How to do a "rollback" with Win32::ODBC <r_keuchel@smaug.netwave.de>
How to install MD5 module ? <koos_pol@bigfoot.com>
Re: How to install MD5 module ? (Honza Pazdziora)
Re: Mirror PUT program <Jacqui.Caren@ig.co.uk>
Re: Newbie Help: Removing or ReDimensioning an Array (Mike Stok)
Re: Newbie Help: Removing or ReDimensioning an Array <lach@lach.net>
Re: Newbie Help: Removing or ReDimensioning an Array (Mick Farmer)
Re: Newbie question. Do you recommend moving from C? (Kenny A. Chaffin)
Re: Newbie question. Do you recommend moving from C? (Kenny A. Chaffin)
Re: pgp encrypion via perl script (Michael Budash)
Re: pgp encrypion via perl script <rra@stanford.edu>
Re: pgp encrypion via perl script <rra@stanford.edu>
Re: pgp encrypion via perl script nospam@minivend.com
Re: pgp encrypion via perl script <rra@stanford.edu>
Re: semget (Mick Farmer)
Sorting an array in PERL 4 <ycueff@club-internet.fr>
Re: Sorting an array in PERL 4 <david.martin@biotek.uio.no>
Re: terminate input on CGI.pm in Win95 Gurusamy Sarathy <Harald.Joerg@mch.sni.de>
Re: When is FLOCK not supported? <rra@stanford.edu>
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 15 Dec 1997 09:07:52 +0100
From: Koos Pol <koos_pol@bigfoot.com>
Subject: "sh.exe: syntax error" But I don't even use sh.exe!
Message-Id: <3494E558.FEC@bigfoot.com>
I have this script, processing a html dir tree. I use File::Copy +
File::Base + File::Find.
All of a sudden he spits out syntax error messages from sh.exe, but I
never use sh.exe. He only does it a few times, and all of the rest seems
to go ok.
Where do these sh.exe messages come from? Anyone have a clue what is
going on here?
| [C:\test]perl \utils\blockchange.pl
| Building filelist...
> | c:/utils/sh.exe: syntax error: `(' unexpected
> | c:/utils/sh.exe: syntax error: `(' unexpected
| Processing c:/test/depart/depinfo.html
| Processing c:/test/depart/goals.html
| Processing c:/test/doc/feedback.html
| ...
--
Koos Pol
----------------------------------------------------------------------
S.C. Pol tel: +31 20 3116122
PC Systems Administrator email: Koos_Pol@bigfoot.com
Compuware Europe PGP public key available upon request
A little inaccuracy sometimes saves tons of explanation.
-- H. H. Munroe
------------------------------
Date: 15 Dec 97 13:34:50 GMT
From: greycloak@greycloak.access.one.net (Grey Cloak)
Subject: [THANKS] Re: Problem: My mailbot dropping lines
Message-Id: <slrn699g83.1c4.greycloak@greycloak.access.one.net>
On Sun, 14 Dec 1997 14:32:34 -0500, brian d foy <comdog@computerdog.com> wrote:
>In article <slrn696os2.nc.greycloak@greycloak.access.one.net>,
>greycloak@greycloak.access.one.net (Grey Cloak) wrote:
>
>> I trying to create a mailbot. Since I lost my old one during an upgrade.
>
> while( $_ = <IN> )
>
>otherwise you are reading a line in the while condition, then
>immediately reading the next line thus losing the previous one.
>
Thanks,
That got it working. removing the $_ = <IN>;
Got the bot working and completed, and added some logging features.
I got the mailbot at mailbot@greycloak.access.one.net
------------------------------
Date: Mon, 15 Dec 1997 06:21:15 -0600
From: vipul@pobox.com
To: mail@vipul.net
Subject: Re: Another Sort problem, this time with numbers
Message-Id: <882187893.1445003273@dejanews.com>
In article <19971214061501.BAA23773@ladder02.news.aol.com>,
tiwason@aol.com (Tiwason) wrote:
>
> If i have a bunch of numbers to sort say
> 5,7,2,1,21,4,11,32
>
> is there anyway to get around them sorting like
> 1,11,2,21,32,4,5,7
>
@sorted = sort {$a cmp $b} (5,7,2,1,21,4,11);
man perlfaq5 for details.
cheers,
vipul
--
Powell lingered. "How's Earth?"
It was a conventional enough question and Muller gave the
conventional answer, "Still spinning."
-- "Reason", Asimov.
==================================================================
Vipul Ved Prakash | - Electronic Security & Crypto
mail@vipul.net | - Web Objects
91 11 2233328 | - PERL Development
198 Madhuban IP Extension | - Linux & Open Systems
Delhi, INDIA 110 092 | - Networked Virtual Spaces
-------------------==== Posted via Deja News ====-----------------------
http://www.dejanews.com/ Search, Read, Post to Usenet
------------------------------
Date: Mon, 15 Dec 1997 13:14:31 GMT
From: Jacqui Caren <Jacqui.Caren@ig.co.uk>
Subject: Re: can perl do multi-threaded programming?
Message-Id: <EL8FG7.Jno@ig.co.uk>
In article <666l7h$e06$2@csnews.cs.colorado.edu>,
Tom Christiansen <tchrist@mox.perl.com> wrote:
> [courtesy cc of this posting sent to cited author via email]
>
>In comp.lang.perl.misc,
> Gary Howland <ghowland@hotlava.com> writes:
>:Tom Christiansen wrote:
>:Tom's at it again, with that little program of his. This is not
>:multithreading, it's multiprocessing. fork() is a pathetic solution.
>
>You're playing word games. The code is clearly multitasking: there are
>two PCs running concurrently. And I can't see what you mean by pathetic.
>You trying to pick a fight? That's two messages in a row I've read from
>you like this. I'd really rather not.
Tom,
If I had posted your example, I would have (quite rightly) been shot
down in flames by anyone who understands the difference between process
and thread models. I don't want to start a war about what is a process
and what is a thread - I don't even want to start talking about physical
and logical thread models ala Cray's approach. For many in clp.misc who
are probably CW's, your posting could be quite easily misinterprested to
mean fork() is how you multithread a program.
I and many others here look to people such as yourself (and the rest of
the p5p team) to provide concise and accurate responses, Your response
in this case was well below your normal, very high standards.
Please do not take offence at the above. Your contributions are welcomed
by lesser perl people such as myself :-), and I hope that this is not
seen as any form of personal attack.
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: Mon, 15 Dec 1997 09:51:24 -0800
From: "Justin Markle" <mystery@nb.net>
Subject: DATABASE HELP!!
Message-Id: <349543d4.0@news4.kcdata.com>
I am trying to process a database for searching using PERL. I have a
database with phone numbers and other things. My main question here is how
can I get an area code search to only search for matching places in a
particular area code? The entire phone field contains areacode+phone number
(e.g. 555-555-1212). I am planning on making this database a (:) delimited
database. Is there an easier way to do this database search without putting
the area code in its own field?
Here's what I plan on using for the phone search:
if (($areacode = $FORM{'areacode'}) && !@results) {
for ($I = 0; $I <= $maxn; $I++) {
if ($areacode eq $add[$I]{'areacode'}) {
push(@results,$I);
}
}
if ($areacode = $FORM{'areacode'}) {
@r2 = @results;
foreach $I (@r2) {
if ($areacode ne $add[$I]{'areacode'}) {
@results = grep(!/$I/,@results);
}
}
etc etc.... for each search field
What can I change here to only search the first 3 numbers for the areacode?
Or does anyone recommend using a database server? If so which one? my
database is up to 300+ rows
Thanks
Justin Markle
mystery@nb.net
------------------------------
Date: Sun, 14 Dec 1997 23:09:56 -0800
From: "Daniel F. Van Der Werken, Jr." <danvdw@microsoft.com>
Subject: Re: Dynamically Sending an Adobe Acrobat PDF File to the Browser using PERL in a CGI Script
Message-Id: <672l4c$1u8@news.microsoft.com>
Martien:
Thanks!
I copied the script and here's how it is exactly:
#!/usr/local/bin/perl5 -w
# script: getpdf.pl
#use strict;
my $buffer = "";
my $PDF_DIR = "c:/ntreskit";
my $filedir = $ENV{PATH_INFO} or cgi_error("No file name supplied");
#$filename = $PDF_DIR . $filename;
$filename = "c:\\ntreskit\\perl\\samples.pdf";
open(PDF, $filename) or cgi_error("Error opening $filename: $!");
binmode(PDF);
my $filesize = (stat(PDF))[7] or cgi_error("Cannot stat $filename: $!");
print "Content-Type: application/pdf\n";
print "Content-Length: $filesize\n\n";
while(read(PDF,$buffer,4096))
{
print $buffer;
}
close(PDF);
sub cgi_error
{
my $error = shift;
print "Content-type: text/plain\n\n";
print "Some error occurred:\n\n";
print $error . "\n" if (defined($error));
exit;
}
the file is located at http://server/perl/sendpdf.pl
I also have http://server/perl/sendpdf.htm which contains:
<html><title>SENDPDF</title>
<body>
<p><b>Click on <a href="sendpdf.pl?">me</a> to do the SENDPDF.PL
script.</b></p><br>
<p><b>Click on <a href="samples.pdf">me</a> to view the PDF
directly.</b></p><br>
<p><b>Better yet, try <a
href="http://shadowrunner/perl/sendpdf.pl">this</a></b></p><br>
</body>
</html
In all cases, your $filename scheme gave me a "/path-to-file/sendpdf.pl".
The file I needed is "/path-to-file/samples.pdf". Rather than try to figure
out how to remove "sendpdf.pl" from the $filename you created, I just hard
coded it. That's good enough. What I need is a script generated PDF. Just
script generated. I need the mimetype and data. I don't need to always be
selecting dynamic files (althougth that is a nice thing).
Regardless, the browser returns "An error has occurred while tryign to use
this document" in all cases. I do have Adobe Acrobat Reader loading, just
nothing in the browser. Likewise, if I will often get a dialog box asking
for the password to the file. <Huh?>
Of course, I'm running this on a Windows NT 4.0 server with IIS 3.0
installed and the Perl from the NT Resource Kit.
I know I'm almost there. Just one small detail is keeping this from
working. I appreciate your assistance.
---Dan---
------------------------------
Date: Mon, 15 Dec 1997 12:19:31 GMT
From: Martin Caslavsky <xcaslavs@fi.muni.cz>
Subject: Extended character (?)
Message-Id: <34952053.F686236C@fi.muni.cz>
In my script I am calling an external program and I need to give it
<ctrl+d> character, like exec "program parameters" where parameters are
parameters followed ctrl+d.
How could I do it?
------------------------------
Date: Mon, 15 Dec 1997 06:17:34 -0800
From: "Creede Lambard" <$_=qq!fearless\@NOSPAMio.com!;y/A-Z//d;print>
Subject: Re: Extended character (?)
Message-Id: <673e5a$3pg@bgtnsc01.worldnet.att.net>
Usually I do something like this:
$myCommand = "foo bar baz " . "\cD";
system("$myCommand") or die "Couldn't do the following command: $myCommand
because: $!";
The same thing should work for exec. Hope this helps.
--- Creede Lambard
Minister of Irregular Expressions
Programming Republic of Perl
Martin Caslavsky wrote in message <34952053.F686236C@fi.muni.cz>...
>In my script I am calling an external program and I need to give it
><ctrl+d> character, like exec "program parameters" where parameters are
>parameters followed ctrl+d.
>How could I do it?
>
------------------------------
Date: 15 Dec 1997 13:30:04 +0200
From: Jarkko Hietaniemi <hietanie@koah.research.nokia.com>
Subject: Re: File test operators with symbolic links
Message-Id: <dp3ejuoncz.fsf@koah.research.nokia.com>
Damani Walton <walton@world.std.com> writes:
> How can one test the attributes of a symbolic link? Using the file
> test operators, I tell whether a file is a link or not, but tests of
lstat($symlinkfilename);
-C _
The _ means 'use the cached value of the previous stat/lstat'.
This is documented under perlfunc/stat and perlfunc/-X.
> What I want to do is test the inode change time of a symbolic link
> which references a file which may or not actually exist. Using the -C
> operator doesn't give me the information that I want. It just gives
I am curious: is the ctime really different from mtime and atime for
symlinks in your file system? Those three times tend to get stamped
once (by symlink()) and never change after that because all the
attribute changing system calls tend to do the usual thing for
symlinks. I have seen lchmod() and lchown() but lutime(), no.
--
Jarkko Hietaniemi
------------------------------
Date: 15 Dec 1997 00:16:04 -0800
From: Russ Allbery <rra@stanford.edu>
To: "Janos Blazi" <jblazi@wuerzburg.netsurf.de>
Subject: Re: German characters
Message-Id: <m34t4bvx6j.fsf@windlord.Stanford.EDU>
[ Posted and mailed. ]
Janos Blazi <jblazi@wuerzburg.netsurf.de> writes:
> I am using PERL ($]=5.00390) with NT 4.0 in Germany. I have noticed,
> that the german v (i.e. an o with two dots on it) is not matched by
> \w. In the camel book the authors say that would depend of my
> "locale". I do not understand this.
Read the perllocale man page and see if that clears up your confusion. By
default, Perl assumes the "C" locale, which is essentially equivalent to
an American English locale.
--
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print
------------------------------
Date: Mon, 15 Dec 1997 09:05:10 GMT
From: adelton@fi.muni.cz (Honza Pazdziora)
Subject: Re: German characters
Message-Id: <adelton.882176710@aisa.fi.muni.cz>
> > I am using PERL ($]=5.00390) with NT 4.0 in Germany. I have noticed,
[...]
> Read the perllocale man page and see if that clears up your confusion. By
> default, Perl assumes the "C" locale, which is essentially equivalent to
> an American English locale.
I wanted to give the same answer but then I thought: they might not
have man pages on Windoze and they might not have locales on Windoze ;-)
--
------------------------------------------------------------------------
Honza Pazdziora | adelton@fi.muni.cz | http://www.fi.muni.cz/~adelton/
I can take or leave it if I please
------------------------------------------------------------------------
------------------------------
Date: 15 Dec 1997 01:21:02 -0800
From: Russ Allbery <rra@stanford.edu>
Subject: Re: German characters
Message-Id: <m3zpm3t11d.fsf@windlord.Stanford.EDU>
Honza Pazdziora <adelton@fi.muni.cz> writes:
> I wanted to give the same answer but then I thought: they might not have
> man pages on Windoze and they might not have locales on Windoze ;-)
They do have man pages, although I forget what format they're distributed
in. The folks doing the Windows port made sure of that. :) As for
locales, they're a POSIX thing, so they *should* be at least relatively
portable, and I believe the current Windows ports have support for
locales.
I'm not a Windows Perl user, though, so I could have some of the details
wrong.
--
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print
------------------------------
Date: Mon, 15 Dec 1997 06:25:27 -0800
From: "Creede Lambard" <$_=qq!fearless\@NOSPAMio.com!;y/A-Z//d;print>
Subject: Re: help me
Message-Id: <673ek2$5r6@bgtnsc01.worldnet.att.net>
It's often easier to work around a problem than it is to try to plow through
it:
opendir(DIR,".") or die "Can't open current directory";
@files = readdir(DIR);
closedir DIR;
foreach $file (@files) {
chomp($file);
next unless $file =~ /secret$/i;
open(WORDSLIST,$file) or die "Can't open $file";
#
# the rest of your code goes here
#
}
Hope this helps.
--- Creede Lambard
Minister of Irregular Expressions
Programming Republic of Perl
Ted Fiedler wrote in message ...
>what am i doing wrong??? i have a file named something.secret in the dir
>pls help...
>am using perl 5.003
>
>#!/usr/bin/perl
>while ($filename = <*.secret>) {
> open (WORDSLIST, $filename) ||
> die "cant open $filename: $!";
> if (-M WORDSLIST < 7) {
> while ($name = <WORDSLIST>) {
> chomp ($name);
> $word = <WORDSLIST>;
> chomp ($word);
> write;
> }
> }
> close (WORDSLIST);
>}
>format STDOUT =
>@<<<<<<<<<<<<<<< @<<<<<<<<< @<<<<<<<<<<<
>$filename, $name, $word
>.
>format STDOUT_TOP =
>page @<<
>$%
>
>Filename Name Word
>====================== =============== ================
>.
>
>
>thanks in advance
>
>
------------------------------
Date: 15 Dec 1997 08:10:07 GMT
From: sams@ipp-garching.mpg.de (Bruce Sams)
Subject: How to do a "rollback" with Win32::ODBC
Message-Id: <672okv$1osi$1@cdserv.rzg.mpg.de>
Hello,
I have been scratching my head over the problem of getting a perl
connection to a database which permits atomic transactions. That
is I would like to set the autocommit mode to false and then be
able to give a "commit" command. If there is a reported error,
I want be able to call a "rollback". I have searched the docs
and also looked at the code for win32::ODBC but cannot find this
option. Does anyone know how to do this or whether the DBI package
supports rollbacks?
many thanks
Bruce Sams
------------------------------
Date: 15 Dec 1997 09:32:17 -0800
From: Rainer Keuchel <r_keuchel@smaug.netwave.de>
Subject: Re: How to do a "rollback" with Win32::ODBC
Message-Id: <wk67oqfr6m.fsf@smaug.netwave.de>
*Transact($Type)
Forces the ODBC connection to perform a Rollback or Commit transaction.
$Type may be:
SQL_COMMIT
SQL_ROLLBACK
*** NOTE: This only works with ODBC Drivers that support transactions.
Your Driver supports it if TRUE is returned from:
$O->GetFunctions($O->SQL_API_SQLTRANSACT)[1]
(see GetFunctions for more details)
returns: TRUE....success.
FALSE...failure.
--
Rainer Keuchel
------------------------------
Date: Mon, 15 Dec 1997 08:58:16 +0100
From: Koos Pol <koos_pol@bigfoot.com>
Subject: How to install MD5 module ?
Message-Id: <3494E318.5010@bigfoot.com>
I have downloaded the MD5 module from CPAN. I followed the instructions:
extracted the archive in /perl/ext of the perl sources dir and ran 'perl
makefile.pl' + 'make'.
Now the MD5 still is in my source directory and not in the install dir,
so I still can't use it. Did I miss something?
--
Koos Pol
----------------------------------------------------------------------
S.C. Pol tel: +31 20 3116122
PC Systems Administrator email: Koos_Pol@bigfoot.com
Compuware Europe PGP public key available upon request
A little inaccuracy sometimes saves tons of explanation.
-- H. H. Munroe
------------------------------
Date: Mon, 15 Dec 1997 08:36:27 GMT
From: adelton@fi.muni.cz (Honza Pazdziora)
Subject: Re: How to install MD5 module ?
Message-Id: <adelton.882174987@aisa.fi.muni.cz>
Koos Pol <koos_pol@bigfoot.com> writes:
> I have downloaded the MD5 module from CPAN. I followed the instructions:
> extracted the archive in /perl/ext of the perl sources dir and ran 'perl
> makefile.pl' + 'make'.
> Now the MD5 still is in my source directory and not in the install dir,
> so I still can't use it. Did I miss something?
Yes. You need to continue the instalation process with
make test
make install
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: Mon, 15 Dec 1997 12:34:56 GMT
From: Jacqui Caren <Jacqui.Caren@ig.co.uk>
Subject: Re: Mirror PUT program
Message-Id: <EL8DM8.JJx@ig.co.uk>
In article <34831E30.6C2922C1@tssun7.dsccc.com>,
Bill Petersen <brp@dsccc.com> wrote:
>I have a mirror program written in perl which works great!
>But it does a pull (you tell it what site to mirror, and it
>does ftp gets to pull the data down).
>
>But what I need is a similar program that does a push (put).
>I want a 'master' site to control the distribution of the
>data. When something gets updated, an admin can 'push'
>the data out to the replica sites. I like the 'mirror' concept
>because I want to have files deleted from the replicas when they
>are removed from the master, etc.
If you are talking about mirror from src.doc.ic.ac.uk then
get_files=false should do what you require.
>The program must work using ftp so things like rdist or nfs won't work.
This does not make sense. s/so/because/ ?
>Does anyone have such a program?
mirror from src.doc.ic.ac.uk - it is rather old (perl4 based) and
the CPAN modules have surpassed it some time ago but it still works
for site uploads _ I use it so release software trees replicate
our various web sites from our internal systems to the disparate
web servers.
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: 15 Dec 1997 09:22:31 -0500
From: mike@stok.co.uk (Mike Stok)
Subject: Re: Newbie Help: Removing or ReDimensioning an Array
Message-Id: <673ef7$lu$1@stok.co.uk>
In article <MPG.efe795895e195f0989680@news.tp.net>,
Howard Hull <phantom@tp.net> wrote:
>Is there an easy way to completely destroy or at least remove all
>elements of an array. I've tried a couple of things but haven't gotten
>anything to work correctly.
If you are about to re-ues the array then
@array = ();
might do what you want. If you want to readicate all trace of the array
then
undef @array;
might be what you want.
If you have an array which is taking up a load of memory then emptying it
will not free the memory used by elements which aren't referenced
eleswhere *to the operating system*, the memory will still be used by
perl, but will be available for other perl variables.
The perlfunc manual page (or perldoc page) describes what undef does.
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: Mon, 15 Dec 1997 08:38:05 -0600
From: Lachlan Dunlop <lach@lach.net>
To: Howard Hull <phantom@tp.net>
Subject: Re: Newbie Help: Removing or ReDimensioning an Array
Message-Id: <349540CD.A4554FDC@lach.net>
Howard,
how about:
@array = ();
This will clear the array.
Later
Lach
Howard Hull wrote:
> Is there an easy way to completely destroy or at least remove all
> elements of an array. I've tried a couple of things but haven't gotten
> anything to work correctly.
>
> Any help would be great.
> Thanks.
------------------------------
Date: Mon, 15 Dec 1997 14:14:00 GMT
From: mick@picus.dcs.bbk.ac.uk (Mick Farmer)
Subject: Re: Newbie Help: Removing or ReDimensioning an Array
Message-Id: <EL8I7D.1s4@mail2.ccs.bbk.ac.uk>
Dear Howard,
The simplest way is to assign the empty array.
@array = ();
Regards,
Mick
------------------------------
Date: Mon, 15 Dec 1997 04:55:12 -0700
From: kenny@kacweb.com (Kenny A. Chaffin)
Subject: Re: Newbie question. Do you recommend moving from C?
Message-Id: <MPG.efec887874a4f479899eb@news.dimensional.com>
In article <349064EE.167EB0E7@pobox.com.unspam>,
opthalamion@pobox.com.unspam says...
> Jason Smith wrote:
> >
> > The transition to
> > Java 1.1 is under way, 1.2 is just around the corner, and 2.0 is slated for
> > sometime next year. During this time, it will be difficult to write once
> > and run anywhere at all
>
> As mentioned elsewhere, Sun now provides a plug-in for Netscape and
> Explorer which allow those browsers to run Java code correctly:
> http://java.sun.com/products/activator
>
> Anyone using java on a webpage should provide an "install Java"
> link, IMHO, and every managed network should be upgraded ASAP.
But the problem is that it is a plug-in. People just don't plug them in.
You can't count on it. This is exactly why Shockwave is going downhill,
with RealAudio to follow. The reason Java applets on the web are
increasing is because it's built in to the browser -- no plugins to
download, no special software. We need to keep it that way.
--
KAC
Website Design, Programming, Graphics --> http://www.kacweb.com
kenny@kacweb.com
------------------------------
Date: Mon, 15 Dec 1997 04:58:04 -0700
From: kenny@kacweb.com (Kenny A. Chaffin)
Subject: Re: Newbie question. Do you recommend moving from C?
Message-Id: <MPG.efec933d27659359899ec@news.dimensional.com>
In article <349064EE.167EB0E7@pobox.com.unspam>,
opthalamion@pobox.com.unspam says...
> Jason Smith wrote:
> >
> > The transition to
> > Java 1.1 is under way, 1.2 is just around the corner, and 2.0 is slated for
> > sometime next year. During this time, it will be difficult to write once
> > and run anywhere at all
>
> As mentioned elsewhere, Sun now provides a plug-in for Netscape and
> Explorer which allow those browsers to run Java code correctly:
> http://java.sun.com/products/activator
>
> Anyone using java on a webpage should provide an "install Java"
> link, IMHO, and every managed network should be upgraded ASAP.
>
> Here are the major points, quoting Sun PR:
>
> 1) Java Activator delivers full JDK 1.1 support and JCK compliance to
> Internet Explorer 3.02 or later and Netwcape Navigator 3.0 or later on
> Microsoft's desktop operationg systems.
>
> 2) Java Activator ensures that enterprises that desire the "write once,
> run anywhere" benefits of teh Java platform are realized on Win32
> systems
> on the most widely used Web browsers.
>
> 3) Java Activator is ready for JFC, the next JDK and HotSpot with a
> future-ready architecture that allows Sun to bring new features and
> functionality to IE and Navigator on Win32 as soon as they become
> availalbe from Sun.
>
> 4) Java Activator offers easy, low cost Web-based distribution of
> the latest Java Platform release direct to Windows users' desktops.
>
And besides that it's limited to Win95 and NT -- jeeze we need it on win
3.1 if anywhere.
--
KAC
Website Design, Programming, Graphics --> http://www.kacweb.com
kenny@kacweb.com
------------------------------
Date: Sun, 14 Dec 1997 23:51:28 -0700
From: mbudash@sonic.net (Michael Budash)
Subject: Re: pgp encrypion via perl script
Message-Id: <mbudash-1412972351290001@d56.pm.sonic.net>
In article <34946f46.0@news.one.net>, nospam@minivend.com wrote:
>> > - can the $unencrypted_data show in a "ps" if the "ps"er was lucky
>> > enought to execute the "ps" in the partial-second it could even _be_
>> > available
>>
>> Yes -- details are OS-dependent.
>>
All right: OS = SGI Irix (not sure whether it's v5.x or v6.x - does it matter?)
So...?
michael
--
_____________________________
Michael Budash, Owner
Michael Budash Consulting
707-255-5371
707-258-7800 x7736
http://www.sonic.net/~mbudash
mbudash@sonic.net
_____________________________
------------------------------
Date: 15 Dec 1997 00:18:51 -0800
From: Russ Allbery <rra@stanford.edu>
Subject: Re: pgp encrypion via perl script
Message-Id: <m3zpm3uihg.fsf@windlord.Stanford.EDU>
nospam <nospam@minivend.com> writes:
> brian d foy <comdog@computerdog.com> wrote:
>> * IPC::Open3 is portable
> No, it is not. That (AFAIK) is UNIX only, which is why I wouldn't
> consider it portable.
What's not portable about IPC::Open3? As near as I can tell, it will work
on any system that has fork() and pipe(), which includes quite a few
non-Unix systems. fork() tends to be a lot *slower* on non-Unix systems,
since Unix has a lightweight process model and strongly optimized fork(),
but that doesn't mean it won't work.
--
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print
------------------------------
Date: 15 Dec 1997 00:22:46 -0800
From: Russ Allbery <rra@stanford.edu>
Subject: Re: pgp encrypion via perl script
Message-Id: <m3wwh7uiax.fsf@windlord.Stanford.EDU>
nospam <nospam@minivend.com> writes:
> Michael Budash <mbudash@sonic.net> wrote:
>> - can the $unencrypted_data show in a "ps" if the "ps"er was lucky
>> enought to execute the "ps" in the partial-second it could even _be_
>> available
> Yes -- details are OS-dependent.
Huh?
Correct me if I'm wrong, but it seems like he uses echo to pass the
encrypted data into PGP and then reads the unencrypted data off a pipe
from PGP. Under that system, there's no way for the unencrypted data to
show up in the output of ps.
ps cannot see the contents of pipes.
That being said, the right way to do this is IPC::Open3, and it really
isn't that hard. The only real trick is that you have to be careful about
blocking.
(I should note, however, that after having gone through all of this while
writing my PGP::Sign module, I ended up going back to using a temporary
file. Not because of any of the issues surrounding IPC, but rather
because PGP 2.6.2 has one of the worst handlings of piped data that I've
ever seen. It doesn't appear to be capable of generating detached
signatures correctly when used as a filter, and it does all sorts of
strange munging to your data if you try to work around it.)
--
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print
------------------------------
Date: 15 Dec 97 09:33:57 GMT
From: nospam@minivend.com
Subject: Re: pgp encrypion via perl script
Message-Id: <3494f985.0@news.one.net>
Russ Allbery <rra@stanford.edu> wrote:
> nospam <nospam@minivend.com> writes:
>> Michael Budash <mbudash@sonic.net> wrote:
>>> - can the $unencrypted_data show in a "ps" if the "ps"er was lucky
>>> enought to execute the "ps" in the partial-second it could even _be_
>>> available
>> Yes -- details are OS-dependent.
> Huh?
> Correct me if I'm wrong, but it seems like he uses echo to pass the
> encrypted data into PGP and then reads the unencrypted data off a pipe
> from PGP. Under that system, there's no way for the unencrypted data to
> show up in the output of ps.
Then maybe I am confused. When I saw
echo $unencrypted_data | pgpe -at -r
that indicated to me that it was unencrypted stuff going to encrypt. In
fact, that is what it would have to be, since pgpe is the encryption
and not description.
> ps cannot see the contents of pipes.
Err.. but it can see the contents of an argument, which is what we are
talking about here, I think. Maybe I missed a message in the thread,
though.
> That being said, the right way to do this is IPC::Open3, and it really
> isn't that hard. The only real trick is that you have to be careful about
> blocking.
I would agree, but I don't think storing encrypted data on the disk is
that insecure. It is certainly easier and more reliable.
> (I should note, however, that after having gone through all of this while
> writing my PGP::Sign module, I ended up going back to using a temporary
> file. Not because of any of the issues surrounding IPC, but rather
> because PGP 2.6.2 has one of the worst handlings of piped data that I've
> ever seen. It doesn't appear to be capable of generating detached
> signatures correctly when used as a filter, and it does all sorts of
> strange munging to your data if you try to work around it.)
I also have a fair amount of experience working with PGP, and
would have to agree with you. You wouldn't happen to know what
makes it ask for a new random seed after weeks or months of working
fine from program calls, would you? I still haven't figured it out,
and I have been calling a "touch" on the randseed.bin file on
a nightly basis to prevent errors.
All in all, I really don't understand the prejudice against temp files
when doing a high latency, processor-intensive operation like PGP. The disk
overhead has got to be the least of worries here.
Regards,
Mike Heins
------------------------------
Date: 15 Dec 1997 02:14:14 -0800
From: Russ Allbery <rra@stanford.edu>
Subject: Re: pgp encrypion via perl script
Message-Id: <m3u3caud55.fsf@windlord.Stanford.EDU>
nospam <nospam@minivend.com> writes:
> Then maybe I am confused. When I saw
> echo $unencrypted_data | pgpe -at -r
> that indicated to me that it was unencrypted stuff going to encrypt. In
> fact, that is what it would have to be, since pgpe is the encryption and
> not description.
Oh, okay. Yeah, that shows up in ps (with the right flags) on pretty much
any Unix. (And on top of that is horribly fragile given special
characters in the unencrypted data.)
> I would agree, but I don't think storing encrypted data on the disk is
> that insecure. It is certainly easier and more reliable.
Right. You just have to be careful about how you create your temporary
file. umask 077 before creating it and make sure to use O_EXCL | O_CREAT
in the open call.
> I also have a fair amount of experience working with PGP, and would have
> to agree with you.
So many people get this stuff wrong that we really need a generic PGP
module; the one that's currently on CPAN just doesn't quite cut it. (For
one thing, I believe it puts the passphrase in the environment.)
> You wouldn't happen to know what makes it ask for a new random seed
> after weeks or months of working fine from program calls, would you? I
> still haven't figured it out, and I have been calling a "touch" on the
> randseed.bin file on a nightly basis to prevent errors.
Nope. No clue. I'd have to delve into the source for PGP again (which
was the only way that I was able to figure out that PGP by default strips
trailing spaces under some circumstances when generating and verifying
signatures).
> All in all, I really don't understand the prejudice against temp files
> when doing a high latency, processor-intensive operation like PGP. The
> disk overhead has got to be the least of worries here.
Agreed.
--
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print
------------------------------
Date: Mon, 15 Dec 1997 14:08:46 GMT
From: mick@picus.dcs.bbk.ac.uk (Mick Farmer)
Subject: Re: semget
Message-Id: <EL8HyM.1I6@mail2.ccs.bbk.ac.uk>
Dear Guna,
Here's a couple of programs that I use to demonstrate
semaphore usage. First, create a semaphore (semget.pl).
$IPC_PRIVATE = 0;
$IPC_NUMBER = 1;
$SEM_FLAGS = 0600;
$SEM_SETVAL = 1;
$id = semget $IPC_PRIVATE, $IPC_NUMBER, $SEM_FLAGS
or die "Can't semget ($!)\n";
$semop = pack 'sss', 0, $SEM_SETVAL, 0;
semop $id, $semop
or die "Can't semop ($!)\n";
print "Use $id to access this semaphore\n";
Second, a simple script that sleeps in a critical section
that you can alter (semop.pl).
$SEM_DECREMENT = -1;
$SEM_INCREMENT = 1;
$id = shift
or die "Missing semaphore id\n";
$delay = shift
or die "Missing delay\n";
$semop = pack 'sss', 0, $SEM_DECREMENT, 0;
semop $id, $semop
or die "Can't get semaphore ($!)\n";
print "Process $$ in critical section\n";
sleep $delay;
$semop = pack 'sss', 0, $SEM_INCREMENT, 0;
semop $id, $semop
or die "Can't put semaphore ($!)\n";
Regards,
Mick
------------------------------
Date: Mon, 15 Dec 1997 14:29:25 +0100
From: Yann <ycueff@club-internet.fr>
Subject: Sorting an array in PERL 4
Message-Id: <349530B5.28CF@club-internet.fr>
Hi,
I use PERL 4 and I don't know how to sort the following arry by the 2nd
field. Could someone help me
bcv69w54:sun4:4.1.3_U1:sun4c:SUN0424:AGL
bcv69w53:solaris:5.4:sun4m:SUN2.1G:AGL
bcv69w22:solaris:5.5.1:sun4m:SUN1.05:AGL
bcv68w73:solaris:5.4:sun4m:SUN0535:AGL
bcv68w72:solaris:5.4:sun4m:SUN0535:AGL
bcv68w71:solaris:5.4:sun4m:SUN0535:AGL
bcv67w92:sun4:4.1.3_U1:sun4m:SUN1.05:AGL
bcv67w91:solaris:5.5.1:sun4m:SUN1.05:AGL
bcv67w90:solaris:5.5.1:sun4m:SUN1.05:AGL
bcv66w61:solaris:5.5.1:sun4m:SUN2.1G:AGL
bcv64w70:sun4:4.1.3_U1:sun4c:SUN1.05:AGL
bcv64w6c:sun4:4.1.3_U1:sun4m:SUN2.1G:AGL
bcv64w3b:sun4:4.1.3_U1:sun4c:SUN1.05:AGL
bcv64w11:sun4:4.1.3_U1:sun4m:SUN2.1G:AGL
bcv02w80:sun4:4.1.3_U1:sun4m:SUN0535:AGL
bcv02w15:sun4:4.1.3_U1:sun4c:SUN1.05:AGL
Thanks,
Yann
Please, reply me to the following e-mail adresse:
yann.cueff@vz.cit.alcatel.fr
------------------------------
Date: Mon, 15 Dec 1997 14:57:07 +0100
From: David Martin <david.martin@biotek.uio.no>
To: Yann <ycueff@club-internet.fr>
Subject: Re: Sorting an array in PERL 4
Message-Id: <34953733.286A0DC@biotek.uio.no>
Yann wrote:
> bcv02w80:sun4:4.1.3_U1:sun4m:SUN0535:AGL
> bcv02w15:sun4:4.1.3_U1:sun4c:SUN1.05:AGL
#open the file
open INFILE, "input file name here" or die "argghhhh!! error opening
input file : $!";
#slurp your data into an array.
@list = <INFILE>;
#then sort using
@sorted_list = sort &secondfield @list;
sub secondfield {
my @a = split /:/, $a;
my @b = split /:/, $b;
return $a[1] cmp $b[1];
}
#[or return $b[1] cmp $a[1] for a reverse sort]
..d
--
* David Martin - Atherosclerosis and Thrombosis research group *
* http://www.uio.no/~damartin/ david.martin@biotek.uio.no *
* Lab +47 22 95 84 54 Fax +47 22 69 41 30 GSM +47 90 74 27 65 *
------------------------------
Date: Mon, 15 Dec 1997 09:24:45 +0100
From: Harald Joerg <Harald.Joerg@mch.sni.de>
To: Brian Lavender <brian@brie.com>
Subject: Re: terminate input on CGI.pm in Win95 Gurusamy Sarathy port
Message-Id: <3494E94D.436B@mch.sni.de>
[posted and mailed]
> When testing the cgi module on win 95 using the Gurusamy Sarathy port
> how do you terminate data input in offline mode. In UNIX I use Ctrl-D
> and enter on a single line. It does not work on win95. The mode I am
> talking about is:
>
> (offline mode: enter name=value pairs on standard input)
> How do I indicate end of input?
Ctrl-Z.
--
Oook,
--haj--
------------------------------
Date: 15 Dec 1997 00:32:20 -0800
From: Russ Allbery <rra@stanford.edu>
Subject: Re: When is FLOCK not supported?
Message-Id: <m3u3cbuhuz.fsf@windlord.Stanford.EDU>
Vik Rubenfeld <VikR@aol.com> writes:
> My client's machine doesn't support FLOCK. (Error message "# The flock()
> function is unimplemented.") Does this just mean that he's got some old
> PERL installation and needs to upgrade it?
We really need more information to answer this question, as there are a
number of different possible reasons. He could have an old Perl build, he
could have a poorly-configured Perl, or he could be using an operating
system that doesn't support flock().
I suppose the first question is what operating system he's using.
--
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print
------------------------------
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 1475
**************************************