[12881] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 291 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Jul 29 01:07:18 1999

Date: Wed, 28 Jul 1999 22:05:10 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Wed, 28 Jul 1999     Volume: 9 Number: 291

Today's topics:
    Re: [Summary] Korn Shell or Perl? <tchrist@mox.perl.com>
    Re: Beginner needs help with a function <Tony.Irvine@env.qld.gov.au>
    Re: Beginner-friendly group as cultural adaptation? (Randal L. Schwartz)
    Re: Can anyone explain concepts of Perl Objects? (M.J.T. Guy)
    Re: Can anyone explain concepts of Perl Objects? (Damian Conway)
    Re: DBI help (Douglas Wilson)
    Re: ebcdic packed numbers <uri@sysarch.com>
    Re: ebcdic packed numbers <uri@sysarch.com>
        email text processing tools? removing duplicate "reply" <pnlasdkjfeth@hasdfenge.com>
    Re: help with vars (Abigail)
    Re: Help!! ---Database access in perl (Martien Verbruggen)
    Re: how automatic assign a name to a hash <bwalton@rochester.rr.com>
    Re: How to copy a file to another name ? (Abigail)
    Re: How to: run a DOS batch in perl/cgi? (Abigail)
    Re: How to: run a DOS batch in perl/cgi? (Abigail)
    Re: HTML - perl timeout ? (Abigail)
    Re: IEEE (NaN, Inf) <bwalton@rochester.rr.com>
    Re: more than one submit button (Abigail)
    Re: OOP question. <uri@sysarch.com>
    Re: Pass by value or pass by reference? <uri@sysarch.com>
    Re: Perl Anonymity Question (gulp!) (Martien Verbruggen)
    Re: perl fetching site requiring cookies (Abigail)
    Re: ref() return value... (Martien Verbruggen)
    Re: reg expression <uri@sysarch.com>
    Re: Standard Unix Compress (Abigail)
    Re: substitute fcntl for flock (Martien Verbruggen)
    Re: using $? in data (Abigail)
    Re: Using perl with another language? (Abigail)
    Re: Using regular expressions in $\ (Abigail)
    Re: Variable in File name problems (Abigail)
        Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: 28 Jul 1999 21:27:43 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: [Summary] Korn Shell or Perl?
Message-Id: <379fca2f@cs.colorado.edu>

In comp.lang.perl.misc, mwang@tech.cicg.ml.com (Michael Wang) writes:
:I concentrate on "Korn shell pipeline", whether other shells have 
:pipeline or not is my concern, neither is that who invented it. 

Few and far between are the uncaring and miserable scions of unknown
parentage that would be so forthcoming in their own professed ignorance
as have you been with that jactant confession so gloriously presented.

:either "local" or "yp". It can not handle a bit more 
:generalization, eg, "local", "yp", "local-then-yp", and "yp-then-local",
:as shown below in Korn Shell [since it can not be in Perl w/o the limitations
:I mentioned in the summary]. 

As surely as Perl harbors no recondite artifice so puissant as your
hypervaunted parentless shell's if/then/else marvel, a wonder heretofore
unrevealed in any programming language's paradigms previously perused, so
too shall readers of your gentle and most learned lecture surely find no
other remedy or response than that they should dutifully abase themselves
before your inimitable immolation of willful and wanton stultiloquence.

--tom
-- 
"The deadliest bullshit is odorless and transparent."
				- William Gibson


------------------------------

Date: Thu, 29 Jul 1999 13:18:10 +1000
From: Tony Irvine <Tony.Irvine@env.qld.gov.au>
Subject: Re: Beginner needs help with a function
Message-Id: <379FC7F2.F8E84DA3@env.qld.gov.au>

John Imrie wrote:
> One command method
> $string =~ s/^c+(.*)c+$/$1/;
> The Pilgrim

Better one command method
$string =~ s/(?:^c+|c+$)//g;

It is still not as fast as the two step method but it is close.  I would
still recommend using the two step because it is faster and clearer..
but if you must use a single command... :)

Benchmark results for the interested.

Benchmark: timing 1000000 iterations of MyRegEx, OneRegEx, TwoRegEx...
   MyRegEx: 10 wallclock secs ( 9.94 usr +  0.00 sys =  9.94 CPU)
  OneRegEx: 18 wallclock secs (17.54 usr +  0.00 sys = 17.54 CPU)
  TwoRegEx:  8 wallclock secs ( 8.11 usr +  0.00 sys =  8.11 CPU)


#!/usr/local/bin/perl -w

use Benchmark;

timethese (1000000 , {
   MyRegEx  => '$t = "ccfoocc" ; $t =~ s/(?:^c+|c+$)//g;',

   OneRegEx => '$t = "ccfoocc" ; $t =~ s/^c*(.*?)c*$/$1/;',

   TwoRegEx => '$t = "ccfoocc" ; $t =~ s/^c+//; $t =~ s/c+$//;'
});


Tony


------------------------------

