[10435] in Perl-Users-Digest
Perl-Users Digest, Issue: 4028 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Oct 21 00:03:22 1998
Date: Tue, 20 Oct 98 21: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, 20 Oct 1998 Volume: 8 Number: 4028
Today's topics:
Re: Boston.pm will be Quiz Kings [was] Randal's Big Day (Adam Turoff)
Re: Boston.pm will be Quiz Kings [was] Randal's Big Day <eashton@bbnplanet.com>
Changing passwords with a perl scripts... (ADAMS)
coderefs in a package - Where? <jengland@enetis.net>
Re: coderefs in a package - Where? <dgris@rand.dimensional.com>
Re: curly quick question (Tad McClellan)
File Uploading To Webpage From Browser (Robert)
Great New Site * All Free * Check it out IF you Want to (Ox TiM xO)
Re: Handling cookies in Perl for IE (Joergen W. Lang)
Re: Handling cookies in Perl for IE (Larry Hunter)
Re: help shorten one-liner (Tad McClellan)
Help: string variable $patTar in s/$patSrc/$patTar windog98@my-dejanews.com
Re: New Module: File::Finder -- OO version of File::Fin <rra@stanford.edu>
Perl as login shell? (Karsten Kreher)
Re: Perl as login shell? <jdf@pobox.com>
Re: Perl as login shell? (Michael J Gebis)
Re: Perl as login shell? <tobias@spurv.td.org.uit.no>
perl5.005_02 fails lib/anydbm.t and lib/ndbm.t tests, w gaj@austaxprac.com.au
Re: problems calling procmail <snowe@rain.org>
Re: Raleigh.pm (Raleigh, NC, USA perl mongers) has regi (Adam Turoff)
Re: Raleigh.pm (Raleigh, NC, USA perl mongers) has regi <showie@uoguelph.ca>
Re: Rounding Problem (Sam Holden)
Scotch drinkers Unite! [was] Re: Raleigh.pm (Raleigh, N <eashton@bbnplanet.com>
Re: Socket Listner (Martien Verbruggen)
Re: Socket Listner <konganda@corp.earthlink.net>
Re: Socket Listner (Martien Verbruggen)
Re: Variables in m// (Charles DeRykus)
Re: Variables in m// <avitala@macs.biu.ac.il>
Re: What are these? <avitala@macs.biu.ac.il>
Re: What are these? <dgris@rand.dimensional.com>
Re: What isn't Perl good for? <dgris@rand.dimensional.com>
Re: What isn't Perl good for? (Adam Turoff)
Re: What isn't Perl good for? (Daniel E. Macks)
Re: What isn't Perl good for? <eashton@bbnplanet.com>
Re: Where's the mailin "guru" certificate? (Adam Turoff)
Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 20 Oct 1998 21:25:27 -0400
From: ziggy@panix.com (Adam Turoff)
Subject: Re: Boston.pm will be Quiz Kings [was] Randal's Big Day in Big D
Message-Id: <70jd67$nat@panix.com>
John Porter <jdporter@min.net> wrote:
>Adam Turoff wrote:
>>
>> The world can be divided into two equal parts -
>> New York and Greater New York. Youse gotta problem wit dat?
>
>Everyone seems to be forgetting that all of North America
>should properly by called Virginia. At least, according to some
>(rather old) maps I have. :-)
Sounds like some rather crusty anglo-centric maps.
Are you ignoring the French-owned parts of North America because of
some inconvenience to the British Empire? What about New Sweden?
Z. [Yo Rocky! Wha'cha do with my cheesesteak?]
------------------------------
Date: Wed, 21 Oct 1998 03:33:02 GMT
From: Elaine -HappyFunBall- Ashton <eashton@bbnplanet.com>
Subject: Re: Boston.pm will be Quiz Kings [was] Randal's Big Day in Big D
Message-Id: <362D5367.CC99659C@bbnplanet.com>
Adam Turoff wrote:
> Sounds like some rather crusty anglo-centric maps.
>
> Are you ignoring the French-owned parts of North America because of
> some inconvenience to the British Empire? What about New Sweden?
The French are pigs. My grandfather and my own father are sick over the
'chunnel'. Puhleez. The whole entire continent was in one way or another
owned by brits. :)
/me knows the flame bait in that statement.
> Z. [Yo Rocky! Wha'cha do with my cheesesteak?]
Yo! guy! I ate it! OK?! mmmm...I had a cheesesteak fer lunch. :)
e.
After all, the cultivated person's first duty is to
always be prepared to rewrite the encyclopedia. - U. Eco -
------------------------------
Date: 21 Oct 1998 00:34:55 GMT
From: s1037989@admiral.umsl.edu (ADAMS)
Subject: Changing passwords with a perl scripts...
Message-Id: <70ja7f$aea@news.umsl.edu>
I have writtena perl script that changes users passwords when run as root, but now I would like to edit it to allow user nobody (and anybody else) to run it for use on changing passwords over the web. I read an article from TPJ, but I can't get his method to work. Can somebody tell me a better way to do this or tell me what's wrong with his. One problem is that when a user nobody 'su somebodu' and the 'passwd' runs passwd on user nobody, not somebodu. Any help would be much appreciated!
Thanks!
Stefan Adams
Net Admin
Borgia High School
------------------------------
Date: Tue, 20 Oct 1998 20:02:27 -0600
From: Justin England <jengland@enetis.net>
Subject: coderefs in a package - Where?
Message-Id: <Pine.SUN.4.02.9810201935100.20396-100000@mail.enetis.net>
I am creating a set of packages to manipulate a database of names and
address, etc.
I have read several perl OO tutorials and have a decent understanding of
what I need to do except for working with coderefs.
Here's my question, with the following:
package Customers;
sub new {
my $proto = shift;
my $class = ref($proto) || $proto;
my $self = {};
$self->{NAME} = undef;
$self->{ADDR} = undef;
bless($self, $class)
return($self);
}
sub Name {
my $self = shift;
if (@_)
{ $self->{NAME} = shift; }
return($self->{NAME}
}
1;
What I am having troubles figuring out is that I would like to make a code
reference to the Name routine so that I can access it as followed:
my $obj = Customers->new();
$obj->Name("John Doe");
or via the code ref
$obj->name("John Doe");
With the only difference being the name of the function called.
I don't know where to create the coderef though??? I want to keep the
first "sub Name" with the first letter in caps to stay consistant with
functions in my other packages. But to make it easier to initialize the
object with data from the database, I would like the all lowercase name to
point to Name.
Thanks for any insight,
Justin
------------------------------
Date: Wed, 21 Oct 1998 03:28:54 GMT
From: Daniel Grisinger <dgris@rand.dimensional.com>
Subject: Re: coderefs in a package - Where?
Message-Id: <m3ww5uy511.fsf@rand.dimensional.com>
Justin England <jengland@enetis.net> writes:
<snip>
> With the only difference being the name of the function called.
Take a look at AUTOLOAD in perlsub.
dgris
--
Daniel Grisinger dgris@perrin.dimensional.com
Supporter of grumpiness where grumpiness is due on clpm.
perl -Mre=eval -e'$_=shift;;@[=split//;;$,=qq;\n;;;print m;(.{$-}(?{$-++}));,q;;while$-<=@[;;' 'Just Another Perl Hacker'
------------------------------
Date: Tue, 20 Oct 1998 22:15:21 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: curly quick question
Message-Id: <9kjj07.9ja.ln@flash.net>
Arran Price (arranp@datamail.co.nz) wrote:
: Take the following script:
OK.
: #!/usr/local/bin/perl
A script without -w is kinda hard to take.
I'll keep reading anyway ;-)
: print "doing something";
: system("find /usr/* -name foo");
^^
^^ those aren't needed...
You really should check to see if the system() call worked:
system("find /usr -name foo") && die "find failed $!";
: Why does the print happen after the system call has finished?
Buffered I/O.
: if I change it so theres a \n in the print call then it does do it first
It's line buffered ;-)
: Doing find (does the operation) - Successful (on the same line)
^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^
That will be Hard To Do if "the operation" outputs lines... ;-)
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Wed, 21 Oct 1998 02:48:12 GMT
From: Robert@Syworks.Com (Robert)
Subject: File Uploading To Webpage From Browser
Message-Id: <70ji7l$g7q@newsops.execpc.com>
I may not be the most intelligent programmer, but I just saw something
at the following webpage that freaked me out. Go to the Sprint PCS
employment opportunity page at this link, and you'll see what I mean:
http://www.sprintpcs.com/cgi-bin/pcscontact/contact.hperl?blankform=yes&form_name=job_interest
There's a section in the on-line Job Form that says BROWSE. When you
click on it, the appropriate File Manager / Explorer / File System
Manager opens up and asks you to select your WORD FILE or RESUME to
upload. I've never seen this before.
Anyone have any ides how this is? Is this pretty simple or quite
complex? The Source code seems to link to a PERL / CGI file that is
not obtainable.
E-Mail would be appreciated, otherwise just post away.
Robert@Syworks.Com
------------------------------
Date: 21 Oct 1998 03:54:43 GMT
From: oxtimxo@aol.com (Ox TiM xO)
Subject: Great New Site * All Free * Check it out IF you Want to.
Message-Id: <19981020235443.17165.00002387@ng131.aol.com>
<A HREF="http://members.aol.com/oxtimxo/index.html">Just Click Here</A>
------------------------------
Date: Wed, 21 Oct 1998 00:59:02 +0100
From: jwl@_munged_worldmusic.de (Joergen W. Lang)
Subject: Re: Handling cookies in Perl for IE
Message-Id: <1dh812a.1sndviv1e1qzyrN@host019-210.seicom.net>
Chris Haines <chris@krisberg-haines.com> wrote:
> I am having problems being able to manipulate cookies for IE 4
> browsers.
My goodness ! You should be happy ! Being able to do that is a _gift_
You're one of the _chosen_few_ who have that ability. :-)
> Has anyone else had this problem or have any ideas of what to do?
Not many, I guess. Those who do normally use CGI.pm which is available
without prescription from your nearest CPAN. It has no known
side-effects except some addictive tendencies.
hth,
Joergen
--
To reply by email please remove _munged_ from address Thanks !
-------------------------------------------------------------------
"Everything is possible - even sometimes the impossible"
HOELDERLIN EXPRESS - "Touch the void"
------------------------------
Date: 21 Oct 1998 03:12:27 GMT
From: lhunter@acm.org (Larry Hunter)
Subject: Re: Handling cookies in Perl for IE
Message-Id: <70jjer$563$1@hiram.io.com>
In article <362CE6A9.407FBC5F@krisberg-haines.com>,
chris@krisberg-haines.com says...
>
>I am having problems being able to manipulate cookies for IE 4
>browsers. Has anyone else had this problem or have any ideas of what
to
What is happening or not happening?
MSIE4 will accept a cookie from any URL but it will not return the
cookie unless the URL ends with a '/'. If you are setting cookies
from a URL that does not end with '/', MSIE4 will not return them.
All NN and MSIE3 handle cookies from any URL.
------------------------------------------------------------------------
Larry Hunter lhunter@acm.org http://www.io.com/~lhunter/
------------------------------
Date: Tue, 20 Oct 1998 21:51:15 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: help shorten one-liner
Message-Id: <37ij07.9da.ln@flash.net>
John P. Scrimsher (john_scrimsher@ex.cv.hp.com) wrote:
: <EMBARASSED>
: Of course it won't work as written... I should have tested before posting...
: needs the ";" at the end of the open,
Surely you meant to say:
needs a:
|| die "could not open file $!"
along with a semicolon at the end.
;-)
People copy stuff posted here. Let's not get a bunch of
unchecked open() calls floating about...
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Wed, 21 Oct 1998 01:59:06 GMT
From: windog98@my-dejanews.com
Subject: Help: string variable $patTar in s/$patSrc/$patTar
Message-Id: <70jf5a$45h$1@nnrp1.dejanews.com>
I want to swap blank spaces and minus sign:
My first approach (which works) is this:
$a = "- 1000";
$a =~ s/-( +)([0-9])/\1-\2/;
print("$a\n");
#the output is:
# -1000
However, I want to use a string variable for
the target pattern.
My second approach is the following:
$a = "- 1000";
$b = "\\1-\\2";
print("$b\n");
$a =~ s/-( +)([0-9])/$b/; # use a string variable $b
print($a);
#the output is:
#\1-\2000
Why is it not working? Any kind soul to fix this?
I want to keep using the variable $b. Is it possible
to do this?
Thanks.
ling_b@hotmail.com
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
------------------------------
Date: 20 Oct 1998 20:34:46 -0700
From: Russ Allbery <rra@stanford.edu>
Subject: Re: New Module: File::Finder -- OO version of File::Find
Message-Id: <ylzpaqd1ux.fsf@windlord.stanford.edu>
John Porter <jdporter@min.net> writes:
> As a test, I ran my first cut and my new chdir-less version against /usr
> on my Sparc Solaris:
> Old way, with chdir and stat(.):
> 52 secs (32.69 usr 3.41 sys + 0.01 cusr 0.11 csys = 36.22 cpu)
> New way, w/o chdir and stat(fullpath):
> 40 secs (33.01 usr 2.43 sys + 0.04 cusr 0.07 csys = 35.55 cpu)
You're dealing with a sparsely-populated directory structure, which
admittedly *is* the common case, so your approach will probably be faster
in most circumstances. However, you will find that if you have multiple
levels along a given path that contain >1,000 directory entries (which is
often the case when doing things on a Usenet news spool), the algorithm
that File::Find uses now will be faster.
--
#!/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: Tue, 20 Oct 1998 04:34:34 GMT
From: kk@pixie.swb.de (Karsten Kreher)
Subject: Perl as login shell?
Message-Id: <F13zDM.27A@pixie.swb.de>
how can I make Perl my login shell?
In order to force myself to learn Perl I would like
to do that. However, my first tries were unsuccessful.
Can somebody please help?
--
Karsten Kreher kk@pixie.swb.de
------------------------------
Date: 21 Oct 1998 02:51:40 +0200
From: Jonathan Feinberg <jdf@pobox.com>
To: kk@pixie.swb.de (Karsten Kreher)
Subject: Re: Perl as login shell?
Message-Id: <m3pvbmybxf.fsf@joshua.panix.com>
kk@pixie.swb.de (Karsten Kreher) writes:
> In order to force myself to learn Perl I would like
> to do that. However, my first tries were unsuccessful.
Perl is not a shell. If you want to play with perl interactively, you
may use the debugger:
% perl -de 1
There have been several attempts at a Readline-enabled Perl shell
posted in this group. You should be able to find them with DejaNews.
--
Jonathan Feinberg jdf@pobox.com Sunny Brooklyn, NY
http://pobox.com/~jdf
------------------------------
Date: 21 Oct 1998 01:24:35 GMT
From: gebis@fee.ecn.purdue.edu (Michael J Gebis)
Subject: Re: Perl as login shell?
Message-Id: <70jd4j$hhu@mozo.cc.purdue.edu>
kk@pixie.swb.de (Karsten Kreher) writes:
}how can I make Perl my login shell?
}In order to force myself to learn Perl I would like
}to do that. However, my first tries were unsuccessful.
}Can somebody please help?
I don't think I can help, beyond saying, "Don't do that; it's
misguided enthusaism." Use a good shell (zsh is cool) for your login
shell, and use perl for programming. The FAQ talks about using perl
as a shell in perlfaq3, but I find it hard to believe anybody does
this in practice. (Then again, I may have a myopic view of things.
Anybody?)
Once, though, when I was brainstorming, I thought, "Wouldn't it be
cool if I took a shell like zsh and embedded perl into it, so that
perl scripts could run without starting up a new perl engine? And I
could even write some really bitchin' aliases that the shell could
have pre-compiled and ready to go. That would be cool."
In fact, I even came up with a cool name for the perl-embedded zsh:
It would be called "pez."
Now I only need to get somebody else to write it...
--
Mike Gebis gebis@ecn.purdue.edu mgebis@eternal.net
------------------------------
Date: 21 Oct 1998 04:24:14 +0200
From: Tobias Brox <tobias@spurv.td.org.uit.no>
Subject: Re: Perl as login shell?
Message-Id: <xn61zo24ppt.fsf@spurv.td.org.uit.no>
gebis@fee.ecn.purdue.edu (Michael J Gebis) writes:
> In fact, I even came up with a cool name for the perl-embedded zsh:
> It would be called "pez."
I think it would be better to start from scratch, IMHO the scripting
stuff in zsh and perl shouldn't be mixed. Make plsh instead.
Line editing, command history, "intelligent" tab completion etc. is
good stuff that's needed in plsh, but I can't see there's so much more
you'd like to transfer? Perl should be sufficient as a scripting
language - though, perhaps some different shortcuts would be an
advantage - making it easier (than in native perl) to launch other
applications, easier to do filename globbing, etc.
All the powerful stuff from the perl debugger is also an advantage.
> Now I only need to get somebody else to write it...
--
TobiX In a world without fences, who needs gates?
http://www.td.org.uit.no/~tobias/
------------------------------
Date: Wed, 21 Oct 1998 01:20:50 GMT
From: gaj@austaxprac.com.au
Subject: perl5.005_02 fails lib/anydbm.t and lib/ndbm.t tests, why?
Message-Id: <70jcti$l3$1@nnrp1.dejanews.com>
Am I the only one who is finding this behaviour? I'm using RH4.2. Perl5.004_04
runs the same tests with no failures so presumably it is using the same DB
libraries:
lib/anydbm.........FAILED at test 1
[snip]
lib/db-hash........Can't call method "STORE" on an undefined value at
lib/db-hash.t line 94.
FAILED at test 15
[snip]
lib/ndbm...........FAILED at test 1
Summary of my perl5 (5.0 patchlevel 5 subversion 2) configuration: Platform:
osname=linux, osvers=2.0.34, archname=i586-linux-thread uname='linux
tax035.austaxprac.com.au 2.0.34 #5 wed jun 17 17:51:08 est 1998 i586 unknown
' hint=recommended, useposix=true, d_sigaction=define usethreads=define
useperlio=undef d_sfio=undef Compiler: cc='cc', optimize='-O2',
gccversion=2.7.2.1 cppflags='-D_REENTRANT -Dbool=char -DHAS_BOOL
-I/usr/local/include' ccflags ='-D_REENTRANT -Dbool=char -DHAS_BOOL
-I/usr/local/include' stdchar='char', d_stdstdio=define, usevfork=false
intsize=4, longsize=4, ptrsize=4, doublesize=8 d_longlong=define,
longlongsize=8, d_longdbl=define, longdblsize=12 alignbytes=4,
usemymalloc=n, prototype=define Linker and Libraries: ld='cc', ldflags ='
-L/usr/local/lib' libpth=/usr/local/lib /lib /usr/lib libs=-lndbm -lgdbm
-ldb -ldl -lm -lpthread -lc libc=/lib/libc.so.5.3.12, so=so,
useshrplib=false, libperl=libperl.a Dynamic Linking: dlsrc=dl_dlopen.xs,
dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic' cccdlflags='-fpic',
lddlflags='-shared -L/usr/local/lib'
Characteristics of this binary (from libperl):
Built under linux
Compiled at Oct 20 1998 18:11:25
@INC:
../lib
/usr/lib/perl5/5.00502/i586-linux-thread
/usr/lib/perl5/5.00502
/usr/lib/perl5/site_perl/5.005/i586-linux-thread
/usr/lib/perl5/site_perl/5.005
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Tue, 20 Oct 1998 18:36:55 -0700
From: Nick Halloway <snowe@rain.org>
Subject: Re: problems calling procmail
Message-Id: <Pine.SUN.4.05.9810201835480.23219-100000@coyote.rain.org>
On Tue, 20 Oct 1998, Tom Phoenix wrote:
> On 19 Oct 1998, Nick Halloway wrote:
>
> > It thinks my procmail rc file is an executable. When I chmod to 644 I
> > get an error message: Permission denied. Why is it doing that?
>
> If you're having trouble with procmail, the docs, FAQs, and newsgroups
> about procmail might be able to help you. Good luck!
Nah ... I think what is happening is that opening procmail this way
requires either read or write access to the file, I just have execute
access.
------------------------------
Date: 20 Oct 1998 21:11:05 -0400
From: ziggy@panix.com (Adam Turoff)
Subject: Re: Raleigh.pm (Raleigh, NC, USA perl mongers) has registered
Message-Id: <70jcb9$m96@panix.com>
John Porter <jdporter@min.net> wrote:
>Adam Turoff wrote:
>> Whiskey is made all over the world. Malt whiskeys are made all over
>> the
>> world. But only whiskey brewed, distilled and aged in Scotland may
>> legally receive the appelation 'Scotch [Whiskey]'.
>
>Right, according to U.S. law. Is there an international law that
>covers this? And are the French signatory to it? Bet not.
I'm pretty sure it's Scottish law, and others (i.e. the US) abide by it.
As for the French, limiting their use of the adjective 'Scotch' might
hinder their ability to detonate small islands in the South Pacific,
so I would expect they wouldn't respect the convention. :-)
>> Any single malt is from Scotland.
>
>No, any single malt *Scotch* is from Scotland.
D'OH. What a cluebie error on my part. Yes, there is the odd single
malt Irish floating out there.
>Single malt means one malt. I don't think the Scottish have
>a patent on that.
Single malt may mean one malt, but the connotation I've always picked
up from it is more along the lines of 'one distillery'. True, each
distillery uses a slightly different malt. My misperception perhaps.
Z.
------------------------------
Date: 21 Oct 1998 03:01:03 GMT
From: Steve Howie <showie@uoguelph.ca>
Subject: Re: Raleigh.pm (Raleigh, NC, USA perl mongers) has registered
Message-Id: <70jipf$h2i$1@testinfo.uoguelph.ca>
Adam Turoff <ziggy@panix.com> wrote:
: John Porter <jdporter@min.net> wrote:
:>Adam Turoff wrote:
:>> Whiskey is made all over the world. Malt whiskeys are made all over
:>> the
:>> world. But only whiskey brewed, distilled and aged in Scotland may
:>> legally receive the appelation 'Scotch [Whiskey]'.
:>
:>Right, according to U.S. law. Is there an international law that
:>covers this? And are the French signatory to it? Bet not.
: I'm pretty sure it's Scottish law, and others (i.e. the US) abide by it.
: As for the French, limiting their use of the adjective 'Scotch' might
: hinder their ability to detonate small islands in the South Pacific,
: so I would expect they wouldn't respect the convention. :-)
:>> Any single malt is from Scotland.
:>
:>No, any single malt *Scotch* is from Scotland.
: D'OH. What a cluebie error on my part. Yes, there is the odd single
: malt Irish floating out there.
:>Single malt means one malt. I don't think the Scottish have
:>a patent on that.
: Single malt may mean one malt, but the connotation I've always picked
: up from it is more along the lines of 'one distillery'. True, each
: distillery uses a slightly different malt. My misperception perhaps.
Each distillery can produce one or more malts, some produce many. Many of
the malts are sold to other distilleries which make 'blended' scotches -
usually a mixture of one or more malts plus crap like grain alcohol. High
quality blended scotches have higher proportions of signle malts in them
than the swill like Johnny Walker Red.
God this is getting me thirsty. I could do with some Highland Park right
now ... yummee :)
Scotty
--
Steve Howie root@127.0.0.1
Netnews and Listserv Admin 519 824-4120 x2556
University of Guelph
"If it's not Scottish it's CRRRRAAAAAAAPPPPPP!"
------------------------------
Date: 21 Oct 1998 02:02:16 GMT
From: sholden@pgrad.cs.usyd.edu.au (Sam Holden)
Subject: Re: Rounding Problem
Message-Id: <slrn72qg58.sc1.sholden@pgrad.cs.usyd.edu.au>
On Tue, 20 Oct 1998 11:11:56 -0700, Larry Rosler <lr@hpl.hp.com> wrote:
>[Posted to comp.lang.perl.misc and a copy mailed.]
>
>In article <70i3a0$hm9$1@nntp.gulfsouth.verio.net> on Tue, 20 Oct 1998
>08:26:06 -0500, Drew <andrew.simpson@matcomcorp.com> says...
>>
<snip strange rounding behaviour...(0.325 -> 0.324)>
>> SYSTEM/VERSION INFORMATION
>> SunOS 5.5.1 Generic_103640-20 sun4u sparc SUNW,Ultra-1
>> This is perl, version 5.003 with EMBED
>> built under solaris at Oct 31 1996 10:54:50
>> + suidperl security patch
>
>There must be something "special" about this architecture.
For what it's woth here is my attempts at running this :
Script started on Wed Oct 21 11:53:00 1998
; perl -v
This is perl, version 5.002
Copyright 1987-1996, Larry Wall
Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5.0 source kit.
; uname -a
SunOS pgrad 5.5.1 Generic_103640-08 sun4u sparc SUNW,Ultra-2
; perl
$var = 0.325;
$rslt = sprintf("%.3f",$var);
print $rslt;
^D
0.325;
; perl
sub roundnum
{
my ($number, $precision) = @_;
$precision = 2 unless defined $precision;
$number = 0 unless defined $number;
my $multiplier = (10 ** $precision);
return int(($number * $multiplier) + .5) / $multiplier;
}
^D
print roundnum(0.325,3),"\n";
print roundnum(0.3249, 3) ,"\n";
0.325
0.325
; exit
script done on Wed Oct 21 11:57:06 1998
Yes yes, I know perl is old here...
--
Sam
Perl was designed to be a mess (though in the nicest of possible ways).
--Larry Wall
------------------------------
Date: Wed, 21 Oct 1998 03:29:09 GMT
From: Elaine -HappyFunBall- Ashton <eashton@bbnplanet.com>
Subject: Scotch drinkers Unite! [was] Re: Raleigh.pm (Raleigh, NC, USA perl mongers) has registered
Message-Id: <362D527E.B2B31531@bbnplanet.com>
Steve Howie wrote:
> quality blended scotches have higher proportions of signle malts in them
> than the swill like Johnny Walker Red.
Anything JW is SWILL even the Blue Label! Gack. Donut make me pour a
good highland single malt down yer throat. :) Blends need not apply.
*ptooi* I am a total snob when it comes to scotch.
> God this is getting me thirsty. I could do with some Highland Park right
> now ... yummee :)
Ack. Get you some of The Macallan 25 or Oban STAT. :)
> "If it's not Scottish it's CRRRRAAAAAAAPPPPPP!"
Being English and working with a few Scots it is KRAP!!!! with K babe :)
Join us or die not knowing the joy of a beautiful highland single malt
before dying is a crime. :) We shall intern you until you find the way
of THE SCOTCH. "I am scottish and I luv ewe!!!" heh. Single Malt is your
friend. Scotch is a beautiful thing.
e.
After all, the cultivated person's first duty is to
always be prepared to rewrite the encyclopedia. - U. Eco -
------------------------------
Date: Wed, 21 Oct 1998 00:07:10 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Socket Listner
Message-Id: <OA9X1.18$Fh4.149122@nsw.nnrp.telstra.net>
In article <70j68l$gao$1@birch.prod.itd.earthlink.net>,
"Konganda Belliappa" <konganda@corp.earthlink.net> writes:
> Is there anybody who give me programming information on "socket listeners"
> or be able to direct me in writing code to perform the operation of a
> "socket listner".
I am not sure what you nedd, but I think that you should probably read
the following documentation. It may be what you are looking for:
# perldoc perlipc
# perldoc Socket
If that is not what you are looking for, post again, but be more
precise on what you want. A 'socket listener' doesn't make much sense.
> Please send email to belli@hotmail.com. Any information
> would be greatly appreciated.
No email, sorry. Post here, read here. The email feature of my news
reader blocks immediately when it sees these requests.
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | Begin at the beginning and go on till
Commercial Dynamics Pty. Ltd. | you come to the end; then stop.
NSW, Australia |
------------------------------
Date: Tue, 20 Oct 1998 18:10:25 -0700
From: "Konganda Belliappa" <konganda@corp.earthlink.net>
Subject: Re: Socket Listner
Message-Id: <70jcd6$srk$1@birch.prod.itd.earthlink.net>
Martien,
The information you provided was useful but not sufficient. What I meant by
a "socket listener" is a program that accepts connection from other host,
screens against a valid IP address and if not valid then it closses the
connection. If it is a valid IP address then it make a duplex connection
i.e. it should be possible to read from both sockets simultaneously.
I hope the above information gives you some idea of what I am looking for.
Thank you.
Bell
Martien Verbruggen wrote in message ...
>In article <70j68l$gao$1@birch.prod.itd.earthlink.net>,
> "Konganda Belliappa" <konganda@corp.earthlink.net> writes:
>
>> Is there anybody who give me programming information on "socket
listeners"
>> or be able to direct me in writing code to perform the operation of a
>> "socket listner".
>
>I am not sure what you nedd, but I think that you should probably read
>the following documentation. It may be what you are looking for:
>
># perldoc perlipc
># perldoc Socket
>
>If that is not what you are looking for, post again, but be more
>precise on what you want. A 'socket listener' doesn't make much sense.
>
>> Please send email to belli@hotmail.com. Any information
>> would be greatly appreciated.
>
>No email, sorry. Post here, read here. The email feature of my news
>reader blocks immediately when it sees these requests.
>
>Martien
>--
>Martien Verbruggen |
>Webmaster www.tradingpost.com.au | Begin at the beginning and go on till
>Commercial Dynamics Pty. Ltd. | you come to the end; then stop.
>NSW, Australia |
------------------------------
Date: Wed, 21 Oct 1998 02:10:56 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Socket Listner
Message-Id: <QobX1.35$Fh4.232708@nsw.nnrp.telstra.net>
In article <70jcd6$srk$1@birch.prod.itd.earthlink.net>,
"Konganda Belliappa" <konganda@corp.earthlink.net> writes:
> Martien,
>
> The information you provided was useful but not sufficient. What I meant by
> a "socket listener" is a program that accepts connection from other host,
> screens against a valid IP address and if not valid then it closses the
> connection. If it is a valid IP address then it make a duplex connection
> i.e. it should be possible to read from both sockets simultaneously.
>
> I hope the above information gives you some idea of what I am looking for.
>
> Thank you.
I still am not sure in which way perlipc (section 'Sockets:
Client/Server Communication') and the Socket module documentationis
not sufficient information. It does tell you how to set up a process
that listens on a socket, it also tells you how to check the
information. Multiplexing connections is probably also covered in
that, but I am not sure.
If you are looking for ready made code to do what you want, you
probably are out of luck, but there are some modules that will
probably provide you with a framewrok on which to build your
application.
http://www.perl.com/CPAN/modules/00modlist.long.html
Section 16: Server and Daemon Utilities
[snip]
Server::Inet::
::Functions cdpf Utility functions for Inet socket handling JACKS
::Object cupO Basic Inet object JACKS
::TcpClientObj cupO A TCP client (connected) object JACKS
::TcpMasterObj cupO A TCP master (listening) object JACKS
::UdpObj cupO A UDP object JACKS
[snip]
HTH,
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | Little girls, like butterflies, need no
Commercial Dynamics Pty. Ltd. | excuse - Lazarus Long
NSW, Australia |
------------------------------
Date: Tue, 20 Oct 1998 22:07:06 GMT
From: ced@bcstec.ca.boeing.com (Charles DeRykus)
Subject: Re: Variables in m//
Message-Id: <F15C3u.D89@news.boeing.com>
In article <Pine.SOL.3.96.981017230655.26026A-100000@neptune.phys.ufl.edu>,
Daniel F. Crisman <dfc@phys.ufl.edu> wrote:
>Is there any way to tell m// (or s///) to ignore the special regex values
>of characers in variables.
>
>As an example I would like $b to match to $a in this code:
>############
>$a = 'o+o';
>$b = $a;
>$b =~ /$a/;
> # This last line returns false
>############
>
>and this code:
>############
>$a = 'o$o';
>$b = $a;
>$b =~ /$a/;
> # This last line returns false
>###########
>
>So, I want perl to ignore that there are special regex characters in
>variables, how do I do it?
quote the regex's metacharacters,
$a = 'o+o';
$b = $a;
$a = quotemeta $a; # or: $a = "\Q$a";
perldoc perlre, or perldoc -f quotemeta for details.
hth,
--
Charles DeRykus
------------------------------
Date: Tue, 20 Oct 1998 13:50:57 +0200
From: "Avshi Avital" <avitala@macs.biu.ac.il>
Subject: Re: Variables in m//
Message-Id: <70htim$mek$1@cnn.cc.biu.ac.il>
>$a = 'o+o';
>$b = $a;
>$b =~ /$a/;
> # This last line returns false
>############
>
>and this code:
>############
>$a = 'o$o';
>$b = $a;
>$b =~ /$a/;
> # This last line returns false
>###########
>
>So, I want perl to ignore that there are special regex characters in
>variables, how do I do it?
oh, so simple....
$a = 'o+o';
$b = $a;
if ( $b =~ /\Q$a\E/ ) {
print "true!"
} else {
print "false!";
}
Avshalom Avital
Information Retrieval Laboratory
Bar-Ilan University, Israel
avitala@macs.biu.ac.il
------------------------------
Date: Tue, 20 Oct 1998 13:42:27 +0200
From: "Avshi Avital" <avitala@macs.biu.ac.il>
Subject: Re: What are these?
Message-Id: <70ht2n$ifm$1@cnn.cc.biu.ac.il>
Abdallah Ally wrote in message <36272BF6.7C47DDCC@ia.pw.edu.pl>...
>What are these foo,qw and how should I use command shift
perhaps it's best to view it this way:
let @list be a list.
the following actions are psbl:
push($list, $val) - insert a value at the end of the list.
$foo = pop($list, $val) - take out a value from the end of the list
and asign it to $foo.
shift($list, $val) - insert a value at the beginning of the list.
$foo = unshift($list, $val) - take out a value from the beginnig of
the list and asign it to $foo.
[;-)
Avshalom Avital
Information Retrieval Laboratory
Bar-Ilan University, Israel
avitala@macs.biu.ac.il
------------------------------
Date: Wed, 21 Oct 1998 03:11:52 GMT
From: Daniel Grisinger <dgris@rand.dimensional.com>
Subject: Re: What are these?
Message-Id: <m31zo2zkdx.fsf@rand.dimensional.com>
"Avshi Avital" <avitala@macs.biu.ac.il> writes:
> perhaps it's best to view it this way:
> let @list be a list.
No, don't. @list is an array, which is merely one type of
list in perl. Thinking that array == list will do nothing
but cause problems for you down the road.
> the following actions are psbl:
> push($list, $val) - insert a value at the end of the list.
^^^^^
This needs to be @list. You'll catch a fatal error from using
something other than an array as the first argument to push.
> $foo = pop($list, $val) - take out a value from the end of the list
> and asign it to $foo.
First, this has the same problem as above, pop requires an
array as its argument. It also only takes a single argument,
not a list (this is part of the difference between lists and
arrays).
> shift($list, $val) - insert a value at the beginning of the list.
Same problems as each of the above. You must use an array as the
argument to shift and you can only shift a single array at a time.
But, even worse than that, your description is utterly wrong. shift
does not insert a value at the front of the list, it removes the first
value in the list and returns it.
> $foo = unshift($list, $val) - take out a value from the beginnig of
> the list and asign it to $foo.
unshift works in the way that you described for shift, and it does
take a list as its second argument. You still have the problem that
it requires an array as its first argument, though.
dgris
--
Daniel Grisinger dgris@perrin.dimensional.com
Supporter of grumpiness where grumpiness is due on clpm.
perl -Mre=eval -e'$_=shift;;@[=split//;;$,=qq;\n;;;print m;(.{$-}(?{$-++}));,q;;while$-<=@[;;' 'Just Another Perl Hacker'
------------------------------
Date: Wed, 21 Oct 1998 00:52:58 GMT
From: Daniel Grisinger <dgris@rand.dimensional.com>
Subject: Re: What isn't Perl good for?
Message-Id: <m390iazqte.fsf@rand.dimensional.com>
Uri Guttman <uri@camel.fastserv.com> writes:
< snip long discussion of using perl to make coffee (btw, what
is it about food and drink in this group lately? something in
the water, maybe?) >
> stop drinking coffee!
>
> i never touch the stuff! (i don't like the flavor)
What a sad, sad life it must be without coffee.
:-)
dgris
--
Daniel Grisinger dgris@perrin.dimensional.com
Supporter of grumpiness where grumpiness is due on clpm.
perl -Mre=eval -e'$_=shift;;@[=split//;;$,=qq;\n;;;print m;(.{$-}(?{$-++}));,q;;while$-<=@[;;' 'Just Another Perl Hacker'
------------------------------
Date: 20 Oct 1998 21:15:28 -0400
From: ziggy@panix.com (Adam Turoff)
Subject: Re: What isn't Perl good for?
Message-Id: <70jcjg$mj2@panix.com>
Uri Guttman <uri@camel.fastserv.com> wrote:
>stop drinking coffee!
Whatchutalkin'boutUri?
>i never touch the stuff! (i don't like the flavor)
How about the flavored coffees? Hazelnut? Vanilla Almond? Perl?
Z.
------------------------------
Date: 21 Oct 1998 01:59:24 GMT
From: dmacks@sas.upenn.edu (Daniel E. Macks)
Subject: Re: What isn't Perl good for?
Message-Id: <70jf5s$6qt$1@netnews.upenn.edu>
Daniel Grisinger (dgris@rand.dimensional.com) said:
: Uri Guttman <uri@camel.fastserv.com> writes:
:
: < snip long discussion of using perl to make coffee (btw, what
: is it about food and drink in this group lately? something in
: the water, maybe?) >
:
: > stop drinking coffee!
: >
: > i never touch the stuff! (i don't like the flavor)
:
: What a sad, sad life it must be without coffee.
Nonsense! Think what a peaceful life one would lead, still being
alseep since about the second week of college.
dan
--
Daniel Macks
dmacks@a.chem.upenn.edu
dmacks@netspace.org
http://www.netspace.org/~dmacks
------------------------------
Date: Wed, 21 Oct 1998 03:58:10 GMT
From: Elaine -HappyFunBall- Ashton <eashton@bbnplanet.com>
Subject: Re: What isn't Perl good for?
Message-Id: <362D594B.A7680BFA@bbnplanet.com>
> How about the flavored coffees? Hazelnut? Vanilla Almond? Perl?
Flavoured coffees?!?!? Heathen!
e.
After all, the cultivated person's first duty is to
always be prepared to rewrite the encyclopedia. - U. Eco -
------------------------------
Date: 20 Oct 1998 21:34:29 -0400
From: ziggy@panix.com (Adam Turoff)
Subject: Re: Where's the mailin "guru" certificate?
Message-Id: <70jdn5$nmb@panix.com>
In article <362D117D.E6D50E69@cowboys.anet-dfw.com>,
Tom Turton <tturton@cowboys.anet-dfw.com> wrote:
>Hey, finally broke down (well, my company made me an offer I couldn't
>refuse!) and bought "Programming Perl", "Perl Cookbook", "Advanced Perl
>Programming", and even "Mastering Regular Expressions". Now, assuming
>I work my way through all these wonderful references, howzcome there
>isn't a mail-in card in the back of the books to get a Genuwine Perl
>Guru certificate?
Because O'Reilly doesn't issue 'Genuwine Perl Guru' certificates.
Someone else handles them transactions. If you hurry, you might
be able to get 'Certified Perl Guru' certificate #500404 or #500502!
Z.
------------------------------
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 4028
**************************************