[9228] in Perl-Users-Digest
Perl-Users Digest, Issue: 2823 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Jun 9 16:17:32 1998
Date: Tue, 9 Jun 98 13:00:26 -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, 9 Jun 1998 Volume: 8 Number: 2823
Today's topics:
Certified Perl Programmers (Mark-Jason Dominus)
Re: Certified Perl Programmers (Mike Stok)
Eval questions. <postmaster@castleamber.com>
HELP!!!!!! bidirectional sockets problem <dsdurmon@ntr.net>
Re: How to create a file... (Larry Rosler)
Re: How to create a file... <rootbeer@teleport.com>
Re: How to create a file... (Craig Berry)
Re: how would i automaticly post email messages to a ne <rootbeer@teleport.com>
Intro/Adv Perl Tutorials -Boulder/Chicago <johnd@xor.com>
Re: Latest Perl on Slakeware 2.0.33 <rootbeer@teleport.com>
Re: mailspinner.cgi <angst@scrye.com>
Re: mailspinner.cgi <rootbeer@teleport.com>
Re: More Perlish file size (bytes, KB, MB) (Joe McMahon)
Newbie seeks advice on scripts, cookies and forms. (Razor's Edge)
Re: passing multiple hashes and keeping them seperate? <aqumsieh@matrox.com>
Re: Preventing file conflicts <upsetter@ziplink.net>
Re: Reading a file from the bottom up (Daniel Grisinger)
Re: Reading Directories (Allan M. Due)
Re: sendmail on NT IIS4 <angst@scrye.com>
Socket when starting from inetd <ian.maloney@ubs.com>
Re: Socket when starting from inetd <tchrist@mox.perl.com>
Re: Socket when starting from inetd <Tony.Curtis+usenet@vcpc.univie.ac.at>
Re: Stopping Perl from interpreting fprintf's in a C fi <rootbeer@teleport.com>
To clear this all up (Re: Preventing file conflicts) <jgoldberg@dial-put_dot_here-pipex.com>
using a variable as a variable name? lindali@my-dejanews.com
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 9 Jun 1998 14:50:33 -0400
From: mjd@op.net (Mark-Jason Dominus)
Subject: Certified Perl Programmers
Message-Id: <6lk05p$9h3$1@monet.op.net>
Keywords: Flemish foggy plagiarism prize
In article <896499799.810661@thrush.omix.com>,
Zenin <zenin@bawdycaste.org> wrote:
> Certifications are only good for pointy hair managers. Anyone with
> half a clue know they are worth less then the paper they are printed
> on.
I agree. But this brings up a worry for me.
Suppose someone ere to go into the business of certifying Perl
programmers. Than I might one day be forced to pay out my hard-earned
money to get a certification from someone who knows much less than I
do. I don't like that idea. And it could happen any time. But how
can I prevent it?
By stealing the certifications in advance, that's how. I've declared
myself to be a Perl cerifying authority. I have put `certified Perl
developer' on my resume. If anyone ever starts selling
certifications, and some optential employer asks if I'm certified, I'm
set. ``Oh, yes. I've been a certified Perl developer since 1997.''
I encourage everyone else to do this too. You can certify yourself,
or you can send email to mjd-perl-certification@plover.com to request
a certification, which I will send. Then you can bill yourself as a
`Plover Systems Certified Perl Programmer' or just `Certified Perl
Programmer'. I encourage the latter---it would be bad if there was
some way to distinguish free certifications from the kind you have to
pay for.
Of course, this wouldn't work if certifications were really worth
anything---but they aren't. But middle management operates by
appearances, not realities, and a free Plover Systems Certification
has as much appearance as one that you had to pay money for.
I've been thinking that if some people need physical certificates, I
could print some up and supply them for a nominal fee, maybe $2. It
gives me the willies to take any money at all for certifications, but
it might be for the greater good. I guess I'll do it if it becomes
necessary, or maybe I'll give some out for free at the Perl
Conference.
So get certified now, because the more Certified Perl Programmers
there are, the more difficult it'll be for someone to set up a company
to take your money for certifications. Send mail to
mjd-perl-certification@plover.com, and be sure to say what you want to
be certified as.
I think a preemptive strike could be very effective here.
------------------------------
Date: 9 Jun 1998 19:55:58 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: Certified Perl Programmers
Message-Id: <6lk40e$55p@news-central.tiac.net>
Keywords: Flemish foggy plagiarism prize
In article <6lk05p$9h3$1@monet.op.net>, Mark-Jason Dominus <mjd@op.net> wrote:
>So get certified now, because the more Certified Perl Programmers
>there are, the more difficult it'll be for someone to set up a company
>to take your money for certifications. Send mail to
>mjd-perl-certification@plover.com, and be sure to say what you want to
>be certified as.
>
>I think a preemptive strike could be very effective here.
Are you willing to certify "perl engineers"? I've always wanted to be an
engineer ;-)
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: 9 Jun 1998 18:06:31 GMT
From: "John Bokma" <postmaster@castleamber.com>
Subject: Eval questions.
Message-Id: <01bd93d1$ac777600$02521e0a@tschai>
Hi,
I want to use a tekstfile to define macro's and expand macro's
based on Perl.
Example:
\
sub somesub ($)
{
my ($var) = shift;
return $var;
}
"";
\
\somesub("Expand me")\
the \somesub("Expand me")\ is replaced by
Expand me.
I have this already working using:
s/\\([^\\]+\\/ eval $1 ./ meg;
But the problem is that when I've made a mistake
in the definition of sub, there is no clear error message.
Is there a way to solve this? Another problem is that
I want to associate line numbers to each line, so I can
see which line in the ascii file causes the problem.
(something like: $line = "$.\001$line"; ).
Is there an easy Perl solution to my eval problem?
Regards,
John
--
------------------------------------------------------------------
C A S T L E A M B E R Software Development (Java/Perl/C/CGI)
http://www.castleamber.com/ john@castleamber.com
NEW: http://www.binaries.org/ Guide to Program Binaries & Pictures
------------------------------
Date: Tue, 9 Jun 1998 14:35:43 -0500
From: "Dwight S. Durmon" <dsdurmon@ntr.net>
Subject: HELP!!!!!! bidirectional sockets problem
Message-Id: <6lk2tr$mg3$1@usenet51.supernews.com>
HELP!!!!
This is probably an easy question for all of the perl guru's in this group,
however it has left me completely at a loss. I am trying to write a perl
script which will allow me to read data from <STDIN> and send it through a
socket to the client on the other end. I also want to read data from the
socket and send it to <STDOUT>. Is there a way to open a socket (or maybe 2
sockets) to do this and keep them open until the word "QUIT" is recieved
either on the server or client side? I have tried the scripts in the Camel
book, but they only seem to work sending data from the Server to the client,
not both directions.
Thank you in
advance....
Dwight
------------------------------
Date: Tue, 9 Jun 1998 11:18:28 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: How to create a file...
Message-Id: <MPG.fe71c4c6f902e22989687@nntp.hpl.hp.com>
In article <357D7500.8C@hotkey.net.au>, steph@hotkey.net.au says...
> I'm a newbie to Perl as well, so I'll show some mercy. I hope no one
> minds me replying because, really you are being a tad lazy if ya can't
> do the basics!
I'm sure no one minds, but you should learn and teach good habits from
the beginning.
...
> open(FILE,">$your_file")
or die "Couldn't open $your_file. $!.";
> print FILE "$some_data";
print FILE $some_data;
...
--
Larry Rosler
Hewlett-Packard Laboratories
lr@hpl.hp.com
------------------------------
Date: Tue, 09 Jun 1998 19:04:18 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: How to create a file...
Message-Id: <Pine.GSO.3.96.980609120400.29617y-100000@user2.teleport.com>
On Wed, 10 Jun 1998, Stephan Carydakis wrote:
> open(FILE,">$your_file");
Even when your script is "just an example" (and perhaps especially in that
case!) you should _always_ check the return value after opening a file.
Thanks!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: 9 Jun 1998 18:54:06 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: How to create a file...
Message-Id: <6lk0ce$8ap$1@marina.cinenet.net>
Stephan Carydakis (steph@hotkey.net.au) wrote:
: Jonathan A. Laub wrote:
: > How does one create a new file using perl5? I have a working cgi script in
: > which I wish to write it's output to a "log" file. I have tried printf and
: > write(filehandle) with no success. Any ideas?
:
: First, the directory to where you want to write your file on the server
: must have write permissions for users of your type.
Or actually, for the user under which the script will be run, typically
'nobody' on Unix systems.
: The Perl part goes like this:
: {
: open(FILE,">$your_file");
Only if you're a masochist. Why toss aside Perl's ability to help you
debug problems? ALWAYS ALWAYS ALWAYS check the return value from open,
like:
open FILE, "> $your_file" or die "Can't open $your_file: $!";
(Actually, depending on your server and script, you may need a more
sophisticated approach than 'die' to see error output when running the
script through an http CGI access.)
Also, as written above, the previous contents of the file are clobbered;
not good for a log file. You probably want ">>" rather than ">" before
$your_file.
---------------------------------------------------------------------
| Craig Berry - cberry@cinenet.net
--*-- Home Page: http://www.cinenet.net/users/cberry/home.html
| Member of The HTML Writers Guild: http://www.hwg.org/
"Every man and every woman is a star."
------------------------------
Date: Tue, 09 Jun 1998 18:52:02 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: how would i automaticly post email messages to a newsgroup?
Message-Id: <Pine.GSO.3.96.980609114837.29617w-100000@user2.teleport.com>
On Tue, 9 Jun 1998, Yash Khemani wrote:
> i'd like to post email messages directly to a newsgroup on a
> secure (ssl enabled) news server. any help you might be able
> to provide on how to accomplish this would be greatly appreciated!
You probably want to write a Perl program which would do this. There are
some modules on CPAN which should be able to help you. If you still have
questions after reading the appropriate docs, feel free to post again and
let us know how far you've gotten. Good luck!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Tue, 09 Jun 1998 12:25:12 -0700
From: John Donnelly <johnd@xor.com>
Subject: Intro/Adv Perl Tutorials -Boulder/Chicago
Message-Id: <357D8C18.10A7@xor.com>
****Intro & Advanced Perl Programming Tutorials*****
Denver, CO area (Boulder)
Chicago, IL area (Naperville)
**Register on-line and save 15%**
http://www.xor.com/training
*****
Introduction to Perl for Programmers
(3 day, hands-on, lecture/lab format)
Tuition: $995
Naperville, IL - June 22-24, 1998
Boulder, CO - July 8-10, 1998
Designed to be programmer-friendly and platform-neutral,
Perl is a high-level, general-purpose programming language
that makes easy and medium-hard tasks easy and seriously
non-trivial tasks possible. Now moving into its second
decade, Perl has become the language of choice across all
platforms for programmers engaged in rapid prototyping, sys-
tem utilities, software tools, system management tasks, data
base access, graphical programming, and world wide Web pro-
gramming.
NOTE: While this course is based on the current release of
Perl (version 5.004), it is not intended to be a detailed
discourse on all advanced programming constructs now
afforded by that release. It is a jump-start introduction
to Perl for experienced programmers, not an advanced course
for Perl programmers.
Advanced Perl Programming
(3 day, hands-on, lecture/lab format)
Tuition: $995
Naperville, IL - July 15-17, 1998
Boulder, CO - August 3-5, 1998
This course presents everything you'll need to completely
master advanced Perl programming using features and facili-
ties from the latest release of Perl, the 5.004 release.
For complete write-ups (who should attend; prerequisites;
course outline) and registration information, please visit
our Web site: http://www.xor.com/training, send email to
training@xor.com, or call XOR's Training Coordinator - 800-
XOR-4404, 303-448-4800.
------------------------------
Date: Tue, 09 Jun 1998 19:03:41 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Latest Perl on Slakeware 2.0.33
Message-Id: <Pine.GSO.3.96.980609115245.29617x-100000@user2.teleport.com>
On 9 Jun 1998, Earl E. McCoy wrote:
> I am having trouble installing Perl 5.004.04 on Slakeware Linux
> 2.0.33. Bombs out on some C code.
I think that this message may have what you need.
http://www.rosat.mpe-garching.mpg.de/mailing-lists/perl-porters
/1998-03/msg00401.html
It includes a patch to the hints/linux.sh file which may make it work for
you. That patch will be included in the upcoming 5.004_05 release of Perl.
Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: 9 Jun 1998 18:28:11 GMT
From: angst <angst@scrye.com>
Subject: Re: mailspinner.cgi
Message-Id: <6ljurr$67l$2@jelerak.scrye.com>
redpeppa@my-dejanews.com wrote:
: if anyone has a copy of mailspinner.cgi plz email me..im 18 and i really
: cant afford paying $1,000 when all im looking for is a personal web email
: client...thanks
So you're asking for a pirated copy of a commercial product? Try
your friendly neighborhood w@r3z d00dz. Not only is this illegal,
it has absolutely nothing to do with perl.
HTH!
--
Erik Nielsen <eln@rmci.net>
mail to above (rather than header address) is answered significantly faster.
this post != views of anyone at all, really
"You are like...unix GOD" -- local tech support
------------------------------
Date: Tue, 09 Jun 1998 18:48:19 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: mailspinner.cgi
Message-Id: <Pine.GSO.3.96.980609114153.29617v-100000@user2.teleport.com>
On Tue, 9 Jun 1998 redpeppa@my-dejanews.com wrote:
> if anyone has a copy of mailspinner.cgi plz email me..im 18 and i really
> cant afford paying $1,000 when all im looking for is a personal web
> email client...thanks
I must be misunderstanding you. Are you asking the users of this newsgroup
to pirate $1000 worth of software for you? Announcing your intentions in
public like this is a poor way to begin a life of crime. :-)
In any case, if you're interested in _locating_ (as opposed to writing)
software, this newsgroup is probably not the resource for you. You
probably want a software archive, which will typically have hundreds of
freely-available programs which you may download at no cost. You can
locate any number of archives through Yahoo or a similar service.
Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Tue, 09 Jun 1998 14:57:25 -0400
From: joe.mcmahon@gsfc.nasa.gov (Joe McMahon)
Subject: Re: More Perlish file size (bytes, KB, MB)
Message-Id: <joe.mcmahon-0906981457260001@prtims.stx.com>
In article <6kv4q7$qup@newshub.atmnet.net>, "C.W.Holeman II"
<choleman@simpact.com> wrote:
>This works but how about something more Perlish?
Okay, how about a tied scalar that automagically prints out reformatted?
Very Perlish, but kinda silly...
--- Joe M.
use KFormatter;
tie $memsize,"KFormatter";
$memsize = 20_345_645;
print $memsize; # 319.40M2
package KFormatter;
use vars qw($places,@scale);
use Math::BigFloat;
# Scale labels
@labels = ("T","G","M","K","");
# maximum significant figures
$places = 3;
# Scale factor
$scale = 1024;
sub TIESCALAR {
my $class = shift;
my $self = {};
$self->{Places} = $places;
$self->{Labels} = \@labels;
$self->{Factor} = $scale;
$self->{MaxFactor} = $scale ** $#labels;
bless $self,$class;
}
sub STORE {
my ($self,$value) = @_;
$value =~ tr/_//d;
$self->{Value} = eval{$value};
}
sub FETCH {
my $self = shift;
my $value = $self->{Value} || 0;
my $maxfactor = $self->{MaxFactor};
return kformat($value,$maxfactor,$self->{Factor},$self->{Labels});
}
sub kformat {
my ($value, $maxfactor,$scale,$labelref) = @_;
my $label = 0;
while ($maxfactor > 1) {
if ($value > $maxfactor) {
# calculate fraction
$value /= $maxfactor;
# recurse if still too big to fit in scale
if ($value > $scale) {
return kformat($value,
$maxfactor,$scale,$labelref) .
$labelref->[0];
}
# fits in scale, format and return
return sprintf("%3.2f" .
$labelref->[$label],
$value);
}
# smaller than max factor,
# step down one factor and try again.
$maxfactor /= $scale;
$label++;
}
# if maxfactor = 1, cannot format.
return $value;
}
------------------------------
Date: Tue, 09 Jun 1998 19:11:09 GMT
From: richard.q@virgin.net (Razor's Edge)
Subject: Newbie seeks advice on scripts, cookies and forms.
Message-Id: <357a54fd.2099825@news.computalynx.co.uk>
Hi.
I've just started out on that lovely road of discovery called
"Cookies".
What I have is the scripts from MSA (Matt's Script Archive).
What I want to do is use cookies to store the name and e-mail address
of client coming to the site. The site is to sell comics.
What I want to know, is how do I fill in a form via perl script from
cookies.
I am thinking that I need to generate the entire page within th
script, containing all the form bits and pieces?
Is this right?
I hope someone can help.
------------------------------
Date: Tue, 09 Jun 1998 15:06:53 -0400
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: passing multiple hashes and keeping them seperate?
Message-Id: <357D87CD.E3B76E3E@matrox.com>
(A. Rich) wrote:
> Greetings,
>
> I have a routine that takes, among other things, two hashes as
> arguments. I need to keep these two hash tables separate even though
> they have keys in common (exact, to be truthful). The hashes have the
> same keys because they keep track of different attributes of the same
> thing like size and permission of a file, for instance).
Well .. you can use one hash with the same keys you have now, but the
corresponding values would be anonymous arrays. Hashes of arrays ... isn't
Perl beautiful?
> How do I keep the two hash tables separate when I pass them to the
> routine?
>
> I'm attempting something like:
>
> &func("text","more text","yet more text",%hash1,%hash2);
That's wrong, as you have discovered. You SHOULD read the documentation.
This is yet another FAQ, and you could save a lot of your (and my, not to
mention the rest of world's) time by simply reading in the documentation
located on your system.
Browsing through the perlsub manpages:
Pass by Reference
If you want to pass more than one array or hash into a
function--or return them from it--and have them maintain
their integrity, then you're going to have to use an
explicit pass-by-reference. Before you do that, you need to
understand references as detailed in the perlref manpage.
This section may not make much sense to you otherwise.
Here are a few simple examples. First, let's pass in
several arrays to a function and have it pop all of then,
return a new list of all their former last elements:
@tailings = popmany ( \@a, \@b, \@c, \@d );
sub popmany {
my $aref;
my @retlist = ();
foreach $aref ( @_ ) {
push @retlist, pop @$aref;
}
return @retlist;
}
Here's how you might write a function that returns a list of
keys occurring in all the hashes passed to it:
@common = inter( \%foo, \%bar, \%joe );
sub inter {
my ($k, $href, %seen); # locals
foreach $href (@_) {
while ( $k = each %$href ) {
$seen{$k}++;
}
}
return grep { $seen{$_} == @_ } keys %seen;
}
Everything was in front of you the whole time .. you just had to look!
--
Ala Qumsieh | No .. not just another
ASIC Design Engineer | Perl Hacker!!!!!
Matrox Graphics Inc. |
Montreal, Quebec | (Not yet!)
------------------------------
Date: 9 Jun 1998 17:57:09 GMT
From: Scratchie <upsetter@ziplink.net>
Subject: Re: Preventing file conflicts
Message-Id: <6ljt1l$kcb@fridge.shore.net>
Tom Christiansen <tchrist@mox.perl.com> wrote:
: One must call a FAQ a FAQ. Those are refuse to learn from manpages are
: doomed. They must be helped into empowering themselves, researching and
: learning. A simple grep on the pods that come with Perl will do wonders.
There's a difference between helping and insulting, a not-too-subtle
distinction that many on this group nevertheless fail to recognize.
--Art
--------------------------------------------------------------------------
National Ska & Reggae Calendar
http://www.ziplink.net/~upsetter/ska/calendar.html
--------------------------------------------------------------------------
------------------------------
Date: Tue, 09 Jun 1998 18:10:35 GMT
From: dgris@perrin.dimensional.com (Daniel Grisinger)
Subject: Re: Reading a file from the bottom up
Message-Id: <6ljtdf$18e$1@perrin.dimensional.com>
In article <35794b28.59268743@news.btinternet.com>,
Jonathan Stowe <Gellyfish@btinternet.com> wrote:
>On Sat, 6 Jun 1998 09:38:24 +0100, Tan wrote :
>
>>Hi,
>>
>>Is there a way to read files starting from the end?
>>
<snip>
>There is no way I know of doing this that doesnt require reading the
>whole file - however there may still be some advantage if the
>processing for each row is fairly intensive.
You may want to pursue a different strategy, especially if your log
files grow extremely large. The following will speed things up
at the expense of an extra open every time (but the cost of the extra
open will be drowned out by the savings in read time and memory usage).
use strict;
my $offset_file = '/var/tmp/offset';
my $log_file = '/var/log/maillog';
my ($offset, $position);
open(LOG, $log_file) || die "Couldn't open $log_file: $!";
if(-f $offset_file) { #offset file exists, read it
open(OFFSET, $offset_file) || die "Couldn't open $offset_file: $!";
$offset = <OFFSET>;
seek(LOG, $offset, 0); #positions LOG at the offset specified
close(OFFSET);
}
while(<LOG>){
print;
}
open(OFFSET_OUT, ">$offset_file") ||
die "Couldn't open $offset_file for writing: $!";
$position = tell(LOG);
print OFFSET_OUT $position; #sets offset for next time
close(OFFSET_OUT);
exit();
__END__
Regards,
Daniel
--
Daniel Grisinger dgris@perrin.dimensional.com
"No kings, no presidents, just a rough consensus and
running code."
Dave Clark
------------------------------
Date: 9 Jun 1998 19:36:07 GMT
From: due@murray.fordham.edu (Allan M. Due)
Subject: Re: Reading Directories
Message-Id: <6lk2r7$2kv$0@206.165.146.146>
In article <6ljjeh$5mj$1@news2.xs4all.nl>, Irsan Widarto (irsan@tcf.nl)
posted...
|
|dukeboy77@my-dejanews.com wrote in message <6lji10$nc3$1@nnrp1.dejanews.com>...
|>I need a script that will search a directory read the name of every file
|>and put it into an array called @files.
|
|not sure what you mean with 'search a directory', but this should do the reading
|part of your quest:
|
[snip]
Or if you only want the files and not the directories too:
#!/usr/local/bin/perl -w
use strict;
my $dir_name = './dir';
opendir (DIR, $dir_name) or die "Could not find directory: $dir_name
$!";
my @files = grep { -f "$dir_name/$_" } readdir(DIR);
closedir(DIR);
--
Allan M. Due
Due@Murray.Fordham.edu
The beginning of wisdom is the definitions of terms.
- Socrates
------------------------------
Date: 9 Jun 1998 18:26:32 GMT
From: angst <angst@scrye.com>
Subject: Re: sendmail on NT IIS4
Message-Id: <6ljuoo$67l$1@jelerak.scrye.com>
Don Bayless <donbay@gte.net> wrote:
: Just what would one put in place of this on an NT box running IIS4??
: #!/usr/local/bin/perl
: $mail_prog = '/usr/lib/sendmail' ;
The name of a command-line mailer written for NT. AFAIK, NT doesn't come with
one. Some NT MTA's come with one. Either way, the question has nothing
to do with perl, it has to do with command-line mailers. You might want
to try an NT group, and ask about command-line mailers for NT.
HTH!
--
Erik Nielsen <eln@rmci.net>
mail to above (rather than header address) is answered significantly faster.
this post != views of anyone at all, really
"You are like...unix GOD" -- local tech support
------------------------------
Date: Tue, 09 Jun 1998 19:35:50 +0200
From: Ian Maloney <ian.maloney@ubs.com>
Subject: Socket when starting from inetd
Message-Id: <357D7276.57FF9C95@ubs.com>
I want to start a perl program from inetd on a UDP port and read from the socket.
The inetd source says that the socket will be open on FD 0 when the program is
exec'd.
I guessed the socket might be on STDIN which I tested like this:
print "It's a socket\n" if (-S STDIN);
but it ain't there on STDIN.
However I know the socket is open because I when I try and open it I get a failure
with the message 'Address already in use'. I also know my socket code is OK
because I can start the program manually. I also have 'wait' in the inetd.conf so
that it doesn't just grab the socket again.
Anybody know how I can get at the open socket, or just close it so I can re-open
it myself?
Thanks
Ian
------------------------------
Ian Maloney UBS +41 1 236 1629
------------------------------
Date: 9 Jun 1998 18:46:27 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Socket when starting from inetd
Message-Id: <6ljvu3$68k$1@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc, ian.maloney@ubs.com writes:
:I want to start a perl program from inetd on a UDP port and read from the socket.
One does not read() UDP packets.
--tom
--
echo "I can't find the O_* constant definitions! You got problems."
--The Configure script from the perl distribution
------------------------------
Date: 09 Jun 1998 21:44:34 +0200
From: Tony Curtis <Tony.Curtis+usenet@vcpc.univie.ac.at>
To: ian.maloney@ubs.com
Subject: Re: Socket when starting from inetd
Message-Id: <7xemwye4wt.fsf@haze.vcpc.univie.ac.at>
Re: Socket when starting from inetd, Ian
<ian.maloney@ubs.com> said:
Ian> I want to start a perl program from inetd on a UDP port
Ian> and read from the socket. The inetd source says that
Ian> the socket will be open on FD 0 when the program is
Ian> exec'd.
Actually you don't want to go near the socket (which
socket?) at all. This is what inetd does for you.
Your program can just use normal stdio; stdin is input from
the remote connection and stdout is output.
setbuf() may be your friend though...
hth
tony
--
Tony Curtis, Systems Manager, VCPC, | Tel +43 1 310 93 96 - 12; Fax - 13
Liechtensteinstrasse 22, A-1090 Wien, AT | http://www.vcpc.univie.ac.at/
"You see? You see? Your stupid minds! Stupid! Stupid!" ~ Eros, Plan9 fOS.
------------------------------
Date: Tue, 09 Jun 1998 18:40:17 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Stopping Perl from interpreting fprintf's in a C file
Message-Id: <Pine.GSO.3.96.980609113745.29617u-100000@user2.teleport.com>
On Tue, 9 Jun 1998, gip wrote:
> But after a "printf( OUTFILE, $line );", it becomes this:
If you didn't want perl to use printf on $line, maybe you shouldn't have
called printf! (With the wrong syntax, too! :-)
While there's nothing wrong with using printf when you want it, Perl has a
perfectly good output function which simply prints its parameters; look in
the perlfunc manpage for "print". Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Tue, 9 Jun 1998 19:44:16 +0100
From: "Jeremy Goldberg" <jgoldberg@dial-put_dot_here-pipex.com>
Subject: To clear this all up (Re: Preventing file conflicts)
Message-Id: <6ljvru$e9k$1@flex.london.pipex.net>
Tom took all this to GS, and it turns out that the flock() problem is with
Windows 95 (and 98?) - it DOES work with NT, though.
So all the horrible things Tom and I said to each other were unwarranted.
Now all I need to know is what a nimrod actually is... :)
------------------------------
Date: Tue, 09 Jun 1998 19:41:41 GMT
From: lindali@my-dejanews.com
Subject: using a variable as a variable name?
Message-Id: <6lk35l$gt0$1@nnrp1.dejanews.com>
Please excuse if this is a trivial question, i'm fairly new to Perl...
i've been having a problem where i need to read an external file
which contains lookup codes for the data i'm evaluating: (see code)
while ( <CODELOOKUP> ) {
chomp; # remove newline char
# parse the fields and assign values to a hash
( $varname, $numid ) = split;
$code{$varname} = $numid; # code for varname is numid
}
reading in and storing the values hasn't been a problem. it's later, when i
want to use that information to compare and assign a new value to a variable:
(see code below)
while ( ($varname,$code) = each(%code) ) {
if ( $f eq $code ) { # if criteria matches code
$$varname = $d; # assign corresponding value to the variable
}
}
for example, if the program reads in : Test 3521
then $varname = Test and $numid = 3521
then $code{"Test"} = 3521
so if $f happens to equal 3521, then i'd like to assign
$Test = $d;
however, i have a feeling that this isn't allowed in Perl
is there some other way this can be done?
- linda
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
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 2823
**************************************