Date: 28 Jul 1999 20:32:50 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: Beginner-friendly group as cultural adaptation?
Message-Id: <m1yag03zbx.fsf@halfdome.holdit.com>

>>>>> "Alan" == Alan Stewart <astewart@spawar.navy.mil> writes:

Alan> I believe that the regulars encourage newbies to break rules by
Alan> setting bad  examples for them. If they can burn bandwidth on non-Perl
Alan> subject, why can't the newbie waste bandwidth on something that is (in
Alan> his mind) at least relevant to Perl.

I don't believe anyone *I've* ever complained about in this newsgroup
has even spent more than 15 minutes reading the existing group.

I'm not sure what that does to your theory, but you'll have to help me
understand that a newbie that has read enough to see the off-topic
digressions has somehow managed to miss the every-three-day newbie FAQ
as well as the personally mailed FAQ.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!


------------------------------

Date: 29 Jul 1999 03:20:19 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: Can anyone explain concepts of Perl Objects?
Message-Id: <7noh9j$rgh$1@pegasus.csx.cam.ac.uk>

Anno Siegel <anno4000@lublin.zrz.tu-berlin.de> wrote:
>
>All true, but if the blessing was stuck onto the reference,
>
>$obj = bless \$a;
>$whatsit = \$a;
>
>would leave me with an unblessed $whatsit.  So the difference is
>of some semantic consequence.

Your Perl is clearly broken if it leaves $whatsit unblessed.    I suggest
you upgrade.

Or perhaps you didn't test that before posting?    :-)


Although bless() operates on a reference, the blessing is a property
of the referent rather than the reference.    So Abigail's view of
things is the correct one.


Mike Guy


------------------------------

Date: 29 Jul 1999 04:14:25 GMT
From: damian@cs.monash.edu.au (Damian Conway)
Subject: Re: Can anyone explain concepts of Perl Objects?
Message-Id: <7nokf1$qgr$1@towncrier.cc.monash.edu.au>

mjtg@cus.cam.ac.uk (M.J.T. Guy) writes:

   > Anno Siegel <anno4000@lublin.zrz.tu-berlin.de> wrote:
   > >
   > >All true, but if the blessing was stuck onto the reference,
   > >
   > >$obj = bless \$a;
   > >$whatsit = \$a;
   > >
   > >would leave me with an unblessed $whatsit.  So the difference is
   > >of some semantic consequence.

   > Your Perl is clearly broken if it leaves $whatsit unblessed. I
   > suggest you upgrade.

No upgrade required.
The variable $whatis is unblessed.
The reference stored in $whatis is unblessed.
Hence there is no sense in which $whatis is blessed.
Only the variable $a is blessed.

   > Although bless() operates on a reference, the blessing is a property
   > of the referent rather than the reference.    So Abigail's view of
   > things is the correct one.

Most definitely not.
AFAIR Abigail's view was that the reference is blessed.
It isn't.
The reference is passed to C<bless>,
but it is the referent it refers to that is actually blessed.

Damian


------------------------------

Date: Thu, 29 Jul 1999 03:47:38 GMT
From: dwilson@gtemail.net (Douglas Wilson)
Subject: Re: DBI help
Message-Id: <379dbed7.2150204@news>


And the script is what? Do you connect to the database before
every insert?  That would be an awful waste of time, resources, etc.
If that's the case, then I'd refuse to connect 23,000 times too.

On Wed, 28 Jul 1999 17:23:07 GMT, flint@tcn.net (Flint Slacker) wrote:

>I wrote a program that insert information into a mysql server using
>DBI.  I was able to insert 23081 records and then I received an error:
>
>DBI->connect failed: Can't connect to MySQL server on x.x.x.x (61) at
>Name.pm line 96
>connecting: Can't connect to MySQL server on x.x.x.x (61)
>Can't call method "prepare" without a package or object reference at
>Name.pm line 99, <FH> chunk 36.
>
>Sometimes it finishes the entire batch to insert, sometimes not.  

Cheers,
Douglas Wilson


------------------------------

Date: 29 Jul 1999 00:25:15 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: ebcdic packed numbers
Message-Id: <x7vhb4qdzo.fsf@home.sysarch.com>

>>>>> "MD" == Mark-Jason Dominus <mjd@op.net> writes:

  MD> In article <x7so68spd3.fsf@home.sysarch.com>,
  MD> Uri Guttman  <uri@sysarch.com> wrote:
  >> on a similar note, check out mjd's page on the perl of the 60's:
  >> 
  >> http://www.plover.com/~mjd/perl/perl.html#perl67

  MD> I should point out that the folks who actually know about this who
  MD> have written in over the years are in overwhelming agreement that PL/I
  MD> was *not* very much like Perl.

and i am one of those (also as one who know both languages well). but i
still find your premise amusing so i post the url sometimes.

:-)

uri


-- 
Uri Guttman  -----------------  SYStems ARCHitecture and Software Engineering
uri@sysarch.com  ---------------------------  Perl, Internet, UNIX Consulting
Have Perl, Will Travel  -----------------------------  http://www.sysarch.com
The Best Search Engine on the Net -------------  http://www.northernlight.com
"F**king Windows 98", said the general in South Park before shooting Bill.


