[12053] in Perl-Users-Digest
Perl-Users Digest, Issue: 5653 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu May 13 15:07:13 1999
Date: Thu, 13 May 99 12:00:34 -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 Thu, 13 May 1999 Volume: 8 Number: 5653
Today's topics:
Automating telnet <pdncoop@americasm01.nt.com>
browser call opens text does not run perl script <earlie@my-dejanews.com>
Re: C call perl - perl call c question <t-armbruster@ti.com>
Re: Conditional search and replace within a text file <revjack@radix.net>
Re: Conditional search and replace within a text file <microchip@centuryinter.net>
Re: Conditional search and replace within a text file (Tad McClellan)
Re: Converting from octal to decimal <swarren@www.wwwdotorg.org>
Re: Converting from octal to decimal <droby@copyright.com>
Cperl mode on NTEmacs help. Also simple newbie perl que <plord@hgmp.mrc.ac.uk>
Re: Distributing perl-code in different files, how? (Charles R. Thompson)
Re: Download register script (Charles R. Thompson)
Re: Dynamic generation of a hash <emschwar@rmi.net>
Re: E-Mail from NT Via Net::SMTP <gbuehler@ralgi.com>
first perl project <thirdaver@inxpress.net>
Re: FLOCK When? <bwlang@genome.wi.mit.edu>
gethostname() <amitai.schlair@usa.net>
Re: Getting web page programmatically <reid.lee@natinst.com>
Help with CGI Script Required! <webmaster@*nospam*mugomilk.freeserve.co.uk>
Help with Tie and db? (Paul Pomerleau)
Re: How can i write perl script and ouput the base dire <bwlang@genome.wi.mit.edu>
How to create a non-blocking UDP server on Win32 <jalil@corp.home.net>
http equivalent ftp commands <username@nospam.com>
http equivalent ftp commands <username@nospam.com>
imbedded subroutine <arpin@adan.kingston.net>
Re: japh tags <Allan@due.net>
libwww installation izzac@my-dejanews.com
Re: Logic question <t-armbruster@ti.com>
Re: Looking for autoresponder script ! cindycrawford@my-dejanews.com
Re: MS-HTML must die! <tchrist@mox.perl.com>
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 13 May 1999 14:00:34 -0400
From: "Puddister, Shannon" <pdncoop@americasm01.nt.com>
Subject: Automating telnet
Message-Id: <373B1341.FE18FF53@americasm01.nt.com>
I'm attempting to automate telnetting (first priority) and ftp (second)
in a testing program. How do I "include", so to speak, other files from
other directories. More specifically, I have another program I'd like
to use in one of my subroutines, and need the main program to know
where to find it. If this involves setting the path, what is the syntax
for this? Thanks in advance,
Shannon
------------------------------
Date: Thu, 13 May 1999 18:24:21 GMT
From: earlie <earlie@my-dejanews.com>
Subject: browser call opens text does not run perl script
Message-Id: <7hf5c8$lo7$1@nnrp1.deja.com>
Why does the browser open the .pl as a text file in notepad rather than
run the script?
This is specific to one comp on the network (as far as i can tell) and
the others run the script just fine.
Thanks
--== Sent via Deja.com http://www.deja.com/ ==--
---Share what you know. Learn what you don't.---
------------------------------
Date: Thu, 13 May 1999 13:00:07 -0500
From: "Tim Armbruster" <t-armbruster@ti.com>
Subject: Re: C call perl - perl call c question
Message-Id: <PuE_2.27$401.2560@dfw-service1.ext.raytheon.com>
Luca Legittimo wrote in message <7hf1o4$bso$1@fe2.cs.interbusiness.it>...
>When i create a perl interpreter from a C program, can I call a C function
>from perl interpreter?
>
Huh?
------------------------------
Date: 13 May 1999 18:02:30 GMT
From: Riley Tiber <revjack@radix.net>
Subject: Re: Conditional search and replace within a text file
Message-Id: <7hf43m$fno$1@news1.Radix.Net>
Keywords: Hexapodia as the key insight
Tad McClellan explains it all:
: No need to "guess" when you have the Benchmark module:
[trim]
:Benchmark: timing 6000000 iterations of control, eq, eqi, re, rei...
: control: 4 wallclock secs ( 4.91 usr + 0.00 sys = 4.91 CPU)
: eq: 11 wallclock secs (11.28 usr + 0.01 sys = 11.29 CPU)
: eqi: 14 wallclock secs (14.43 usr + 0.00 sys = 14.43 CPU)
: re: 17 wallclock secs (16.96 usr + 0.03 sys = 16.99 CPU)
: rei: 18 wallclock secs (17.80 usr + 0.05 sys = 17.85 CPU)
1) Where can I find a definition of "wallclock" in this context?
2) What kind of monster are you running your code on? I'm on a Sun
Enterprise 450 running Solaris 2.6 and perl 5.005_02, and the box
isn't doing anything in particular at the moment (load average = 0.01),
and my times are as follows:
Benchmark: timing 6000000 iterations of control, eq, eqi, re, rei...
control: 13 wallclock secs (11.68 usr + 0.00 sys = 11.68 CPU)
eq: 32 wallclock secs (32.12 usr + 0.00 sys = 32.12 CPU)
eqi: 39 wallclock secs (39.99 usr + 0.00 sys = 39.99 CPU)
re: 77 wallclock secs (74.74 usr + 0.00 sys = 74.74 CPU)
rei: 65 wallclock secs (62.61 usr + 0.00 sys = 62.61 CPU)
--
/~\ Susan Donaldson strawberry cottonseed excelsior cetera Coddingt
C oo balmy cleave agile Hercules nobody'd suckling milt Nazarene loq
_( ^) 1 , 0 0 0 , 0 0 0 m o n k e y s c a n ' t b e w r o n g
/___~\ http://www.radix.net/~revjack/mnj revjack@radix.net
------------------------------
Date: Thu, 13 May 1999 12:18:30 -0400
From: MicroChip <microchip@centuryinter.net>
Subject: Re: Conditional search and replace within a text file
Message-Id: <373AFB56.67F5@centuryinter.net>
A friendly query,
Please explain why the "if" method is better than the regex?? They both
take appx the same code space, and they both give the same result. And
the regex can check for 'Notes:' 'notes:' or 'NOTES:' if it were so
desired (its not in this case) where the if method cannot, at least not
with the same simplicity. Im guessing that the if method may have a
better performance timewise?? Or is it just personal preference?
MC
Peter J. Acklam wrote:
>
> MicroChip wrote:
> >
> > ## to turn a line "NOTES:" into "" use
> >
> > s/^NOTES:$//; ## is string is in $_
> > $line =~ s/^NOTES:$//; ## if string is in $line
>
> No need for regexes here. Simply use
>
> $_ = '' if $_ eq 'NOTES:'; ## if string is in $_
> $line = '' if $line eq 'NOTES:'; ## if string is in $line
>
> Peter
>
> --
> Peter J. Acklam - jacklam@math.uio.no - http://www.math.uio.no/~jacklam
--
________________________________
MicroChip Technical Services
backwoods [at] backwoods.org
------------------------------
Date: Thu, 13 May 1999 08:06:50 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Conditional search and replace within a text file
Message-Id: <q8feh7.pp1.ln@magna.metronet.com>
[ please put your comment following the quoted text that you
are commenting on.
Jeopardy style followups are hard to follow...
]
MicroChip (microchip@centuryinter.net) wrote:
: Please explain why the "if" method is better than the regex??
It is faster.
: They both
: take appx the same code space,
I think you mean "source code space" there.
: and they both give the same result. And
: the regex can check for 'Notes:' 'notes:' or 'NOTES:' if it were so
: desired (its not in this case) where the if method cannot, at least not
: with the same simplicity.
Not as simply to code, but it can execute faster.
: Im guessing that the if method may have a
: better performance timewise??
No need to "guess" when you have the Benchmark module:
----------------------------------
#!/usr/bin/perl -w
use strict;
use Benchmark;
timethese 6_000_000, {
control => q{my $line='NOTES:'},
re => q{my $line='NOTES:'; $line =~ s/^NOTES:$//;},
rei => q{my $line='NOTES:'; $line =~ s/^NOTES:$//i;},
eq => q{my $line='NOTES:'; $line = '' if $line eq 'NOTES:';},
eqi => q{my $line='NOTES:'; $line = '' if uc($line) eq 'NOTES:';},
};
----------------------------------
output:
Benchmark: timing 6000000 iterations of control, eq, eqi, re, rei...
control: 4 wallclock secs ( 4.91 usr + 0.00 sys = 4.91 CPU)
eq: 11 wallclock secs (11.28 usr + 0.01 sys = 11.29 CPU)
eqi: 14 wallclock secs (14.43 usr + 0.00 sys = 14.43 CPU)
re: 17 wallclock secs (16.96 usr + 0.03 sys = 16.99 CPU)
rei: 18 wallclock secs (17.80 usr + 0.05 sys = 17.85 CPU)
: Peter J. Acklam wrote:
: >
: > MicroChip wrote:
: > >
: > > ## to turn a line "NOTES:" into "" use
: > >
: > > s/^NOTES:$//; ## is string is in $_
: > > $line =~ s/^NOTES:$//; ## if string is in $line
: >
: > No need for regexes here. Simply use
: >
: > $_ = '' if $_ eq 'NOTES:'; ## if string is in $_
: > $line = '' if $line eq 'NOTES:'; ## if string is in $line
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Thu, 13 May 1999 18:43:59 GMT
From: "Stephen Warren" <swarren@www.wwwdotorg.org>
Subject: Re: Converting from octal to decimal
Message-Id: <P3F_2.753$6x6.1118@news.rdc1.sfba.home.com>
Anand <anand@my-dejanews.com> wrote in message
news:7heqba$bj3$1@nnrp1.deja.com...
> In article <m167705l88.fsf@halfdome.holdit.com>,
> merlyn@stonehenge.com (Randal L. Schwartz) wrote:
> >
> > [note: comp.lang.perl is dead. Real dead. Stop using it to post.]
>
> I am learning Perl now and started reading this newsgroup
> (comp.lang.perl) to learn from others' posts. What do you mean by
> "comp.lang.perl is dead"? If it is dead what newsgroup is being used for
> general perl discussions? And why is c.l.p dead?
In an ideal world, you would not be able to even *see* c.l.p in your
newsgroup list. It's been superceded by c.l.p.x, where x is e.g. misc,
modules, moderated.
Unfortunately, not all news servers have managed to kill off c.l.p, so a
lot of people still see it and assume that it's meant to be there!
--
Stephen Warren, Snr Systems Engineer, Technology House, San Francisco
mailto:swarren@techhouse.com http://www.techhouse.com/
mailto:swarren@wwwdotorg.org http://www.wwwdotorg.org/
MIME, S/MIME and HTML mail are acceptable
------------------------------
Date: Thu, 13 May 1999 18:44:53 GMT
From: Don Roby <droby@copyright.com>
Subject: Re: Converting from octal to decimal
Message-Id: <7hf6j5$mk7$1@nnrp1.deja.com>
In article <m167705l88.fsf@halfdome.holdit.com>,
merlyn@stonehenge.com (Randal L. Schwartz) wrote:
>
> [note: comp.lang.perl is dead. Real dead. Stop using it to post.]
>
> >>>>> "Mike" == Mike Rizzo <mrizzo@ismd.ups.com> writes:
>
> Mike> $oct = $ARGV[0];
> Mike> $dec = oct($oct);
> Mike> print "octal is $oct , decimal is $dec";
> Mike> ******************************************
> Mike> The value I am getting in $dec is not correct,
> Mike> When i pass it in 16895, I get the value of $dec to be 14, when
in
> Mike> fact should be 40777 according to the perl line above,
> Mike> Any ideas as to why the the oct() function is not converting
> Mike> the number properly.
>
> You probably need to start with a valid octal number. Hint: octal
> numbers don't have 8's or 9's in them.
>
> I think you got the oct() function backwards. :)
>
This is why the last time I wrote a set of functions to do these things
(a long long time ago in Macro-11), I called them things like bin2hex,
dec2bin, etc. It's hard to remember which way the translation goes when
the name doesn't reflect both source and destination.
Of course it would be nicer to have a single function of three
arguments, two of which specify source and destination number-base. But
I think we've been down that thread before. ;-)
--
Don Roby
--== Sent via Deja.com http://www.deja.com/ ==--
---Share what you know. Learn what you don't.---
------------------------------
Date: 13 May 1999 19:19:21 +0100
From: Phillip Lord <plord@hgmp.mrc.ac.uk>
Subject: Cperl mode on NTEmacs help. Also simple newbie perl question
Message-Id: <wkbtfo4yty.fsf@hgmp.mrc.ac.uk>
I finally decided to bite the bullet and learn some
perl. However Im having a few problems, and thought that Id ask here
for help to get off the ground.
First Im having problems getting cperl mode to work
probably on NTEmacs (20.3.1). The main thing is that some of the menu
items are blanked out, most importantly "Run". From the documentation
I seem to need install compile-mode.el. Does some one know where I can
get this from? I looked at www.perl.com, and I tried the various emacs
sites, but I couldnt find it. I have the feeling that I am doing
something dumb, but Im not sure what.
The second problem is that I can't get my first (halfway
useful) perl program working. I was trying to write a recursive
directory lister (trust me, it will be useful later!), and it dont
work.
Im using the latest version of perl on win95. The first
version that I wrote was this
list_files( "d:/home" );
##sub routime list_files. Takes a dir as a argument. Get all the
##files. Work through each one in turn. If its a directory call
##this function on it (printing something cute) recursively
sub list_files{
# print( "In list files \n" );
##assign the parameter to a local variable
my $dir_name = $_[ 0 ];
opendir( DIR, $dir_name );
while( $name = readdir( DIR ) ){
chomp( $name );
# print "Name is $name\n";
##if its a directory then pass it recursively
unless ( $name eq "." || $name eq ".." ){
if ( -d $name ){
my $new_dir = $dir_name . "/" . $name;
print( "Directory " . $new_dir . "\n" );
list_files( $new_dir );
}else{
print( "File " . $name . "\n" );
}
}
}
}
this bit seems to fail because the if ( -d $ name ) never
returns true so everything gets identified as a file, and no recursive
call takes place. So then I tried...
list_files( "d:/home" );
##sub routime list_files. Takes a dir as a argument. Get all the
##files. Work through each one in turn. If its a directory call
##this function on it (printing something cute) recursively
sub list_files{
##assign the parameter to a local variable
my $dir_name = $_[ 0 ];
opendir( DIR, $dir_name );
while( $name = readdir( DIR ) ){
chomp( $name );
##Skip the . and .. files
unless ( $name eq "." || $name eq ".." ){
my $new_dir = $dir_name . "/" . $name;
##try to open it as a directory
if (opendir( NEWDIR, $new_dir ) ){
print( "Directory " . $new_dir . "\n" );
&list_files( $new_dir );
}else{
print( "File " . $name . "\n" );
}
}
}
}
this recurses all right. However it finds the first dir
recurses all the way down to the botton of the directory tree and then
lists the files. It doesnt go back and do all the directories. Im
guessing here that Im misunderstanding the scoping rules of perl, and
that that perhaps the DIR directory handle is getting over ridden on
the recursive call. Can anyone point me in the correct direction?
Phil
------------------------------
Date: Thu, 13 May 1999 16:26:42 GMT
From: design@raincloud-studios.com (Charles R. Thompson)
Subject: Re: Distributing perl-code in different files, how?
Message-Id: <MPG.11a4c89962047eab9896bd@news>
[ Congratulations, Federico Abascal you could be a winner! Return to
comp.lang.perl.misc to claim your prize. ]
In article <373AC3F8.641E919@gredos.cnb.uam.es>, Federico Abascal says...
> Hello, could anybody tell me how to distribute code in different files?
use or require
> And if the program speed slows doing that.
depends on how big and complex your code is in them
> I don't want to loose hours looking at perl-documentation
You could have learned this in about 10.2 seconds. Which is much shorter
than the time it took to write it, post it, me to reply to it, and you to
come and read the reply. Therefore, you have lost more time than if you
had read the docs in the first place.
> (I have read about packages but I
> want to know if is there some way to do that more C-like)
Using C always eliminates that problem.
please read about use and require.
--
Charles R. Thompson
RainCloud Studios
"That? That's no script. That's your attempt at a rather complex README
file."
------------------------------
Date: Thu, 13 May 1999 16:42:36 GMT
From: design@raincloud-studios.com (Charles R. Thompson)
Subject: Re: Download register script
Message-Id: <MPG.11a4cc54a47bd58f9896bf@news>
[ Congratulations, Marc you could be a winner! Return to
comp.lang.perl.misc to claim your prize. ]
In article <373ae9ae.4421072@news.supernews.com>, Marc says...
> I'm searching a script that's able to register file downloads.
> Something like a download counter. Password feature for admin and
> e-mail registration of new dowloaders wouldn't be bad.
If you wanted to write this in Perl, you could use authentication,
sessions, and a log analyzer. If you found this script and had
questions about the actual code, this would be a welcome place for that.
Otherwise, this question doesn't belong here.
comp.infosystems.www.authoring.cgi
--
Charles R. Thompson
RainCloud Studios
"That? That's no script. That's your attempt at a rather complex README
file."
------------------------------
Date: 13 May 1999 12:36:37 -0600
From: Eric The Read <emschwar@rmi.net>
Subject: Re: Dynamic generation of a hash
Message-Id: <xkf3e10lsui.fsf@valdemar.col.hp.com>
simon@whitestar99.demon.co.uk writes:
> I am thinking of using something like the following to generate a
> lookup hash.
What kind of lookups are we talking about? The way you're building the
hash is severely weird, and I don't think you want to do what you're
actually doing.
> My only concern is that using the eval() is inefficient
> but I can't seem to think of a better way.
Depending on what you're doing (see below), it may actually be a fairly
efficient way. You also have to think about how often this code will be
called-- it may be more efficient some other way, but you may also be
spending 80% of your time optimizing code that's only executed 5% of the
total program time.
> while(@words){
> $string = "\$hash->{".join("}{",@words)."} = $value";
> eval $string;
> shift @words;
> }
If "@words = 'a small animal'", then this will create
$hash{a}{small}{animal} = $value;
$hash{small}{animal} = $value;
$hash{animal} = $value;
When "@words = 'a large animal'", then $hash{animal} will get overwritten
by the new value. I dont' think this is what you want.
My guess is you want to create $hash{a}{small}{animal} and
$hash{a}{large}{animal}. In that case, just remove the while loop from
your code, and you'll be fine. The eval is, perhaps, not the most
efficient, but it's a pretty concise way of putting it. Don't forget to
comment what you're doing, though! It took me a few minutes to suss out
what you were actually trying.
The other possibility is that you wanted $hash{'a large animal'}, in
which case you'd use exactly that syntax.
But before we can offer concrete suggestions, you should probably explain
what you're really trying to *do* with this.
-=Eric
------------------------------
Date: Thu, 13 May 1999 11:49:11 -0400
From: "Georg Buehler" <gbuehler@ralgi.com>
Subject: Re: E-Mail from NT Via Net::SMTP
Message-Id: <7hes9u$1dp$1@nntp4.atl.mindspring.net>
What other return codes should one check, though?
For instance, how should I check to make sure that the complete message was
sent?
Or whether the server refused the message because the address was bad?
--Georg
Jaime Metcher wrote in message
<37267271.46C8A54@spider.herston.uq.edu.au>...
>
>
>kstephan wrote:
>>
>> I installed Net::SMTP via "ppm install libnet", per Yong Huang, and when
I
>> execute the script found with ActivePERL, i.e,
>
>Wow. You haven't checked a single return code. That takes guts, man.
>
>Just in case you chicken out, here's a sample:
>
>$smtp = Net::SMTP->new('smtp.xxx.com') || die "SMTP open bombed: $!";
>
>> Could the answers that I gave when I installed Net::SMTP be part of the
>> problem??
>
>I don't think so. I didn't answer any questions for my installation,
>and it works fine. But maybe the ppm thing is different.
>
>>
>> Thanks for any guidance!!
>>
>
>You're welcome.
>
>--
>Jaime Metcher
------------------------------
Date: Thu, 13 May 1999 13:34:33 -0500
From: "todd" <thirdaver@inxpress.net>
Subject: first perl project
Message-Id: <7hf666$18t$1@usenet49.supernews.com>
I need to accomplish the following.
A user logs in
access the /etc/passwd file and determine when users passwd will expire
inform user when password will expire
At this point this seems like a mountain, how do I make a first step. I know
some perl basics, its time to get my feet wet.
------------------------------
Date: Thu, 13 May 1999 12:02:57 -0400
From: "Bradley W. Langhorst" <bwlang@genome.wi.mit.edu>
Subject: Re: FLOCK When?
Message-Id: <373AF7B1.A7AC7BAF@genome.wi.mit.edu>
>
> I am newly learning Perl. I use a script to read a database file, the
> process is simple Open it, read it, close it. This should only take an
> instant.
the length of time something takes depends on server load.
> Should I use flock anywhere in this process? I currently use flock
> when rewriting to a temp db while deleting a record, and I assume this is
> all for security and the assurance of stable data integrity.
You need to lock a file you are updating if there is the possibility
(however remote) that your program or another program will be trying
to write to that file at the same time. If your program is a CGI script you
certainly need to lock the database file just before you write to it. You also
need
to handle the case that the file is already locked and wait for it to free up.
don't put your program into an infinite loop waiting for a locked file to free
up though,
make sure you time your loop out after some number attempts and report an error
message.
good luck
brad
------------------------------
Date: Thu, 13 May 1999 15:58:23 GMT
From: Amitai Schlair <amitai.schlair@usa.net>
Subject: gethostname()
Message-Id: <7hesqu$dfe$1@nnrp1.deja.com>
I'm writing a setuid, taint-checked program that logs with Sys::Syslog.
Sys::Syslog determines the name of the host using Sys::Hostname, which
doesn't work for me when called from a setuid program:
Cannot get host name of local machine at
/usr/lib/perl5/Sys/Syslog.pm line 238
Therefore, I want to determine the hostname using gethostname():
require 'syscall.ph';
my $host = "\0" x 65;
syscall(&SYS_gethostname, $host, 65);
But it dies with "Undefined subroutine &main::SYS_gethostname called".
(The &SYS_write example in perlfunc worked, of course.) What am I doing
wrong?
--
Amitai Schlair
amitai.schlair@usa.net
--== Sent via Deja.com http://www.deja.com/ ==--
---Share what you know. Learn what you don't.---
------------------------------
Date: Thu, 13 May 1999 11:01:54 -0500
From: "Reid Lee" <reid.lee@natinst.com>
Subject: Re: Getting web page programmatically
Message-Id: <926611095.449.24@news.remarQ.com>
Thanks, that works awesome.
Eric Bohlman <ebohlman@netcom.com> wrote in message
news:ebohlmanFBoGD9.rD@netcom.com...
> Reid Lee <reid.lee@natinst.com> wrote:
> : I need to be able to get the HTML from a web site through my perl
script.
> : For example, I'd like to be able to call a function like this:
>
> : $webpage = openWebPage ("http://www.natinst.com");
>
> : and $webpage would contain the HTML in it so that I could edit/display
the
> : contents of it.
>
> use LWP::Simple;
> $webpage=get('http://www.natinst.com');
>
> LWP comes with comprehensive documentation.
>
------------------------------
Date: Thu, 13 May 1999 19:48:33 +0100
From: "Mug-O-Milk" <webmaster@*nospam*mugomilk.freeserve.co.uk>
Subject: Help with CGI Script Required!
Message-Id: <7hf6ta$r0h$1@news7.svr.pol.co.uk>
Hello, I've been busy building a search engine - and its working quite well!
http://www.mugomilk.freeserve.co.uk is its URL.
Just some hints (or maybe some code(!) required to help me achieve the
following: (I've only been using Perl for three months, and I've got the
great Larry Wall "Programming Perl" book, but can't work out the following:
- Can I access Unix Shell Commands using PERL?
-- How can I "Get" other HTML documents from other HTTP servers?, do I
specify their URL in an array and treat it as a file name?
-- How can I remove words such as "THE" from an @array
and many more annoying questions
I know this cannot be done without looking at the code, but if anyone would
be interested in helping me out, I would be willing to send them the code
via e-mail (If I post it here, I know I'll be shot for spamming) :O)
Simply e-mail me:
webmaster@mugomilk.freeserve.co.uk
Thanks in Advance!
--
==
@mugomilk
Listing the Cream of the Internet - Instantly!
http://www.mugomilk.freeserve.co.uk
------------------------------
Date: Thu, 13 May 1999 18:13:43 GMT
From: pom2@dura.uchicago.edu (Paul Pomerleau)
Subject: Help with Tie and db?
Message-Id: <FBonyv.AA9@midway.uchicago.edu>
Hello.
I'm trying to modify my alias.db file quickly using perl. I can add
records but not delete them -- what should my delete statement look like?
Thanks!
#!/usr/bin/perl
use Fcntl;
use DB_File;
tie (%h, 'DB_File', '/etc/aliases.db', O_RDWR, 0604) || die $!;
foreach $i (keys %h) {
print "$i, ";
print $h{$i};
print "\n";
}
print "------------\n";
#
# This does not delete postmaster.
#
delete $h{postmaster};
foreach $i (keys %h) {
print "$i, ";
print $h{$i};
print "\n";
}
$h{postmaster} = "root";
$h{spamoza} = "fishface";
untie(%h);
--
-------------------------------------------------------------
Paul Pomerleau pom2@ccp.uchicago.edu
------------------------------
Date: Thu, 13 May 1999 14:01:46 -0400
From: "Bradley W. Langhorst" <bwlang@genome.wi.mit.edu>
Subject: Re: How can i write perl script and ouput the base directory name to my browser?
Message-Id: <373B138A.19F0EBC@genome.wi.mit.edu>
you could try system or backticks to run a pwd
------------------------------
Date: Thu, 13 May 1999 16:18:19 GMT
From: "Jalil Feghhi" <jalil@corp.home.net>
Subject: How to create a non-blocking UDP server on Win32
Message-Id: <926612299.737412@zeppelin.svr.home.net>
I am setting up a UDP server on a Win32 system and trying to make it
non-blocking so that when I go to recv call it either times out or returns
immediately (real non-blocking).
I have tried two things so far. One is to use the Timeout arg to
IO::Socket::INET->new call, which did not work (I still block on a
subsequent recv call) and also tried to use fcnl() which is not implemented
on Win32.
I dont mind using the low leve socket functions here if that is the only way
to do this.
Could anybody tell me how to do this?
Thanks,
-Jalil
------------------------------
Date: Thu, 13 May 1999 11:00:53 -0500
From: username <username@nospam.com>
Subject: http equivalent ftp commands
Message-Id: <373AF735.5CCBA0DB@nospam.com>
Hi,
I am trying to download multiple files from a http site without clicking
on all the links to the files (The files are all linked to the same http
directory). Is there any commands driven software that will allow
multiple files to be downloaded from a http site (Some software that
works like ftp which one can use the commands : mget, mput)? My OS is
Windows 95. Thanks in advance.
------------------------------
Date: Thu, 13 May 1999 11:02:03 -0500
From: username <username@nospam.com>
Subject: http equivalent ftp commands
Message-Id: <373AF77B.D03DE6D2@nospam.com>
Hi,
I am trying to download multiple files from a http site without clicking
on all the links to the files (The files are all linked to the same http
directory). Is there any commands driven software that will allow
multiple files to be downloaded from a http site (Some software that
works like ftp which one can use the commands : mget, mput)? My OS is
Windows 95. Thanks in advance.
------------------------------
Date: Thu, 13 May 1999 14:05:55 -0400
From: "Andre Arpin" <arpin@adan.kingston.net>
Subject: imbedded subroutine
Message-Id: <373b141b.0@news.cgocable.net>
I have not seen an exact definition of embedded subroutine but the following
result puzzle me.
sub a
{
my $x=shift;
print " $x\n";
b();
sub b
{
print "$x\n";
}
}
a(1);
a(2);
-------------------------output
1
1
2
1
----------------------- I was expecting
1
1
2
2
could someone explain
Thanks in advance
Andre
------------------------------
Date: Thu, 13 May 1999 13:20:17 -0400
From: "Allan M. Due" <Allan@due.net>
Subject: Re: japh tags
Message-Id: <7hf169$qp8$1@nntp9.atl.mindspring.net>
Russ Allbery wrote in message ...
:todd b smith <todd_b_smith@my-dejanews.com> writes:
:
:> well, that's all I have. We can see who has the best. I want to see one
:> where it's not obvious where the words come from.
:
:Hasn't anyone built a canonical archive of these things yet? Anyway, see
:my sig, although it's technically not quite a JAPH since that's not all it
:prints out. :)
:
:--
:#!/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
Well here is a stupid story but it is mine. When I first saw the above sig
by Russ I was just figuring out how to have Ultraedit run perl and grab the
output. I saw the sig, wondered what it did so I ran it. I ran it 5 or 6
times wondering what I was doing wrong because the stupid script just kept
appearing in the outbox (Idiot boy me). Then, like a cannon going off, it
struck me as to what was happening. I now know that these kind of programs
are sort of common but I had never seen one before and it just blew my away
and I was hooked. For whatever reason, maybe because it was so unexpected,
I became fascinated with these programs. I wrote my own lame version (see
my sig) but this one remains my favorite because it was the first. Just
felt compelled to share.
AmD
--
$email{'Allan M. Due'} = ' All@n.Due.net ';
JaPH
perl -e '$_ = q(s/(.*)/print "JaPH\nperl -e ",chr(39),"\$_ =
q(",$1,");",$1,";",chr(39),"\n"/e);s/(.*)/print "JaPH\nperl -e
",chr(39),"\$_ = (",$1,");",$1,";",chr(39),"\n"/e;'
------------------------------
Date: Thu, 13 May 1999 15:54:01 GMT
From: izzac@my-dejanews.com
Subject: libwww installation
Message-Id: <7hesin$dbk$1@nnrp1.deja.com>
I would like to use the library libwww on win NT, but I didn't find a
installation guide for NT. Anybody know where I can find it ?
in the readme file, nothing explain for winNT. It says that run
make
make test
and make install
so, what to do with this ?
thanks.
--== Sent via Deja.com http://www.deja.com/ ==--
---Share what you know. Learn what you don't.---
------------------------------
Date: Thu, 13 May 1999 12:58:06 -0500
From: "Tim Armbruster" <t-armbruster@ti.com>
Subject: Re: Logic question
Message-Id: <YsE_2.26$401.2627@dfw-service1.ext.raytheon.com>
Greg Lovitt wrote in message <373b0e8a@news.nwlink.com>...
>I am creating a time clock for our company. Part of this script needs to
>
>Maybe, there is some wonderful Modual, or lib that is out there that I have
>not yet run across, and would be most greatful if someone would point me in
>the right direction.
>
Try looking at the Date:: modules on CPAN. Like Date::Manip or Date::Calc
------------------------------
Date: Thu, 13 May 1999 15:45:50 GMT
From: cindycrawford@my-dejanews.com
Subject: Re: Looking for autoresponder script !
Message-Id: <7hes3d$cv9$1@nnrp1.deja.com>
you can find free scripts at
http://cgi-shop.com
cindy
--== Sent via Deja.com http://www.deja.com/ ==--
---Share what you know. Learn what you don't.---
------------------------------
Date: 13 May 1999 10:37:51 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: MS-HTML must die!
Message-Id: <373affdf@cs.colorado.edu>
[courtesy cc of this posting mailed to cited author]
In comp.lang.perl.misc, lr@hpl.hp.com (Larry Rosler) writes:
:Thanks for the eye-opener. I'll recheck my Fowler.
I knew about Fowler, and I use -ize in the Oxbridge-preferred
fashion (but likewise do I use -yse when called for). I left
it as -iser because the original author, whom despite all attempts
to do so I have been unable to contact, had written it that way.
I've updated the script a wee tad: just the first CR-LF line,
plus comment. There's a quick link to it from
http://language.perl.com/misc/div-www.html
--tom
--
Von Neumann: "Anyone attempting to generate random numbers by
deterministic means is, of course, living in a state of sin."
------------------------------
Date: 12 Dec 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 Dec 98)
Message-Id: <null>
Administrivia:
Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing.
]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body. Majordomo will then send you instructions on how to confirm your
]subscription. This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.
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 5653
**************************************