[10012] in Perl-Users-Digest
Perl-Users Digest, Issue: 3605 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Sep 1 12:04:52 1998
Date: Tue, 1 Sep 98 09:00:23 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Tue, 1 Sep 1998 Volume: 8 Number: 3605
Today's topics:
Re: Better Regular Expressions (was: Re: Imagine... a n <jdporter@min.net>
Re: COBOL and Perl (Shaun C. Murray)
Re: COBOL and Perl (Maurice Aubrey)
connecting filehandle to several files <dan@fearsome.net>
Re: connecting filehandle to several files (Sean McAfee)
Re: Currency Formatting in Perl (s//) (S. Kuip)
Re: FMTEYEWTK on Switch Statements in Perl (was: No swi <tchrist@mox.perl.com>
Re: Hats off to Tom Phoenix <murrayb@vansel.alcatel.com>
Help create a fileupload script <recruitmentdb@enterprise.net>
Re: Help on running perl scripts on MS-DOS (Win NT4 act <fafefito@uscmail.usc.es>
Help to extract variables <mferg@hal.ddntl.didata.co.za>
Re: Help to extract variables <Tony.Curtis+usenet@vcpc.univie.ac.at>
How do I send a fax from a perl cgi script? (Harry Tennant)
Re: How to extract first letter in string? (Albert W. Dorrington)
Re: Imagine... a non-greedy world! <jdf@pobox.com>
Pattern Matching <se96ms@english.iielr.dmu.ac.uk>
Re: Pattern Matching (Honza Pazdziora)
Re: Perl compiler (Nathan V. Patwardhan)
Re: Perl compiler (Albert W. Dorrington)
Re: Perl Cookbook, does anyone have it? <jdporter@min.net>
Re: Perl Module for URL hiding (Michael J Gebis)
Re: perl program for inews <rra@stanford.edu>
Re: perl regex bug? (or feature?) (Peter J. Kernan)
PLEASE HELP ME !!!!! <ng@usa.net>
problem - PLEASE HELP <ng@usa.net>
Re: problem - PLEASE HELP (Maurice Aubrey)
Source in multiple files [Newbie] <raj.subramani@citicorp.com>
Substract Time. (Carles A. Vallve)
Re: Substract Time. (Maurice Aubrey)
Re: sybperl Y2K compliant? (Michael J Gebis)
Tom Phoenix: ANSWERS WANTED! (Nathan V. Patwardhan)
Re: Tom Phoenix: ANSWERS WANTED! <eashton@bbnplanet.com>
URGENT: How do I post to a newsgroup from a perl routin (Mick Knutson)
Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 31 Aug 1998 10:46:57 -0400
From: John Porter <jdporter@min.net>
Subject: Re: Better Regular Expressions (was: Re: Imagine... a non-greedy world!)
Message-Id: <35EAB761.3FDFFFDA@min.net>
Uri Guttman wrote:
>
> it makes us appreciate the lesser twits who fill this group with noise.
> they are perl gurus compared with you.
Good point, Uri!
Mee has done more -- unwittingly -- to make us appreciate with
patience our faqqing novice perlers than all the ranting from
Burnore-types could ever hope.
John Porter
------------------------------
Date: 1 Sep 1998 13:04:20 GMT
From: scm@enterprise.net (Shaun C. Murray)
Subject: Re: COBOL and Perl
Message-Id: <6sgrck$g4j$2@news.enterprise.net>
In article <35E5CC6B.1467@min.net>, jdporter@min.net says...
>I get the impression that "less lines" is not the proper COBOL
>esthetic -- whereas it sorta is in Perl culture.
;-) Yeah Sorry folks.
>
>What follows is a complete perl program.
>On unix, you might put it in a file named (e.g.) "untab", and
>execute it by "perl untab < infile > outfile" (no quotes, of course).
>
># let's just say the desired field widths are known to be these:
>@field_widths = qw( 8 12 15 20 10 );
># read from stdin or the named files; write to stdout.
>while(<>){
> printf "@{[map{'%'.$_.'s'}@field_widths]}", split /\t/;
>}
Looks mostly like line noise to me which is my biggest complaint with trendy
languages. Excess punctuation too.
--
Shaun
scm@enterprise.net PGP Key available
------------------------------
Date: Tue, 01 Sep 1998 15:11:19 GMT
From: maurice@hevanet.com (Maurice Aubrey)
Subject: Re: COBOL and Perl
Message-Id: <slrn6uo3kp.7j5.maurice@we-24-130-48-83.we.mediaone.net>
On 1 Sep 1998 13:04:20 GMT, Shaun C. Murray <scm@enterprise.net> wrote:
>In article <35E5CC6B.1467@min.net>, jdporter@min.net says...
>>
>>What follows is a complete perl program.
>>On unix, you might put it in a file named (e.g.) "untab", and
>>execute it by "perl untab < infile > outfile" (no quotes, of course).
>>
>># let's just say the desired field widths are known to be these:
>>@field_widths = qw( 8 12 15 20 10 );
>># read from stdin or the named files; write to stdout.
>>while(<>){
>> printf "@{[map{'%'.$_.'s'}@field_widths]}", split /\t/;
>>}
>
>Looks mostly like line noise to me which is my biggest complaint with trendy
>languages. Excess punctuation too.
But his explicit goal was to minimize lines, based on your
previous challenge:
>Post your perl code and I'm sure the group can do it in less lines in COBOL.
>Then give it to your PCS and tell him to take a refresher course.
Most Perl programmers would not write code like that for production use,
since it is difficult to understand.
#!/usr/bin/perl -Tw
@field_widths = qw( 8 12 15 20 10 );
use strict;
use vars qw( @field_widths );
while(defined(my $line = <STDIN>)) {
chomp($line);
my @fields = split(/\t/, $line);
my @formats = map { '%.' . $_ . 's' } @field_widths;
my $format = join(' ', @formats);
printf("$format\n", @fields);
}
That's basically the same program, but may be easier to follow.
Some of us trendy folks like the excess punctuation so that
it's simple to differentiate data types.
--
Maurice Aubrey <maurice@hevanet.com>
Increasingly, people seem to misinterpret complexity as
sophistication, which is baffling - the incomprehensible should
cause suspicion rather than admiration.
- Niklaus Wirth
------------------------------
Date: Tue, 1 Sep 1998 13:00:42 +0100
From: "Daniel Adams" <dan@fearsome.net>
Subject: connecting filehandle to several files
Message-Id: <904653476.8497.0.nnrp-07.c2deb1c5@news.demon.co.uk>
[Resend. Message didn't appear first time. Apologies if you have already
read this]
Hi,
I need (or at least it would make life easier for me) to connect a single
filehandle to several files. perlfaq4 states that this is possible with the
tee program as below:
open (FH, "| tee file1 file2 file3");
However, I'm not sure about the exact syntax used and there doesn't seem to
be a link to further information anywhere, and I couldn't find information
anywhere on the web. For instance, would the following be correct syntax??
open (DAT, "| tee >>$foo >$bar +>$foobar"); # for example
where $foo, $bar, and $foobar are three variables describing file
locations?? Presumably if this failed, there would be no way of
distinguishing in the "die" exactly what went wrong??
Could anyone point me to a web resource on this, or answer the questions
above?
Thanks,
--
Dan Adams
dan@fearsome.net
http://fearsome.net
------------------------------
Date: Tue, 01 Sep 1998 14:34:11 GMT
From: mcafee@moonpatrol.rs.itd.umich.edu (Sean McAfee)
Subject: Re: connecting filehandle to several files
Message-Id: <DBTG1.444$F7.2096368@news.itd.umich.edu>
In article <904653476.8497.0.nnrp-07.c2deb1c5@news.demon.co.uk>,
Daniel Adams <dan@fearsome.net> wrote:
>I need (or at least it would make life easier for me) to connect a single
>filehandle to several files. perlfaq4 states that this is possible with the
>tee program as below:
>open (FH, "| tee file1 file2 file3");
>However, I'm not sure about the exact syntax used and there doesn't seem to
>be a link to further information anywhere, and I couldn't find information
>anywhere on the web.
If you're on a Unix system, "man tee" will give you information about the
tee command. The syntax given in your example is correct, although if you
didn't want anything to appear on your terminal, you should use:
open(FH, "| tee file1 file2 > file3") || die "Pipe failed: $!\n";
(You should use "|| die" on ALL opens.)
>For instance, would the following be correct syntax??
>open (DAT, "| tee >>$foo >$bar +>$foobar"); # for example
>where $foo, $bar, and $foobar are three variables describing file
>locations??
No, that won't do what you want, if the shell even accepts it.
Alternately, here's a 100% Perl solution:
----------------------------------------------------------------------
package multiwrite;
use IO::File;
sub TIEHANDLE {
my $pkg = shift;
bless [ map { new IO::File $_, "w" or die "$_ failed: $!\n" } @_ ], $pkg;
}
sub PRINT {
my $self = shift;
foreach my $handle (@$self) {
print $handle @_;
}
}
1;
----------------------------------------------------------------------
You would save this in a file called (say) "multiwrite.pm", then in your
main Perl program, do this:
use multiwrite;
tie *MULTI, 'multiwrite', qw(foo bar baz);
print MULTI "Bite me, it's fun";
# this will go to files "foo", "bar", and "baz",
# assuming that all of the opens succeeded
--
Sean McAfee | GS d->-- s+++: a26 C++ US+++$ P+++ L++ E- W+ N++ |
| K w--- O? M V-- PS+ PE Y+ PGP?>++ t+() 5++ X+ R+ | mcafee@
| tv+ b++ DI++ D+ G e++>++++ h- r y+>++** | umich.edu
------------------------------
Date: 1 Sep 1998 13:06:53 GMT
From: kuip@dds.nl (S. Kuip)
Subject: Re: Currency Formatting in Perl (s//)
Message-Id: <slrn6unsbd.dhn.stefan@dec.procura.nl>
On 31 Aug 1998 23:59:17 GMT, Internet Guy <ar@webcanada.com> wrote:
>Can anyone tell me how I can create an expression to format currency values
>in Perl?
>
>I imagine it's something complicated involving s// but I can't get the
>parameters right.
>
>I would input a number such as 200000 and would want 200,000 as the result
>
1 while $amount =~ s/(.*\d)(\d\d\d)/$1,$2/;
1204846335 => 1,204,846,335
>Replies by e-mail (ar@webcanada.com) are appreciated.
>
>Thanks.
--
Stefan
>
------------------------------
Date: 1 Sep 1998 14:12:52 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: FMTEYEWTK on Switch Statements in Perl (was: No switch statement in Perl??)
Message-Id: <6sgvd4$hv4$1@csnews.cs.colorado.edu>
And then of course we have the possibility of writing a
switch() function that could be used like this:
switch $value =>
23 => sub { ... },
"fred" => sub { ... },
[1..10] => sub { ... },
qr/^fo/i => sub { ... },
'DEFAULT' => sub { ... };
But for that qr// there, it could all hash up. Hm....
switch $value => {
23 => sub { ... },
"fred" => sub { ... },
[1..10] => sub { ... },
'DEFAULT' => sub { ... },
};
Darn. That last one isn't a tied refhash in time to
handle ref keys.
But ordered is ok:
switch $value => [
23 => sub { ... },
"fred" => sub { ... },
[1..10] => sub { ... },
qr/^fo/i => sub { ... },
'DEFAULT' => sub { ... },
];
--tom
--
"PC's are backwards ... throw them out! Linux is ok though."
--Rob Pike (on the subject of CR/LF etc)
------------------------------
Date: 01 Sep 1998 07:40:48 -0700
From: Brad Murray <murrayb@vansel.alcatel.com>
Subject: Re: Hats off to Tom Phoenix
Message-Id: <uiuj77v67.fsf@vansel.alcatel.com>
Elaine -HappyFunBall- Ashton <eashton@bbnplanet.com> writes:
> > And what is wrong with misanthropy ?
>
> there is too much of it. philanthropy takes a lot less effort and youll
> live longer due to less stress in your life. give generously to your
> local library and give your wife and suprise bouquet of flowers. much
> more fun than useless usenet flameage.
This turns out to not quite be true. If, for example, you were to
philanthropically write a lot of great documentation on a hypothetical
amazing language that was used by a great number of people, you would
almost certainly experience a great deal of stress when repeatedly asked
questions that are answered in your freely available and widely distributed
philanthropic effort. Further, you would probably get a lot of complaints
regarding the quality of said documents, even though they were provided
only through the goodness of your heart. Thus, philanthropy can cause
a great deal of stress, resulting in occasional (and ultimately chronic)
misanthropic episodes.
Hypothetically.
--
Brad Murray "Be very, very careful what you put into that
Alcatel Canada head, because you will never, ever get it out."
Software Analyst (Cardinal Wolsey)
------------------------------
Date: Tue, 01 Sep 1998 14:42:49 -0700
From: The Recruitment Database <recruitmentdb@enterprise.net>
Subject: Help create a fileupload script
Message-Id: <35EC6A59.B3F@enterprise.net>
Can someone help me create a cgi script (solution), I am not a programmer
but understand web site HTML
I am trying to create a situation on my web site (I run a small
recruitment site) where a candidate (job-seeker) would be able to
enter a few details on a form, maybee also select some key skills and
then add their CV (resume) as an attachment (upload a file). We would
also like them to be able to download some information from the form
page.
Any help would be appreciated
Best Derek Alexander
recruitmentdb@enterprise.net
------------------------------
Date: Tue, 1 Sep 1998 15:54:17 +0200
From: David Suarez de Lis <fafefito@uscmail.usc.es>
Subject: Re: Help on running perl scripts on MS-DOS (Win NT4 actually)
Message-Id: <Pine.GSO.3.96.980901154240.10907A-100000@uscmail.usc.es>
Hi there...
On Tue, 1 Sep 1998, Eric Dew wrote:
: Hello folks,
:
: I've written a perl script for UNIX and need to port it to MS-DOS/Win NT4.0.
: I've got perl up and running on the NT machine, but I don't know how exactly
: to get my script to work (as well as some file system questions).
:
: On UNIX, the script is run as such:
: % perlscript -d <date> -r <name>
:
: Will I be able to do that straight away on NT, or do I have to say:
: C:\perl5>perl perlscript -d <date> -r <name>
: (do I have to rename the script to have a proper suffix, like perlscript.pl?)
well, on NT4 Workstation, using Perl 5.004_02, you don't have to:
> perl perlscript blah blah should work perfectly.
: I understand that I have to run the perl script as a batch file and so I
: included the following lines to the top of the file:
I don't understand why, running it from the command line works as a dream
(although cmd.exe, being much better than command.com, is pretty poor as
compared to Unix shells like bash...)
: Next, I plan to run the perl script on drive D:\, but want it to do
: things to files on drive F:\ (say).
:
: So, how to do I tell it to change drives to F:\ ? I'm putting in the
: line,
: `F:\`;
: wherever I need to change to drive F.
Tried that and got an error... maybe the best thing is
$PATH=qq(f:\\path\\to\\the\\files);
and then attaching $PATH to all operations there...
system "copy $PATH\\foo.txt $PATH\\texts\\foo.txt";
: or do I have to use "\\" in place of "\", as in:
If you use '' (not ``) qhich is equivalent to q(), then it doesn't matter, the
string get's passed without parsing (although it may give errors on later
commands), while "" allow expansion inside the string, so $PATH is expanded
("" equal qq(), see perldoc perlop)
I only get errors if I use ``, but who knows? I never needed to use them
yet...
: Of course, I could find out whether one back-slash or two back-slashes will
: work, once I can get the script to run, which goes back to the first set
: of questions.
I will suggest you suffer with cmd capabilities using perl -we "script goes
here " and try some silly examples to get the feeling of the environment...
then go to Cygnus CygWin32 and install bash for Win32 :)
Greetings,
David@
------------------------------
Date: Tue, 01 Sep 1998 16:35:54 -0200
From: Mark Fergusson <mferg@hal.ddntl.didata.co.za>
Subject: Help to extract variables
Message-Id: <35EC3E89.6ADA64C2@hal.ddntl.didata.co.za>
Hi.
I'm runing a perl program with a number of arguments. I need to set
variables based on these arguments. It looks something like this:
program value1=Value1 value2=hello this is a test value3=next test
value4=Value4
What I need out of this is:
$value1="Value1";
$value2="hello this is a test";
$value3="next test";
$value4="Value4";
How Can I do this. I've tried using a for loop and split, but I only get
for example
$value2="hello";
Any help would be most appreciated.
Thanks.
--
_____________________________________________
Mark Fergusson: mferg@hal.ddntl.didata.co.za
Dimension Data:
PO Box 236, Pavillion, 3611, South Africa
(+27)-31-204-8424 (Work)
(+27)-31-204-8590 (Fax)
082-771-8519 (Cell)
------------------------------
Date: 01 Sep 1998 16:53:32 +0200
From: Tony Curtis <Tony.Curtis+usenet@vcpc.univie.ac.at>
Subject: Re: Help to extract variables
Message-Id: <7x4surc2ab.fsf@salome.vcpc.univie.ac.at>
Re: Help to extract variables, Mark
<mferg@hal.ddntl.didata.co.za> said:
Mark> Hi. I'm runing a perl program with a number of
Mark> arguments. I need to set variables based on these
Mark> arguments. It looks something like this:
Mark> program value1=Value1 value2=hello this is a test
Mark> value3=next test value4=Value4
Mark> What I need out of this is: $value1="Value1";
Mark> $value2="hello this is a test"; $value3="next test";
Mark> $value4="Value4";
Mark> How Can I do this. I've tried using a for loop and
Mark> split, but I only get for example $value2="hello";
It would help to show the code involved.
You could try something along the lines of (untested):
my %args;
foreach my $a (@ARGV) {
if ($a =~ /=/) {
my ($key, $val) = split /=/, $a;
$args{$key} = $val;
}
}
and then you can refer to all the x=y parameters through the
%args hash. Of course you'll have to extend this to handle
the unquoted parameters which have to be appended onto the
current key's value.
I wouldn't drag the left-hand-side directly into a variable
(presumably via eval?) because you have no control over the
parameters, which could lead to people messing with perl's
special variables and other nastinesses.
hth
tony
--
Tony Curtis, Systems Manager, VCPC, | Tel +43 1 310 93 96 - 12; Fax - 13
Liechtensteinstrasse 22, A-1090 Wien, | <URI:http://www.vcpc.univie.ac.at/>
"You see? You see? Your stupid minds! | private email:
Stupid! Stupid!" ~ Eros, Plan9 fOS.| <URI:mailto:tony_curtis32@hotmail.com>
------------------------------
Date: 1 Sep 1998 14:14:45 GMT
From: harry@htennant.com (Harry Tennant)
Subject: How do I send a fax from a perl cgi script?
Message-Id: <6sgvgl$p99$1@newshost.cyberramp.net>
I have a need to receive the contents of an HTML form into a perl script, then
fax it. Right now I only need to send text but if you know of a more general
solution, I'd appreciate hearing about it.
Assume the server is NT with a fax modem installed.
Is there a module or some script somewhere that does this?
If not, what would I use to create the bit stream to send to the modem?
Thanks.
Harry
------------------------------
Date: 1 Sep 1998 09:37:29 -0500
From: awdorrin@mail.delcoelect.com (Albert W. Dorrington)
Subject: Re: How to extract first letter in string?
Message-Id: <6sh0r9$ija@ws051eng.ictest.delcoelect.com>
In article <6sejas$l4i$1@nnrp1.dejanews.com>, tech_support9@geocities.com writes:
:> To expand on this a bit, what if I wanted to search out a keyword, within a
:> string, or text file, and change that keyword to something else, like make it
:> BOLD faced before displaying it to the page?
:>
:> How would you write this? Use split?
:>
Sed could probably do this faster than perl, but something
like:
$keyword = blah;
$cap_keyword = uc $keyword; # UPPER CASE keyword
$string =~ s/$keyword/$cap_keyword/g;
would be fairly simple.
- Al
--
Al Dorrington
FIRMS & Web Admin, Oracle DBA Phone: 765-451-9655
IC-DELCO CIM, Delphi Delco Electronics Systems Fax: 765-451-8230
------------------------------
Date: 01 Sep 1998 09:37:13 -0400
From: Jonathan Feinberg <jdf@pobox.com>
To: Mee <mee@mine.com>
Subject: Re: Imagine... a non-greedy world!
Message-Id: <m3pvdgkl86.fsf@joshua.panix.com>
Mee <mee@mine.com> writes:
> You think you made a serious typo in your first post?
> I am sure that that's only natural to Perl
> because Perl itself is just one big typo.
Ah. A troll. *plonk*
--
Jonathan Feinberg jdf@pobox.com Sunny Brooklyn, NY
http://pobox.com/~jdf
------------------------------
Date: Tue, 1 Sep 1998 14:24:38 +0100
From: Mark Simonetti <se96ms@english.iielr.dmu.ac.uk>
Subject: Pattern Matching
Message-Id: <Pine.OSF.3.96.980901142005.3594F-100000@english.iielr.dmu.ac.uk>
Suppose I have an expression such as:
HOST =~ "HOST" and HIT =~ "HIT"
Thats just an example.. the expression could be quiet complex..
Now, How would I pattern match the HOST and HIT without the quotes.. I
can't just do:
=~ /HOST/
Because that'll get the ones with quotes too..
Basically I want to substitute the barewords HOST and HIT for something
else while leaving the ones in quotes in tact.
On another note.. I did something really annoying.. I wrote a load of
parsing, expression tree, and other such classes to evalute expressions
from a configuration file for a program I'm writing..then I realise Perl
can do it for me with "eval" ! (hence the above question).
Mark.
--
o----------------------------------------------o
| Mark Simonetti | Innovation Centre |
| Software Engineer | De Montfort University |
| Musician | Leicester. |
|----------------------------------------------|
| Email : se96ms@dmu.ac.uk |
| WWW : http://www.cms.dmu.ac.uk/~se96ms/ |
o----------------------------------------------o
------------------------------
Date: Tue, 1 Sep 1998 14:38:07 GMT
From: adelton@fi.muni.cz (Honza Pazdziora)
Subject: Re: Pattern Matching
Message-Id: <slrn6uo1me.m21.adelton@aisa.fi.muni.cz>
On Tue, 1 Sep 1998 14:24:38 +0100, Mark Simonetti <se96ms@english.iielr.dmu.ac.uk> wrote:
> Suppose I have an expression such as:
>
> HOST =~ "HOST" and HIT =~ "HIT"
>
> Thats just an example.. the expression could be quiet complex..
It's a bad example. What's HOST? Without quotes. What is is supposed
to do?
> Now, How would I pattern match the HOST and HIT without the quotes.. I
> can't just do:
>
> =~ /HOST/
>
> Because that'll get the ones with quotes too..
Don't understand. Who are ones with and without qutoes? Please try to
express in more technical language.
Or do you need to match text in $_? Then just leave the =~ at all.
--
------------------------------------------------------------------------
Honza Pazdziora | adelton@fi.muni.cz | http://www.fi.muni.cz/~adelton/
I can take or leave it if I please
------------------------------------------------------------------------
------------------------------
Date: Tue, 01 Sep 1998 13:58:31 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: Perl compiler
Message-Id: <b4TG1.23$kE2.203894@news.shore.net>
Albert W. Dorrington (awdorrin@mail.delcoelect.com) wrote:
: Or ar you just trying to stir things up?
Have you read this thread in its entirety?
------------------------------
Date: 1 Sep 1998 09:59:30 -0500
From: awdorrin@mail.delcoelect.com (Albert W. Dorrington)
To: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: Perl compiler
Message-Id: <6sh24i$ijh@ws051eng.ictest.delcoelect.com>
In article <b4TG1.23$kE2.203894@news.shore.net>, nvp@shore.net (Nathan V. Patwardhan) writes:
:> Albert W. Dorrington (awdorrin@mail.delcoelect.com) wrote:
:>
:> : Or ar you just trying to stir things up?
:>
:> Have you read this thread in its entirety?
:>
As a matter of fact, yes, have you?
Again, the concept boils down to what is becoming
a common theme on c.l.p.m:
One of the 'experts' feels the need to belittle someone
without fully understanding the situation.
Of course it is not always a good idea to store
a clear-text password in a script file, but there
are circumstances in which it would be acceptable.
In the area which I work, we have testers which
forward their test data to a central database.
The datafiles are transfered via FTP. The ftp account
does require a password and that password is embeded
within many, many scripts.
Is this a potential security issue - yes, it has that
potential. Has it been a problem during the past seven
years? No.
I can hear people starting up already 'you shouldn't
use FTP, you should use NFS' Ok, find me some NFS
software for a PDP-11, or a Sentry Series-80 analog
device tester, circa 1978.
Just remember, the goal may not be to have something 100%
secure. It may be just to protect/limit the people with just
enough knowledge to be 'dangerous'.
- Al
--
Al Dorrington
FIRMS & Web Admin, Oracle DBA Phone: 765-451-9655
IC-DELCO CIM, Delphi Delco Electronics Systems Fax: 765-451-8230
------------------------------
Date: Mon, 31 Aug 1998 11:15:16 -0400
From: John Porter <jdporter@min.net>
Subject: Re: Perl Cookbook, does anyone have it?
Message-Id: <35EABE04.7AACA0CD@min.net>
Mark-Jason Dominus wrote:
>
> 12 kilos rice
Typo -- should be 120 kilos of rice.
> Personally, I think it sounds like it needs about a pound
> of sage, but I realize that that would not be authentic.
No; but I would use cumin and sumac, and several kilos of
either dried limes or pickled lemons.
> Good thing the recipe calls for a medium camel;
> I don't think the local stores carry them any larger.
Well, I have yet to see camels raised for food (or anything else,
for that matter) in the U.S.; but llama farms are not unherd of.
Llama a la Ram-a
(This recipe may be adjusted for any size party;
allow one llama per guest.)
1 llama
2 kilos maize meal
2 kilos onions
2 kilos black beans
2 kilos roasted green chilis
250 grams crushed dried hot peppers
1 kilo white cheese, grated
1 XXXtra large flour tortilla (10 packages large tortillas
may be substituted, if necessary)
1 pinch epazote
lard (Llama lard is recommended, if available)
Boil the beans until mushy; fry in lard; stir in the cheese.
Boil the maize meal until pasty; fry in lard.
Fry the onions in lard until golden, adding the dried pepper
and other seasonings about half-way through.
Skin, de-bone, and pound thin the llama.
Spread the beans, maize, and onions in layers on the llama.
Layer the roasted peppers on top of that.
Roll up, and secure with string.
Grill over large wood fire until almost charred;
baste frequently lard.
Wrap with flour tortilla(s) and slice;
serve with rice.
We recommend Modelo Negro as a fine accompaniment.
--
John Porter
------------------------------
Date: 1 Sep 1998 07:43:17 GMT
From: gebis@welsh.ecn.purdue.edu (Michael J Gebis)
Subject: Re: Perl Module for URL hiding
Message-Id: <6sg8il$f2i@mozo.cc.purdue.edu>
John Armstrong <siberian@siberian.org> writes:
}I was wondering if anyone has seen a module or script ( or even function
}) that 'hides' a GET query in the URL query string? I want to implement
}it something along the lines of what Wells Fargo does, where the URL
}query string is essentially a huge unintelligible string of madness that
}I can manipulate back into shape to get my true arguments( and re-cipher
}on the way out).
}Any leads are appreciated. I am not looking for industrial strength
}security, just something to keep users from actively trying to munge the
}URL string data for funs and kicks.
Note: you WILL get hacked if you expect any sort of security from this
approach.
Assuming you can use perl to generate the URL, you could do something
like: FreeThaw your data, then gzip it, then Base64 it. Then pass
that big honking string as part of the query. To decode, un-base-64
it, gunzip it, unFreeThaw it. Depending on what sort of data you
have, you might be able to skip FreeThawing or gzipping.
And yes, that's a pretty ugly solution.
--
Mike Gebis gebis@ecn.purdue.edu mgebis@eternal.net
------------------------------
Date: 01 Sep 1998 04:53:54 -0700
From: Russ Allbery <rra@stanford.edu>
Subject: Re: perl program for inews
Message-Id: <m390k4nj59.fsf@windlord.Stanford.EDU>
Will Morse <wtm001@anadarko.com> writes:
> From what I can see, I need to connect with a socket to nntp (119) to my
> news server, which is a system in my Company but owned and operated by a
> different department and (probably) pretty much out of my ability to
> change.
[...]
> Anyway, If anyone has done this sort of thing and/or has any suggestions
> or advice, I would appreciate it.
Get Net::NNTP from CPAN; it's part of libnet. After you have it
installed, inews consists of the following Perl script:
#!/usr/bin/perl
use Net::NNTP ();
my $server = Net::NNTP->new () or die "can't connect to server: $!\n";
$server->reader ();
my @post = <STDIN>;
$server->post (\@post)
or die $server->code () . ' ' . ($server->message ())[-1];
__END__
Modules are great.
--
#!/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: 1 Sep 1998 15:19:19 GMT
From: pete@cwru.edu (Peter J. Kernan)
Subject: Re: perl regex bug? (or feature?)
Message-Id: <6sh39n$41m$1@pale-rider.INS.CWRU.Edu>
In article <6scdd5$9m4$1@pale-rider.ins.cwru.edu>,
pete@theory2.phys.cwru.edu writes:
> ("be\n" =~ /^..$/) is true, as is ("be\n" =~ /^..\n$/) but
>
> ("be\n\n" =~ /^..\n$/) is false yet ("be\n\n" =~ /^..\n\n/) is true.
>
> now i would think that the $ should match "before the newline at
> the end" in the false expression. Given the 3 true statements,
> a wild stab at the logic would lead me to deduce that the false
> statement is true. But somehow it is false.
Pete, I see your point, I hope you don't mind me beating a
/\b....\b/ horse but here is another peculiarity of regex matching
in perl5.004_.. (in the same ve.n, but more seriously wrong)
% perl -e 'print STDOUT ("be\n\n" =~ /^..\n$/) ? "consistent\n" : '
inconsistent
% perl -e '$r="..\n\$"; print STDOUT ("be\n\n" =~ /^$r/) ? "consistent'
consistent
not.
% perl -v
This is perl, version 5.004_04 built for sun4-solaris
one gets consistent,consistent in 5.005, which is nice.
--
Pete Kernan CWRU Physics and Statistics Depts
http://theory2.phys.cwru.edu/~pete
------------------------------
Date: Sun, 30 Aug 1998 18:00:48 -0500
From: "Enrico Ng" <ng@usa.net>
Subject: PLEASE HELP ME !!!!!
Message-Id: <6sf9vd$rn3$1@info3.fnal.gov>
Can anyone help me?
I have been trying to do this for a long time
but have not had any success.
this is what I want the perl to do
I have a file:
<!--begin283549-->
blahblah
blahblah
<!--end283549-->
blahblah
<!--begin283349-->
blahblah
blahblah
<!--end283349-->
I want the perl be able to do THREE THINGS
1 look at the tag and get the ID# (283549)
2 Replace blahblah with something else
3 Remove everything between the begin and end tags including the tag but
leave everything else intact.
--
Enrico Ng <ng@usa.net>
WVHS Internet
http://www.ipsd.org/wvhs
------------------------------
Date: Sun, 30 Aug 1998 23:36:00 -0500
From: "Enrico Ng" <ng@usa.net>
Subject: problem - PLEASE HELP
Message-Id: <6sftjt$55h$1@info3.fnal.gov>
I use $FORM{'nameofformfield'} to get my form variables
regular variables work fine
ie. there is a form field called name
so i type $FORM{'name'} and I get the value
but, when I have a variable inside, it does not work.
$count = "123456"
ie. $FORM{'$count'}
it comes up blank
how can I get it to work?
I basically have a file with the following data
<!--begin123456-->
<FORM type=radio name="123456" value="whatever">
<FORM type=radio name="name" value="thenamevalue">
the perl reads the comment to get the number 123456
I tested that part and it DOES get the number into the $count variable
but when I do $FORM{'$count'} I get nothing
I can try it with a regular field and it works fine
ie. $FORM{'name'} comes back with thenamevalue
PLEASE HELP ME OUT
--
Enrico Ng <ng@usa.net>
WVHS Internet
http://www.ipsd.org/wvhs
------------------------------
Date: Tue, 01 Sep 1998 12:46:00 GMT
From: maurice@hevanet.com (Maurice Aubrey)
Subject: Re: problem - PLEASE HELP
Message-Id: <slrn6unr4a.7bv.maurice@we-24-130-48-83.we.mediaone.net>
On Sun, 30 Aug 1998 23:36:00 -0500, Enrico Ng <ng@usa.net> wrote:
>I use $FORM{'nameofformfield'} to get my form variables
>regular variables work fine
>ie. there is a form field called name
>so i type $FORM{'name'} and I get the value
>but, when I have a variable inside, it does not work.
>$count = "123456"
>ie. $FORM{'$count'}
Try $FORM{"$count"}, or more simply, $FORM{$count}
Then, read about variable interpolation.
--
Maurice Aubrey <maurice@hevanet.com>
Every program expands until it can read mail.
- The MIT Law of Software Development
------------------------------
Date: Tue, 01 Sep 1998 14:29:52 +0100
From: Raj Subramani <raj.subramani@citicorp.com>
Subject: Source in multiple files [Newbie]
Message-Id: <35EBF6D0.49FE5FBE@citicorp.com>
I have written some ftp related subroutines and put them
in a file called fileFtp.pl (it looks something like this)
-------------------------
#!/usr/local/bin/perl
use Net::FTP;
sub openHostForFtp {
blah blah ..
}
sub getAsciiFiles {
blah blah ..
}
sub quitFtpHost {
blah blah ..
}
-------------------------
Now I need to write a test script in file called (say) test.pl.
How do I link test.pl and fileFtp.pl when running?
(Apologies if this has been asked 10k times but I have looked
and found many many possible answers, none of which seem to work).
Thanks in advance.
--
-raj
------------------------------
Date: Tue, 01 Sep 1998 15:39:33 GMT
From: cvag@CARLEStinet.fut.es (Carles A. Vallve)
Subject: Substract Time.
Message-Id: <35ebe1f1.276356@noticias.bcn.ibernet.es>
Hi !
I have a question about PERL:
How I can substract two times in format of hours and minuts ?
And substract two dates in year, month, and day ?
Bye and thanks.
PD: Pardon for my englush :-)
Si em contestes per email treu el CARLES de l'adrega de email.
If you reply me quit CARLES from the email adress.
Si me contestas por email saca el CARLES de la direccion de email.
/
/ /\ Carles Albert Vallvh Guionnet
\ / Tarragona, Catalunya
| \/
| email: cvag@CARLEStinet.fut.es
\ | cavg.el@CARLESalumne.etse.urv.es
/ \| URL: http://www.fut.es/~mpga
/ ICQ: 7734313
\ /
\/
------------------------------
Date: Tue, 01 Sep 1998 15:43:10 GMT
From: maurice@hevanet.com (Maurice Aubrey)
Subject: Re: Substract Time.
Message-Id: <slrn6uo5gg.7no.maurice@we-24-130-48-83.we.mediaone.net>
On Tue, 01 Sep 1998 15:39:33 GMT, Carles A. Vallve <cvag@CARLEStinet.fut.es>
wrote:
>I have a question about PERL:
>How I can substract two times in format of hours and minuts ?
>
>And substract two dates in year, month, and day ?
You may want the Date::Manip module, or one of the other Date::
related modules. They are available at CPAN:
http://www.perl.com/CPAN-local/CPAN.html
--
Maurice Aubrey <maurice@hevanet.com>
I don't like it, and I'm sorry I ever had anything to do with it.
- Erwin Schrodinger talking about quantum mechanics.
------------------------------
Date: 1 Sep 1998 07:21:26 GMT
From: gebis@welsh.ecn.purdue.edu (Michael J Gebis)
Subject: Re: sybperl Y2K compliant?
Message-Id: <6sg79m$f0j@mozo.cc.purdue.edu>
epkmann@epk.ericsson.se (Mattias Nilsson) writes:
}I am looking for information about sybperl 2.x and Y2K compliance.
}I'm not too worried about that myself but we are working on a
}project where we plan to use sybperl and the project manager will
}not be happy until I find an official statement about sybperl and
}Y2K compliance. Any help at all would be appreciated :)
I can get you that statement, but I estimate it's going to take about
16 months before the statement is completely ready.
--
Mike Gebis gebis@ecn.purdue.edu mgebis@eternal.net
------------------------------
Date: Tue, 01 Sep 1998 14:35:21 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Tom Phoenix: ANSWERS WANTED!
Message-Id: <JCTG1.30$kE2.226493@news.shore.net>
Although I appreciate the fact that Tom Phoenix isn't mean to people,
I'm sad to admit that I've recognized an ironic trend in his postings.
Over the last year I've read a number of postings like "How do I make
'Perl redirect'?" and Tom's response: "Sounds like this is something
related to your browser or server! You'll need to read the docs and
FAQs and all that good stuff. Hope this helps!"
And there are hundreds of responses like this on clpmisc! This is way
too much with too little content!
Tom, not to ruin your enthusiasm, spit, fire, etc., but I'm afraid
that your approach has become ineffective. What you've ended up doing
is adding more noise than would be present if you just ignored folks
who are asking FAQs or web questions which are not specifically
related to the Perl language. It's just eerie to read multiple
postings from you per day which are almost identical.
--
Nate Patwardhan|root@localhost
"Fortunately, I prefer to believe that we're all really just trapped in a
P.K. Dick book laced with Lovecraft, and this awful Terror Out of Cambridge
shall by the light of day evaporate, leaving nothing but good intentions in
its stead." Tom Christiansen in <6k02ha$hq6$3@csnews.cs.colorado.edu>
------------------------------
Date: Tue, 01 Sep 1998 15:43:15 GMT
From: Elaine -HappyFunBall- Ashton <eashton@bbnplanet.com>
Subject: Re: Tom Phoenix: ANSWERS WANTED!
Message-Id: <35EC13BF.1B0A736B@bbnplanet.com>
saucer of milk, table 2!
i disagree. at least tom doesn't flame them and doesn't hold their hand
either. sure, you could have mountains of content, but on the simple
stuff the faq should be sufficient. he has plenty of content in other
posts where it is a propos.
you go tom.
e.
------------------------------
Date: Tue, 1 Sep 1998 08:33:08 -0700
From: NoSpam_mknutson@websolution.com (Mick Knutson)
Subject: URGENT: How do I post to a newsgroup from a perl routine?
Message-Id: <MPG.1055b386fed6d6699896be@news.jps.net>
URGENT: How do I post to a newsgroup from a perl routine?
I would like to get a subroutine that will post a message to a news group
when called. Is there a subroutine that you can help me with?
--
Thanks ...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~ Mick Knutson ~
~ B.A.S.E. #454 ~
~ mknutson@websolution.com ~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~ Support Legal B.A.S.E. Jumping! ~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~ The BASE Board ~
~ http://www.websolution.com/base/board/index.shtml ~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~ Add yourself to The B.A.S.E. Mailer at: ~
~ http://www.websolution.com/base/mail/index.shtml ~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~ Free Perl Scripts: ~
~ http://www.websolution.com/perl/ ~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
------------------------------
Date: 12 Jul 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Special: Digest Administrivia (Last modified: 12 Mar 98)
Message-Id: <null>
Administrivia:
Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.
If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu.
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 3605
**************************************