------------------------------

Date: 29 Jul 1999 00:30:16 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: ebcdic packed numbers
Message-Id: <x7r9lsqdrb.fsf@home.sysarch.com>

>>>>> "W" == William  <bivey@teamdev.com> writes:

  W> Uri Guttman <uri@sysarch.com> wrote in article
  W> <x73dy8slud.fsf@home.sysarch.com>...

  W> There's another problem with this in that you're effectively
  W> limited to 8 digits (including sign).

my pl/1 runtime supported up to 15 decimal digits plus sign nibble. it
also had support for a moving decimal point. when adding decimals, you
had to virtually shift them to align them.

  >> you can't
  >> operate on bcd in perl directly nor can you convert it to/from an intger
  >> directly.

  W> Something of a pity since it would be nice to have a BCD option
  W> for what I have to do. (The first BASIC I ever used had BCD
  W> floating point - six whole significant digits! I hacked it to
  W> use eight as soon as I could...)

why? i think the bigint modules actual do that as they can hold infinite
accuracy and it is easiest to use a format like this (maybe a digit per
byte but i don't know their guts). most/some cheap calculators do bcd
math since they use 4 bit cpus. 

bcd has its place in computerdom, but probably not in perl as a pack format.

uri

-- 
Uri Guttman  -----------------  SYStems ARCHitecture and Software Engineering
uri@sysarch.com  ---------------------------  Perl, Internet, UNIX Consulting
Have Perl, Will Travel  -----------------------------  http://www.sysarch.com
The Best Search Engine on the Net -------------  http://www.northernlight.com
"F**king Windows 98", said the general in South Park before shooting Bill.


------------------------------

Date: Wed, 28 Jul 1999 22:41:28 -0600
From: Paul Neth <pnlasdkjfeth@hasdfenge.com>
Subject: email text processing tools? removing duplicate "reply" emails
Message-Id: <379FDB77.516B84BA@hasdfenge.com>

Hi,

I need to process historic email archives for which I could export each
email to a text file.  Every email I am processing has a unique ID (or
topic number) number in each emails subject.  I can export each email
text file into larger text files sorted by that ID number for more
cleanup, and sorting.  This file would contain several emails with all
the discussion on a certain topic ID.  I need to clean up the emails and
compact them as much as possible so I can import them into a DB
knowledge management system (for keyword indexing).  I do not need to
keep all the email headers since I will not be using them in any email
systems after processing them.

What I need is some perl? tool to delete all the duplicate emails and
replys from within the larger email text file.  This text file will
contain several emails from varying times.  Like when two people reply
back and forth several times,  this builds up lots of duplicate
messages.  The email archive area contains all the intermediate emails
and some emails to different people which dont have these "reply"
messages embedded in them.  But they all have that common ID somewhere
in them.

1) Is there some tool to batch export emails from outook97/exchange into
1 text file per email ?  Can this be done in batch mode with lots of
emails ?

2) Have you seen a perl script (or other tool) which can sort through
the emails in the text file, compacting them by deleting all duplicate
emails so you just have unique emails ?

3) Can a script re-sort the remaining unique emails in chronological
order (oldest to newest) in one large text file ?

4) Possibly remove reply arrows (e.g. >>>) ?

and other options to clean these up?

I was hoping to find something close to start with so I can customize it
further.

Thanks in advance.
Paul



------------------------------

Date: 28 Jul 1999 22:12:55 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: help with vars
Message-Id: <slrn7pvhkp.4oo.abigail@alexandra.delanet.com>

ted fiedler (tfiedler@ptd.net) wrote on MMCLVII September MCMXCIII in
<URL:news:zfMn3.31$Q8.5285@nnrp1.ptd.net>:
^^ 
^^ what am i doing wrong?  this doesnt work...


Well, there's a lot that can be improved on your program, but "this doesnt
work" is a bit vague. No, let me rephrase that. It's pointless. It's
useless. You don't tell us what you expect it to do, and you don't tell
us what it does. So, how is anyone except yourself supposed to figure
out what's wrong?

Perhaps you should just feed it more candy bars.



Abigail
-- 
perl5.004 -wMMath::BigInt -e'$^V=Math::BigInt->new(qq]$^F$^W783$[$%9889$^F47]
 .qq]$|88768$^W596577669$%$^W5$^F3364$[$^W$^F$|838747$[8889739$%$|$^F673$%$^W]
 .qq]98$^F76777$=56]);$^U=substr($]=>$|=>5)*(q.25..($^W=@^V))=>do{print+chr$^V
%$^U;$^V/=$^U}while$^V!=$^W'


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


------------------------------

Date: Thu, 29 Jul 1999 04:56:21 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Help!! ---Database access in perl
Message-Id: <V9Rn3.119$tY.9528@nsw.nnrp.telstra.net>

In article <7nncp0$4v3$1@nnrp1.deja.com>,
	andrewfase@my-deja.com writes:
> I need some help please!!

Yes?

> I am designing a site for a computer company, and they want a online
> database of all there stock

their?

> The problem is that the table has 30000+ entries!!

Yes, and?

> i was going to use Sprite to access it, but i am thinking the database
> is just to big for it.

Possibly. Sprite works with text files, and you probably don't want
those to get too big.

> Can anyone tell me what i could use??? and where to find tutorial's to
> use it (maybe MySql ???)

Any relational database manager, although that might be overkill. It
depends on the struicture and access patterns of your database. Maybe
you can do it with one of the dbm modules. Without knowing the shape
of the data and the way you want to access them, it is impossible to
make any sane recommendations. 

At least half of solving a programming problem is the definition of
the problem.

> One last thing it has to be free!!!!!

Are you working for free for that computer company? how generous.

All of the dbm implementations are free. Many relational database
systems are free. DBI is free. Sprite is free. Anything you write
yourself is free.

> Thanks in advance!!!

No problem.

> please email andrew.fase@stud.umist.ac.uk

Nope. Read here when you post here. After all, it's free.

Martien
-- 
Martien Verbruggen                  | 
Interactive Media Division          | Never hire a poor lawyer. Never buy
Commercial Dynamics Pty. Ltd.       | from a rich salesperson.
NSW, Australia                      | 


------------------------------

Date: Wed, 28 Jul 1999 23:42:19 -0400
From: Bob Walton <bwalton@rochester.rr.com>
Subject: Re: how automatic assign a name to a hash
Message-Id: <379FCD9B.57F906FF@rochester.rr.com>

> ...
> I am looking for a way to automate a nameassignment to a hash.
> The problem is this:
>
> I have an allround-cgi-script that generates different amounts of
> key-value pairs.
> I would put some of them in different hashes, but i never know how
> many
> hashes i will need. So I need a way to name the hashes in an automated
> way.
> ...

Use a hash of hashes.  See perlref.  A reference to each hash you want
to have becomes a value of hash "hashofhashes", with a key of the name
you wish to assign to that hash.  That way, you don't have to worry
about some of your hash names conflicting with the names of other hashes
in your program, and everything is kept neat and tidy in one structure.
Example:

$hashofhashes{'one'}={'a'=>1,'b'=>2};
$hashofhashes{'two'}={'c'=>3,'d'=>4};
print "$hashofhashes{'two'}->{'c'}\n";

prints:

3

 .  If you need to automatically generate keys for the outside hash, set
a scalar to a starting string, like

$key='firstkey';

and use

$hashofhashes{$key++}={'key'=>'value'};

for the first item to store in each hash, to generate keys 'firstkey',
then 'firstkez', then 'firstkfa',etc (automagical string increment
operator).



------------------------------

Date: 28 Jul 1999 22:18:32 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: How to copy a file to another name ?
Message-Id: <slrn7pvhvb.4oo.abigail@alexandra.delanet.com>

Yeong Mo/Director Hana co. (factory@factory.co.kr) wrote on MMCLVII
September MCMXCIII in <URL:news:7no1ur$dad$1@news1.kornet.net>:
,, How to copy a file to another name  in same directory ?


By using File::Copy.



Abigail
-- 
perl -MLWP::UserAgent -MHTML::TreeBuilder -MHTML::FormatText -wle'print +(
HTML::FormatText -> new -> format (HTML::TreeBuilder -> new -> parse (
LWP::UserAgent -> new -> request (HTTP::Request -> new ("GET",
"http://work.ucsd.edu:5141/cgi-bin/http_webster?isindex=perl")) -> content))
=~ /(.*\))[-\s]+Addition/s) [0]'


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


------------------------------

Date: 28 Jul 1999 22:13:57 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: How to: run a DOS batch in perl/cgi?
Message-Id: <slrn7pvhmo.4oo.abigail@alexandra.delanet.com>

Tim Nettleton (timnett@mindspring.com) wrote on MMCLVII September
MCMXCIII in <URL:news:7nmm6b$lgd$1@nntp9.atl.mindspring.net>:
`` I have need to run a batch file that requests nslookup and ping information
`` on several hosts.  I would like to have a form on a page that someone can
`` just type in the IP or domain and then the .bat file will run in the
`` CGI-BIN.  I have a unix server and a NT server.
`` 
`` Is this possible?  Can anyone reference some working code that I may learn
`` from?


Yes, but what's your Perl question?



Abigail
-- 
perl -wleprint -eqq-@{[ -eqw+ -eJust -eanother -ePerl -eHacker -e+]}-


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


------------------------------

Date: 28 Jul 1999 22:15:00 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: How to: run a DOS batch in perl/cgi?
Message-Id: <slrn7pvhok.4oo.abigail@alexandra.delanet.com>

Bart Lateur (bart.lateur@skynet.be) wrote on MMCLVII September MCMXCIII
in <URL:news:37a31487.1973345@news.skynet.be>:
[] Tim Nettleton wrote:
[] 
[] >I have need to run a batch file that requests nslookup and ping information
[] >on several hosts.  I would like to have a form on a page that someone can
[] >just type in the IP or domain and then the .bat file will run in the
[] >CGI-BIN.  I have a unix server and a NT server.
[] >
[] >Is this possible?
[] 
[] Not on Unix. :-)


What part of what he wants to do will not be possible on Unix?



Abigail
-- 
sub _'_{$_'_=~s/$a/$_/}map{$$_=$Z++}Y,a..z,A..X;*{($_::_=sprintf+q=%X==>"$A$Y".
"$b$r$T$u")=~s~0~O~g;map+_::_,U=>T=>L=>$Z;$_::_}=*_;sub _{print+/.*::(.*)/s}
*_'_=*{chr($b*$e)};*__=*{chr(1<<$e)};
_::_(r(e(k(c(a(H(__(l(r(e(P(__(r(e(h(t(o(n(a(__(t(us(J())))))))))))))))))))))))


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


------------------------------

Date: 28 Jul 1999 22:22:25 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: HTML - perl timeout ?
Message-Id: <slrn7pvi6e.4oo.abigail@alexandra.delanet.com>

Frederick Tant (frederick@belbone.be) wrote on MMCLVII September MCMXCIII
in <URL:news:379ee06d.167715281@news.skynet.be>:
:: 
:: Have I a problem with a timeout in HTML. Any solution(s) for this ?


And your Perl question is?


Abigail
-- 
sub camel (^#87=i@J&&&#]u'^^s]#'#={123{#}7890t[0.9]9@+*`"'***}A&&&}n2o}00}t324i;
h[{e **###{r{+P={**{e^^^#'#i@{r'^=^{l+{#}H***i[0.9]&@a5`"':&^;&^,*&^$43##@@####;
c}^^^&&&k}&&&}#=e*****[]}'r####'`=437*{#};::'1[0.9]2@43`"'*#==[[.{{],,,1278@#@);
print+((($llama=prototype'camel')=~y|+{#}$=^*&[0-9]i@:;`"',.| |d)&&$llama."\n");


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


------------------------------

Date: Wed, 28 Jul 1999 23:23:53 -0400
From: Bob Walton <bwalton@rochester.rr.com>
Subject: Re: IEEE (NaN, Inf)
Message-Id: <379FC949.40F61219@rochester.rr.com>

> ...
> How do I get Perl to honor/deal with such values as NaN?  For example,
> prtf gives me a warning that NaN is not numeric.

what is "prtf"?

> As it is the "missing code" in some data I am handling, it would be nice
> to be able to use printf anyway...

 ...
Try the Math::BigFloat module that should be bundled with Perl.  It supports
Inf and NaN (along with indefinite precision floating point numbers), but it
is a bit of a pain to use (no operator overloading).  There are rumors that
a "use ieee;" module may be implemented sometime in the future.  It actually
probably wouldn't be too hard to implement a module that would extend Perl's
arithmetic to include Inf and NaN, along the lines of Math::Complex.



------------------------------

Date: 28 Jul 1999 22:32:12 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: more than one submit button
Message-Id: <slrn7pvioo.4oo.abigail@alexandra.delanet.com>

boris_bass@my-deja.com (boris_bass@my-deja.com) wrote on MMCLVII
September MCMXCIII in <URL:news:7nn94r$2gm$1@nnrp1.deja.com>:
?? 
?? so what if i want to have "submit1" and "submit2" buttons call
?? "myscript1.cgi" and "myscript2.cgi" respectively? Any suggesions
?? appriciated.


Read the HTML FAQ. This is not a Perl question.



Abigail
-- 
echo "==== ======= ==== ======"|perl -pes/=/J/|perl -pes/==/us/|perl -pes/=/t/\
 |perl -pes/=/A/|perl -pes/=/n/|perl -pes/=/o/|perl -pes/==/th/|perl -pes/=/e/\
 |perl -pes/=/r/|perl -pes/=/P/|perl -pes/=/e/|perl -pes/==/rl/|perl -pes/=/H/\
 |perl -pes/=/a/|perl -pes/=/c/|perl -pes/=/k/|perl -pes/==/er/|perl -pes/=/./;


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


------------------------------

Date: 29 Jul 1999 01:02:20 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: OOP question.
Message-Id: <x7iu74qc9v.fsf@home.sysarch.com>

>>>>> "CJ" == Colin Jacobs <coljac@home.com> writes:

  CJ> Hi there, O Wise and Friendly Perl Gurus.
  CJ> Although I've used Perl for a while, I haven't done much OOP with it, so
  CJ> I'm trying to brush up. I came across an exercise that instructed me to
  CJ> create a class C that inherits from classes A and B in that order. The
  CJ> trick was, if a C object should have a particular value (in this case,
  CJ> instance variable "name" has value "blah") the order of inheritance
  CJ> should be reversed.

  CJ> It seems to me that although it's easy to check the name of a C object
  CJ> at the point at which it is instantiated or the name is modified, and
  CJ> reverse @C::ISA accordingly, this will affect all C's. What am I missing
  CJ> that lets you alter the order of inheritance of a particular object as
  CJ> opposed to the whole class? I should hope it was impossible, but knowing
  CJ> Perl and it's OOP, I wouldn't be surprised. :)

i don't think it can be done directly as you claim since the inheritance
search path @ISA is a class level variable.

but why not create 2 subclasses with the two versions of @ISA. then some
constructor (dunno which class this is in) would check the value and
bless it into the class with the desired @ISA. damian conway (author of
the forthcoming OO Perl book and reader of this group. i am cc'ing him)
would be a better person to flesh out this idea but it should work
though it sounds ugly.

uri


-- 
Uri Guttman  -----------------  SYStems ARCHitecture and Software Engineering
uri@sysarch.com  ---------------------------  Perl, Internet, UNIX Consulting
Have Perl, Will Travel  -----------------------------  http://www.sysarch.com
The Best Search Engine on the Net -------------  http://www.northernlight.com
"F**king Windows 98", said the general in South Park before shooting Bill.


------------------------------

Date: 29 Jul 1999 00:33:37 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Pass by value or pass by reference?
Message-Id: <x7oggwqdlq.fsf@home.sysarch.com>

>>>>> "N" == Neko  <tgy@chocobo.org> writes:

  N> On 28 Jul 1999 03:14:55 -0400, Uri Guttman <uri@sysarch.com> wrote:
  >>>>>>> "N" == Neko  <tgy@chocobo.org> writes:
  >> 
  N> Array and hash elements are still aliased though.  Neither aggregates nor
  N> elements are passed by value.
  >> 
  >> i seem to be wrong about arrays but hashes are passed by value as that
  >> makes no sense otherwise.
  >> 
  >> perl -le '%a=(1,2);@b=(3,4);sub{ $_++ for @_}->(%a,@b);print %a,@b'
  >> 1245

  N> I was so sure that hashes were aliased as well.  Hmm... looks like I'm
  N> confusing hashes with hash *slices*.

  N> perl -le '%a=a..h;sub{$_=uc for @_}->(@a{c,e});print %a'
  N> abcDeFgh

that makes sense since you are only passing the values from the
slice. think about passing the keys of a hash by reference. they are not
true values (perl guts SV's) so they can't be modified. if they were
modified then they would have to be rehashed. major worms there. the
slice passes only hash values and not keys. in fact there was a thread
about why the values function didn't pass by ref in a for loop. i think
this is being or is fixed in 5.6.

uri

-- 
Uri Guttman  -----------------  SYStems ARCHitecture and Software Engineering
uri@sysarch.com  ---------------------------  Perl, Internet, UNIX Consulting
Have Perl, Will Travel  -----------------------------  http://www.sysarch.com
The Best Search Engine on the Net -------------  http://www.northernlight.com
"F**king Windows 98", said the general in South Park before shooting Bill.


------------------------------

Date: Thu, 29 Jul 1999 03:11:25 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Perl Anonymity Question (gulp!)
Message-Id: <xDPn3.89$tY.7814@nsw.nnrp.telstra.net>

In article <NEGn3.38$zV1.3387@news.enterprise.net>,
	"Simmo" <SimsiREMOVETHISBIT@hotmail.com> writes:
> 
>>You could spoof any IP
>>address, but if you expect a reponse, and if you want the transactions
>>to complete, you can't use spoofing.
> 
> 
>     It's for stress testing so i dont need responses back - sounds like
> spoofing may be what i need but how do you achieve that?

<OFFTOPIC>
IP spoofing is a bad thing, and will most likely confuse your network,
and almost certainly the machines you are trying to contact. I could
explain why, but really, this is not a perl matter anymore. I don't
even believe that perl owuld be the language to do this sort of thing
in, and have never tried it in perl.

Honestly: If you don't know exactly what you are doing, I wouldn/t try
using IP spoofs.

And even if you do, your transaction with the web server would not be
the same as it would be with a real client, since a TCP/IP connection
never gets established. The three way handshake that TCP/IP requires
would just never complete, which would just fill up your system's
queue with unacknowledged connection requests, making it unavailable
to other ones. You web server would never see any of this. It all
happens at the TCP/IP layer.

I honestly don't believe that you can fool a web server into thinking
that you are on a different IP address than you really are, except
when all the IP addresses actually are tied to one of the interfaces
on your machine.

Web servers have no real knowledge of what happens at the IP level.

If you want to stress test your server, you can just use one client.
It shoudln't matter much whether there's one client host or multiples.
Otherwise you could use a few machines.

Another option:

put your machine and the webserver on a private disconnected network.
Configure your machine to listen to a number of IP addresses. Write a
client that uses those IP addresses one by one.
</OFFTOPIC

But honestly, how you do this has no real relevance to perl. 

Martien
-- 
Martien Verbruggen                  | 
Interactive Media Division          | Useful Statistic: 75% of the people
Commercial Dynamics Pty. Ltd.       | make up 3/4 of the population.
NSW, Australia                      | 


------------------------------

Date: 28 Jul 1999 23:22:12 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: perl fetching site requiring cookies
Message-Id: <slrn7pvlmm.4oo.abigail@alexandra.delanet.com>

newsmf@bigfoot.com (newsmf@bigfoot.com) wrote on MMCLVII September
MCMXCIII in <URL:news:7nnph8$dth$1@nnrp1.deja.com>:
// 
// I'm using a perl program and lwp to retrieve html pages. However,
// there are some sites like http://www.newsunlimited.co.uk/ or
// http://my.yahoo.com/ that require the user agent to accept cookies
// before they serve a page. Can perl retrieve pages from such sites?


Yes. Did you check the manual for LWP::UserAgent?



Abigail
-- 
perl -e '* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
         / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / 
         % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %;
         BEGIN {% % = ($ _ = " " => print "Just Another Perl Hacker\n")}'


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


------------------------------

Date: Thu, 29 Jul 1999 04:20:16 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: ref() return value...
Message-Id: <4EQn3.113$tY.9528@nsw.nnrp.telstra.net>

In article <7no31j$k71$1@nnrp1.deja.com>,
	bhaskaracharya@my-deja.com writes:
> hi
> 
> 
> my @array = qw ( 1 2 3);
> $ref = ref (\@array);# returns ARRAY
> 
> ##but...
> $ref = ref (\( 1, 2, 3)); ## returns SCALAR

Arrays are not lists.

# perldoc perlref
[snip]
         Note that taking a reference to an enumerated list is
         not the same as using square brackets--instead it's the
         same as creating a list of references!

             @list = (\$a, \@b, \%c);
             @list = \($a, @b, %c);      # same thing!

         As a special case, \(@foo) returns a list of references
         to the contents of @foo, not a reference to @foo itself.
         Likewise for %foo.
[snip]

> why is the ref() considering the array as in scalar context???

It creates a list of references, and returns the right-most one.

Martien
-- 
Martien Verbruggen                  | 
Interactive Media Division          | 
Commercial Dynamics Pty. Ltd.       | "Mr Kaplan. Paging Mr Kaplan..."
NSW, Australia                      | 


------------------------------

Date: 29 Jul 1999 00:51:33 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: reg expression
Message-Id: <x7lnc0qcru.fsf@home.sysarch.com>

>>>>> "SS" == Steven Smolinski <sjs@yorku.ca> writes:

  SS> Eric Bohlman <ebohlman@netcom.com> wrote:
  SS> [...an excellent post. This part is about why it is bad to let FAQ posters
  SS> go away with incorrect answers...]

  SS> =But the failures caused by the use of "street knowledge" in production 
  SS> =Perl code tend to make Perl look bad in the eyes of PWPH (People With 
  SS> =Pointy Hair) [...]

  SS> But come on, what sort of fool is writing production code in Perl,
  SS> and at the same time asking FAQs in newsgroups?  Is it *that* easy
  SS> to get a programming job nowadays?

you'd be surprised. have you seen the demands for perl growing recently?
or that some script kiddie can claim to know perl and get a job at some
little isp or cgi shop without any real experience? it happens all the
time now.

:-(

uri

-- 
Uri Guttman  -----------------  SYStems ARCHitecture and Software Engineering
uri@sysarch.com  ---------------------------  Perl, Internet, UNIX Consulting
Have Perl, Will Travel  -----------------------------  http://www.sysarch.com
The Best Search Engine on the Net -------------  http://www.northernlight.com
"F**king Windows 98", said the general in South Park before shooting Bill.


------------------------------

Date: 28 Jul 1999 23:28:18 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Standard Unix Compress
Message-Id: <slrn7pvm25.4oo.abigail@alexandra.delanet.com>

bob (bbo) wrote on MMCLVII September MCMXCIII in
<URL:news:933158660.5219.0.nnrp-07.c1ed09c6@news.demon.co.uk>:
:: Can I compress a tar archive that i have created with the tar module
:: into a .Z format which can be uncompressed by the UNIX command uncompress ?

Yes, of course.  system "compress whatever.tar";

:: Oh by the way the tar archive is being created on a NT box


Oh. Then I don't know. In fact, I don't really care either.



Abigail
-- 
Here's a nickle, go buy yourself a real OS.


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


------------------------------

Date: Thu, 29 Jul 1999 04:12:53 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: substitute fcntl for flock
Message-Id: <9xQn3.111$tY.9528@nsw.nnrp.telstra.net>

In article <379fac8b.13554035@news.demon.co.uk>,
	phil.j@btinternet.com (Phil) writes:
> My isp doesn`t support flock but does support fcntl, anyone know how
> to insert fcntl into a perl script and is it a good substitute for
> flock functions. 

Perl's builtin flock should use whatever your operating system
supports. If your OS doesn't support the flock call directly, perl
will most likely emulate it, possibly with fcntl.

# perldoc -f flock

=item flock FILEHANDLE,OPERATION

Calls flock(2), or an emulation of it, on FILEHANDLE.  Returns TRUE for
success, FALSE on failure.  Produces a fatal error if used on a machine
that doesn't implement flock(2), fcntl(2) locking, or lockf(3).  C<flock()>
is Perl's portable file locking interface, although it locks only entire
files, not records.
[snip]

If your system support fcntl, but perl's flock doesn't work, then perl
was compiled incorrectly.

You can use fcntl directly, however:

# perldoc -f fcntl
=item fcntl FILEHANDLE,FUNCTION,SCALAR

Implements the fcntl(2) function.  You'll probably have to say

    use Fcntl;
[snip]

Please, next time you have a question about functions like that, try
to find it in the perlfunc documentation first, either by reading it
directly, or by using perldoc -f.

Martien
-- 
Martien Verbruggen                  | 
Interactive Media Division          | Never hire a poor lawyer. Never buy
Commercial Dynamics Pty. Ltd.       | from a rich salesperson.
NSW, Australia                      | 


------------------------------

Date: 28 Jul 1999 23:31:16 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: using $? in data
Message-Id: <slrn7pvm7n.4oo.abigail@alexandra.delanet.com>

James Stevenson (James@linux.home) wrote on MMCLVII September MCMXCIII in
<URL:news:slrn7pucgj.8bu.James@linux.home>:
%% Hi
%% 
%% i have been trying to learn perl
%% but on of the problems i have run into is that
%% if i have a $ in the data i am handling it is treating it as a
%% var! how can i stop it doing this?


Stop using a $. ;-)


You should describe your problem in more details before one can answer it.



Abigail
-- 
package Just_another_Perl_Hacker; sub print {($_=$_[0])=~ s/_/ /g;
                                      print } sub __PACKAGE__ { &
                                      print (     __PACKAGE__)} &
                                                  __PACKAGE__
                                            (                )


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


------------------------------

Date: 28 Jul 1999 23:33:52 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Using perl with another language?
Message-Id: <slrn7pvmcj.4oo.abigail@alexandra.delanet.com>

George hart (hart@rohan.sdsu.edu) wrote on MMCLVII September MCMXCIII in
<URL:news:379EA1DD.522247E4@rohan.sdsu.edu>:
|| 
|| I am a beginning programmer who would like some advice using perl
|| combined with other languages.  Right now I have a project in C that
|| deals with some heavy text manipulation which is easy in Perl but a
|| disaster in C.   I am tempted to do a few system calls to Perl in my C
|| program but I cannot help to wonder: (1) is this considered good
|| programming?  (2) Are there serious perfomance issues?  (3) Is there a
|| standard way to intermix programming languages?


man perlcall


Abigail
-- 
perl -we '$@="\145\143\150\157\040\042\112\165\163\164\040\141\156\157\164".
             "\150\145\162\040\120\145\162\154\040\110\141\143\153\145\162".
             "\042\040\076\040\057\144\145\166\057\164\164\171";`$@`'


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


------------------------------

Date: 28 Jul 1999 23:36:49 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Using regular expressions in $\
Message-Id: <slrn7pvmi4.4oo.abigail@alexandra.delanet.com>

mgcesar@my-deja.com (mgcesar@my-deja.com) wrote on MMCLVII September
MCMXCIII in <URL:news:7nnsd0$fsi$1@nnrp1.deja.com>:
\\ Does any body know how (or if) regular expression can be used as an
\\ INPUT_RECORD_SEPERATOR ($\)?

But $\ isn't the input record separator! If you had read 'man perlvar',
you would have:
    - known the right punctuation variable.
    - known the correct spelling of 'separator'.
    - known the answer to your question.


Abigail
-- 
perl -wlpe '}$_=$.;{' file  # Count the number of lines.


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


------------------------------

Date: 28 Jul 1999 23:38:39 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Variable in File name problems
Message-Id: <slrn7pvmlh.4oo.abigail@alexandra.delanet.com>

RICHARDS  AMANDA DAWN (richara@ecf.toronto.edu) wrote on MMCLVII
September MCMXCIII in <URL:news:Pine.SGI.3.96.990728155509.11451C-100000@skule.ecf>:
** 
** $PreviousInfoPath = "~mypath/$PFcode.txt";
** 
** open(PreviousInfo, "<$PreviousInfoPath") or die "Cannot open $!";
** 	$previousProgramInfo = <PreviousInfo>;
** close PreviousInfo
** 
** This gives me a server error, but when I subsititute 10000004 for $PFcode
** (what it is supposed to be), my program works fine.


So... what's $! set to? And what's $PFcode set to?

And is that ~ doing you think it's doing?



Abigail
-- 
perl -we 'print q{print q{print q{print q{print q{print q{print q{print q{print 
               qq{Just Another Perl Hacker\n}}}}}}}}}'    |\
perl -w | perl -w | perl -w | perl -w | perl -w | perl -w | perl -w | perl -w


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


------------------------------

Date: 1 Jul 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 1 Jul 99)
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 V9 Issue 291
*************************************


home help back first fref pref prev next nref lref last post