[13059] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 469 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Aug 11 20:07:18 1999

Date: Wed, 11 Aug 1999 17:05:14 -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, 11 Aug 1999     Volume: 9 Number: 469

Today's topics:
    Re: *Yet another* Net::FTP question (Donovan Rebbechi)
    Re: Comma seperated numbers <uri@sysarch.com>
    Re: Comma seperated numbers <cassell@mail.cor.epa.gov>
    Re: hash in record (Larry Rosler)
    Re: hash in record (Larry Rosler)
    Re: hash in record (Larry Rosler)
    Re: Help with -X (Bill Moseley)
        How to count clicks to HTML link. <amonotod@netscape.net>
    Re: is our reese the author of mysql book? <cassell@mail.cor.epa.gov>
    Re: is our reese the author of mysql book? (Larry Rosler)
    Re: Making a new web page out of an existing page (Donovan Rebbechi)
    Re: Multi-Page Forms <makkulka@cisco.REMOVETHIS.com>
    Re: Multi-Page Forms (Randal L. Schwartz)
    Re: Multi-Page Forms (Bill Moseley)
    Re: Newbie: Sockets on Win32 (elephant)
    Re: NO-ONE USES PERLQT !!!!!!!!!!!!!!!!!!!!!??????????? <cassell@mail.cor.epa.gov>
    Re: Perl Novice needs advice <cassell@mail.cor.epa.gov>
    Re: Perl seems to be LAME! (Donovan Rebbechi)
    Re: perl won't complie with Berkeley DB (Donovan Rebbechi)
    Re: printf vs. sprintf: inconsistent? <uri@sysarch.com>
    Re: printf vs. sprintf: inconsistent? (Martien Verbruggen)
    Re: Problem reading forms with perl <flavell@mail.cern.ch>
    Re: reference to object method <uri@sysarch.com>
    Re: Running Scripts in Telnet (Win32) (elephant)
    Re: s/// and interpolation <uri@sysarch.com>
    Re: sed vs. grep for string manipulation? (Donovan Rebbechi)
    Re: Sesssion ID (brian d foy)
    Re: spelling of foobar (was Re: Reading the Online Docu (David H. Adler)
        Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)

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

Date: 11 Aug 1999 19:29:55 -0400
From: elflord@news.newsguy.com (Donovan Rebbechi)
Subject: Re: *Yet another* Net::FTP question
Message-Id: <slrn7r41rj.mst.elflord@panix3.panix.com>

On Tue, 03 Aug 1999 15:58:06 GMT, Richard Lawrence wrote:

>assuming that it would fail becase the server i'm testing it on doesn't
>run FTP on port 99. Well it still worked so I can only assume that I'm
>not setting the port thing correctly.
>
>Can anyone point me in the right direction for setting this and hence I
>can also then set the timeout option?

You don't need to set the port. 

If you really want to set it, most ftp servers use 21.

-- 
Donovan


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

Date: 11 Aug 1999 19:23:23 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Comma seperated numbers
Message-Id: <x7d7wt9a1g.fsf@home.sysarch.com>

>>>>> "bdf" == brian d foy <brian@pm.org> writes:

  bdf> In article <7osjve$nr4$1@nnrp1.deja.com>, Stone Cold <paulm@dirigo.com> posted:
  >> script. Here is the subroutine...think it will work?
  >> 
  >> sub commify {
  >> my $text = reverse $_[0];
  >> $text =~ s/(\d\d\d)(?=\d)(?!\d*\.)/$1,/g;
  >> return scalar reverse $text;
  >> }

  bdf> what happened when you tired it?

it called sleep(8*3600).

:-)

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, 11 Aug 1999 16:46:39 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Comma seperated numbers
Message-Id: <37B20B5F.835BE0DF@mail.cor.epa.gov>

Stone Cold wrote:
> 
> I have a CGI script outputting various numbers to a web page.  The
> numbers are coming out as follows:  $1720600  (notice there are no
> commas).
> 
> I've read a little about how to use a commify subroutine, but I'm not
> sure how to implement it.  My values are a part of an outputted html
> table and I'm not sure where to call the subroutine COMMIFY in my
> script. Here is the subroutine...think it will work?

[commify subroutine snipped]

In theory.  See below.

> So if I needed to seperate my larger numbers with commas for every 3
> numbers from the right, I would call this routine.  But where do I call
> it?  Is it before the print statement?  Is it right next to the
> variable I have setup to get me the output?

If your values are individual scalars, you can feed them
to commify just by saying:

$newval = commify($oldval);

then using $newval in your print() routine.  But that's just
one way.  Once you get it working in a simple case, try
playing with it and seeing where it works/fails.  You'll
learn a lot about Perl that way.  And experimenting is fun.
Even if your dad did tell you to stop playing with your 
food.  :-)

David
-- 
David Cassell, OAO                     cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician


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

Date: Wed, 11 Aug 1999 16:34:58 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: hash in record
Message-Id: <MPG.121ba87f352e0b82989e39@nntp.hpl.hp.com>

In article <7os8af$qp$1@pilot.njin.net> on 11 Aug 1999 12:27:59 -0400, 
David Alan Black <dblack@pilot.njin.net> says...
> gary@onegoodidea.com (Gary O'Keefe) writes:
> >A keyboard was smashed into Peter Huesser's face and out came:
> >>$rec = (
> >>  total => 10,
> >>  LOOKUP =>  { %some_table } ,
> >>);
> 
 ...
> I suspect the mistake was using () instead of {}, thus generating a
> list of four elements rather than a reference to a hash.

Your suspicion about the mistake is correct, but your terminology is 
faulty.  There is no list here, and there cannot be, because lists don't 
exist in scalar context.  What there is is a sequence of comma-separated 
expressions, the last of which is assigned as the value.

The warnings (which I clipped) show this clearly.

If there were a list, one could expect the first element to be assigned, 
not the last:

    ($rec) = (
      total => 10,
      LOOKUP =>  { %some_table } ,
    );

And the value of $rec is 'total'.

-- 
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: Wed, 11 Aug 1999 16:36:59 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: hash in record
Message-Id: <MPG.121ba8fa43d075c0989e3a@nntp.hpl.hp.com>

In article <7os537$na1@courier.xilinx.com> on 11 Aug 1999 15:32:55 GMT, 
Jeff Stampes <stampes@xilinx.com> says...
> Peter Huesser <huesser@physik.unizh.ch> wrote:
 ...
> : $rec = (
> :   total => 10,
> :   LOOKUP =>  { %some_table } ,
> : );
> 
> Assiging a list to a scalar?

No, there is no list in that statement.

-- 
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: Wed, 11 Aug 1999 16:38:49 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: hash in record
Message-Id: <MPG.121ba965de08d5be989e3b@nntp.hpl.hp.com>

In article <x3yvham9qbp.fsf@tigre.matrox.com> on Wed, 11 Aug 1999 
13:31:39 -0400, Ala Qumsieh <aqumsieh@matrox.com> says...
 ...
> $rec = (
>    total => 10,
>    LOOKUP =>  { %some_table } ,
>  );
> 
> uses parentheses which construct a list, and assign the last value (an
> anonymous copy of the %some_table hash) to $rec.

No, there is no list in that statement.  If there were, what would cause 
the *last* value to be assigned?

-- 
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: Wed, 11 Aug 1999 16:16:44 -0700
From: moseley@best.com (Bill Moseley)
Subject: Re: Help with -X
Message-Id: <MPG.121ba4374f909b899896a8@nntp1.ba.best.com>

Jason W. Storer (jstorer@okapi.uvm.edu) seems to say...
> 	if -e $file

syntax?

-- 
Bill Moseley mailto:moseley@best.com
pls note the one line sig, not counting this one.


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

Date: Wed, 11 Aug 1999 23:08:33 GMT
From: Amonotod <amonotod@netscape.net>
Subject: How to count clicks to HTML link.
Message-Id: <7osvp9$3u$1@nnrp1.deja.com>

Well, I've not been at this long, but what do you think of this?
http://www.geocities.com/SiliconValley/Circuit/8340/my_redir_solution.ht
ml

Yes, I'm sure my code is somewhat ugly, but I'm not a programmer, I'm an
OS/SysAdmin/hardware type, so please, be kind in your criticism... OK?

--
    `\|||/                     amonotod@
      (@@)                     netscape.net
  ooO_(_)_Ooo________________________________
  _____|_____|_____|_____|_____|_____|_____|_____|


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: Wed, 11 Aug 1999 16:10:59 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: is our reese the author of mysql book?
Message-Id: <37B20303.767E1D2C@mail.cor.epa.gov>

Uri Guttman wrote:
[snip]
[quote from Our Pal Matt W:]
>                Anyway, what they're trying to do looks cool, and
>                hopefully it will help correct/fix some of the bugs in my
>                code I just haven't had the time or energy to do myself
>                lately.
> 
> has he ever fixed a bug or rewritten any of his crap in years?

I think so.  Didn't he recently fix one of those Y2K bugs we were harping
about in this ng not too long ago?

>                    My programs work well enough to be used by many, I

In the sense that 'many' are too stupid to notice that things aren't
working right due to flaws in the scripts...

>                    make no assertions that they are "good" or "better

Well, that's truth in advertising, I guess.

>                    than others" and this will help patch some bugs I
>                    haven't had time to lately. Also, please follow
>                    copyrights.. re-distribution of my scripts is not
>                    allowed...

I'll remember that the next time I can't resist the evil temptation
to touch one of those scripts.  :-)

David
-- 
David Cassell, OAO                     cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician


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

Date: Wed, 11 Aug 1999 16:12:51 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: is our reese the author of mysql book?
Message-Id: <MPG.121ba34c56805796989e38@nntp.hpl.hp.com>

In article <x74si69shc.fsf@home.sysarch.com> on 11 Aug 1999 12:45:03 -
0400, Uri Guttman <uri@sysarch.com> says...
 ...
> why initialize aggregates when they don't cause warnings when using them
> uninitialized? it is just a waste of text and electrons. you can push
> onto an array or access a hash element even thought they we just
> declared with my.

You can control the semantics of scalars by initializing them or not 
(see below), but you cannot control the semantics of aggregates, so it 
is a waste of energy to try.  'my @a;' and 'my @a = ();' behave 
identically for such things as 'print scalar @a, @a;'.  But 'my $x;' and 
'my $x = "";' behave differently (under -w, of course).
  
> as for scalars, i would only initialize them as needed. if i am doing
> .= i init to ''. for math maybe to 0 if i was doing += but maybe
> not for ++ since it doesn't generate warnings on undefined values.

In the latest perl versions, warnings have been fixed to behave the same 
for all the assignment-ops (as well as ++ and --): none if 
uninitialized.  Nevertheless, I like to initialize such things to take 
care of the zero-times-through-the-loop cases without generating a 
warning when the value is used.
 
> also if you are going to assign something else to the scalar, why do a
> useless init. you sound like you do it for all scalars which is why i
> say that. it is only if you are going to use the value where it would
> generated a undefined value warning, should you init them to '' or 0.

In fact, not initializing such a variable can provoke a desirable 
warning if the expected assignment doesn't occur.  Initializing to "" or 
0 provides a defined default value (which may, of course, be what you 
want, so then do it).

-- 
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: 11 Aug 1999 19:54:50 -0400
From: elflord@news.newsguy.com (Donovan Rebbechi)
Subject: Re: Making a new web page out of an existing page
Message-Id: <slrn7r43a9.mst.elflord@panix3.panix.com>

On Wed, 11 Aug 1999 21:43:51 GMT, Eddie wrote:
>Is it possible to create a web page by "stealing" certain text
>passages from an existing web page on your web server?  I've never

Yes, it is. Perl is an excellent language for writing webpages.

-- 
Donovan


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

Date: Wed, 11 Aug 1999 16:01:02 -0700
From: Makarand Kulkarni <makkulka@cisco.REMOVETHIS.com>
Subject: Re: Multi-Page Forms
Message-Id: <37B200AE.AAABB761@cisco.REMOVETHIS.com>

[
headdog @usa.net (Wayne) wrote:
> Can someone tell me what technology (CGI, JavaScript, etc.) is used to
> make ..etc.
> Preferably, I'd like to use this in CGI, but anything will do for now. Is
> there a certain resource site that I might find cut-n-paste scripts of this
> procedure on? 
]
--
There is an excellent article by Randall Schwartz that appeared in the
WebTechniques magazine  (August 1999). The technique described uses CGI.

Follow this URL.
http://www.webtechniques.com/archives/1999/08/perl/  
OR this one 
http://www.stonehenge.com/merlyn/WebTechniques/col40.html

Hope these links help.
--


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

Date: 11 Aug 1999 16:15:18 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: Multi-Page Forms
Message-Id: <m1btcdaozd.fsf@halfdome.holdit.com>

>>>>> "headdog" == headdog  <headdog> writes:

headdog> I currently have an extremely long form that people fill out,
headdog> and are then presented with a printable form with everything
headdog> they filled out under the appropriate categories so that they
headdog> can snail mail this form in. I'm using CGI to do this. I
headdog> basically want to divide the long form up into 2 or 3
headdog> different forms so there's not so much scrolling, etc.

I just did this for my WebTechniques columns.  See column #40
at <URL:http://www.stonehenge.com/merlyn/WebTechniques/>.

And this question would have been better answered in a newsgroup
with "cgi" in the name.  Finding one will be an exercise for the reader.

print "Just another Perl hacker,"

-- 
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: Wed, 11 Aug 1999 16:14:53 -0700
From: moseley@best.com (Bill Moseley)
Subject: Re: Multi-Page Forms
Message-Id: <MPG.121ba3c45191c6659896a7@nntp1.ba.best.com>

headdog<no spam>@usa.net (Wayne) (headdog<no spam>@usa.net (Wayne)) 
seems to say...
> Can someone tell me what technology (CGI, JavaScript, etc.) is used to make
> those multi-form questioners you see around the net.

This is really a CGI newsgroup question -- until you get stuck writing 
the perl code.  There are a zillion ways to do what you want.  Learn 
about 'saving state' by either using hidden fields in your forms or 
saving a session record locally.  Or even using cookies.  Lincoln 
Stein's The Official Guide to Programming with CGI.pm has a specific 
example, too.

-- 
Bill Moseley mailto:moseley@best.com
pls note the one line sig, not counting this one.


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

Date: Thu, 12 Aug 1999 09:51:24 +1000
From: elephant@squirrelgroup.com (elephant)
Subject: Re: Newbie: Sockets on Win32
Message-Id: <MPG.121cb786df5a3036989c0f@news-server>

24 hours and 9 minutes later Chris repeats ..
>Hey all, 

<deleted>

Chris .. lamer .. go see my reply to your post yesterday entitled 
"Newbie: Looking for help/info on Sockets with Win32"

and try not to post the same question over again .. it makes people who 
help want to go back and cancel their other articles

-- 
 jason - elephant@squirrelgroup.com -


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

Date: Wed, 11 Aug 1999 16:19:04 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: NO-ONE USES PERLQT !!!!!!!!!!!!!!!!!!!!!?????????????????????????
Message-Id: <37B204E8.3AC0FC59@mail.cor.epa.gov>

Thomas M. Schmickl wrote:
[post of private email snipped]
> Thats one of the inventions that should have ne ver been made !
> 
> I am somebody who always insists on the freedom of speech
> which gets useless if nobody listens you.

No one ever said that freedom of speech is the same as the
freedom to strap people into chairs, pry their eyelids open,
and force them to listen to you while playing classical music
over and over and over.

[snip of silly middle European analogy]
Oh, it seems to me that your analogy is backward.  The 
equivalent of the 'pranger' is the usenet practice of listening
to someone and then saying rude, denigrating, and hateful things
in return.

> And even guys like hitler denied some
> part of the population the right of speech and the systematically closed
> the ears of the majority
> for the arguments of these (belived) lower human beings. The majority
> realy thought
> it had the right to first ignore them, later punish them and afterward
> kill them.
> As we all know, this should better not have happend. I am from austia, a
> land that
> was part of this regime just a few decades ago, so I am very sensible to
> all kinds
> of arrogant totalitarism and censorship.

Well thank you very much.  I happen to be Jewish, with roots
in Eastern europe and Russia, so I have plenty of deceased
relatives thanks to those practices.  I find it so charming
when someone throws nonsense like this in my face.  Don't 
expect to get replies from me anymore.  That's the
equivalent of being plonked, anyway.

> Why do you thing that some other human beeings should just be silenced in
> this (or other) newsgoup(s). ???

No one silences anybody on the net.  There's always another
alias on another ISP for any loony to use to post more
drivel.  Even some of the worst offenders in Usenet history
are still trolling newsgroups to this day.

Since I will no longer read or reply to your posts, you
may take this as my last word in this thread.

David
-- 
David Cassell, OAO                     cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician


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

Date: Wed, 11 Aug 1999 16:51:17 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Perl Novice needs advice
Message-Id: <37B20C75.32F7A3A9@mail.cor.epa.gov>

Waiman Mak wrote:
> 
> Dear all,
> Is it possible to configure my own PC as a WEB server so that I can create
> and test my own CGI/Perl scripts? I would like to move over to more
> technical WEB development, rather than just front end WEB (graphical/static
> HTML) development, but I can't do this without having a server to test
> anything on.

Yes, you can have a webserver on your own PC.  And yes, it is
a good idea when planning to develop more sophisticated web pages.

Since you're on a PC already, I'll assume you have ActiveState
Perl.  Go to the HTML Perl docs that are on your Start Menu, and
find the ActivePerl [win32] FAQ.  There are two entire sections
on webserver config and web programming.  There is all the info
you need to find a long list of available webservers for your
PC, as well as guides on getting them up, and then running with
PerlScript.

Also, learn about CGI.pm .  If it is not on your PC, get it
from ActiveState by using the ppm program [from a command
prompt].  Then you'll be able to read the extensive docs on
CGI.pm in your HTML Perl docs too.

HTH,
David
-- 
David Cassell, OAO                     cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician


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

Date: 11 Aug 1999 19:42:05 -0400
From: elflord@news.newsguy.com (Donovan Rebbechi)
Subject: Re: Perl seems to be LAME!
Message-Id: <slrn7r42ic.mst.elflord@panix3.panix.com>

On Tue, 03 Aug 1999 23:19:57 +0200, Moritz Mertinkat wrote:
>  I've got a big problem:

Do you ever.

>  I'm using a text file (~1.11 MB) with about 10000 entries
>  for searching. Now, when I just run through all the lines
>  - without even doing *anything* - it takes up to 7 seconds!

Hint: don't run through all the lines.

>  And with the search algorithm about 11 seconds!

Yes, because it's an attrocious "algorithm".

Try sorting your data and then running a search.
Another thing you could do is build a word database 
( using DB-FIle / BTREE ) and searching that.
Building the database would take a long time, but searching it 
wouldn't.

-- 
Donovan


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

Date: 11 Aug 1999 19:59:22 -0400
From: elflord@news.newsguy.com (Donovan Rebbechi)
Subject: Re: perl won't complie with Berkeley DB
Message-Id: <slrn7r43ip.mst.elflord@panix3.panix.com>

On Wed, 11 Aug 1999 14:43:12 -0700, Luke Cowell wrote:

>Checking Berkeley DB version ...
>I can't use Berkeley DB with your <db.h>.  I'll disable Berkeley DB.

So it probably doesn't like your version of DB or maybe it can't find 
the header file.

>This may or may not have anything to do with it, but when I try to use
>DB_File i get this message when I try to run it.

[ snip ]

yes, that's because you didn't build DB support into it.

-- 
Donovan


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

Date: 11 Aug 1999 19:45:36 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: printf vs. sprintf: inconsistent?
Message-Id: <x7aerx990f.fsf@home.sysarch.com>

>>>>> "MBK" == Michael B Klein <michael@kbk.org> writes:

  MBK> @array = ("%2.2f", 1);

  MBK> printf @array;
  MBK> print sprintf @array;
  MBK> print sprintf $array[0], @array[1..$#array];

  MBK> The first and last calls do what they should -- print the
  MBK> formatted string.  The second, however, simply prints the number
  MBK> of elements in @array.  Why is @array passed to printf in array
  MBK> context, but sprintf in scalar context?  Am I missing something?

this is a known thing. check deja for recent threads on it.

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, 11 Aug 1999 23:57:05 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: printf vs. sprintf: inconsistent?
Message-Id: <l5os3.85$gi1.32517@nsw.nnrp.telstra.net>

In article <7ostuo$7b0$1@autumn.news.rcn.net>,
        "Michael B. Klein" <michael@kbk.org> writes:
> I've discovered what I'll call an "understandable but inconsistent" behavior
> in Perl, involving the printf and sprintf functions.  Take the following
> code:

printf and sprinf do behave differently.

From opcode.pl:

prtf            printf                  ck_listiob      ims@    F? L
sprintf         sprintf                 ck_fun_locale   mfst@   S L

The last bit here is the argument prototype. You can see that printf
takes an optional file handle, and then a list, while sprintf takes a
mandatory scalar, and then a list. The way prototypes are implemented
in perl, that means that whatever the first argument to sprintf is, it
will be looked at in a scalar context, and for an array that means the
number of elements.

This, in my opinion, is broken behaviour, which is probably not that
easy to fix.  I believe Tom Christiansen posted a FMTEYEWTK about
prototypes a little while ago (last month or so), which explains
exactly this. You can probably find it on deja.com or so.

Martien
-- 
Martien Verbruggen                  | 
Interactive Media Division          | Begin at the beginning and go on till
Commercial Dynamics Pty. Ltd.       | you come to the end; then stop.
NSW, Australia                      | 


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

Date: Thu, 12 Aug 1999 01:33:37 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: Problem reading forms with perl
Message-Id: <Pine.HPP.3.95a.990812012831.28742B-100000@hpplus03.cern.ch>

On 11 Aug 1999, Clayton L. Scott wrote:

> You, yes you, genelong@my-deja.com. Stop writing crap like this:

You're overdoing it.

As I read it, the questioner was trying to find out what to install.

You're telling them to read the manual that's sealed into the package,
before the package has even been delivered, let alone been opened.

I guess we're all so used to seeing lamers here that we don't identify a
real problem when we see one.  But I think they've got a more useful
answer now, so I'll stop there.


(I'm almost reminded of a display unit where the packaging contained,
deep inside it and only seen after the display had been removed, a
serious warning about the possibility of back injury if the unit was not
handled in accordance with the detailed instructions given there.)



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

Date: 11 Aug 1999 19:14:10 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: reference to object method
Message-Id: <x7g11p9agt.fsf@home.sysarch.com>

>>>>> "GB" == Greg Bacon <gbacon@itsc.uah.edu> writes:

  GB> In article <7osjv5$n30$1@towncrier.cc.monash.edu.au>,
  GB> 	damian@cs.monash.edu.au (Damian Conway) writes:

  GB> : Actually, I see the existence of &can as a good reason why symbolic
  GB> : method calls *ought* to provoke use strict's wrath. Since there's a
  GB> : safe way to convert a method name to a method reference:
  GB> : 
  GB> : 	$methodref = $obj->can($methodname);
  GB> : 	$obj->$methodref();
  GB> : 
  GB> : the "unsafe" (or perhaps "unintentional") way:
  GB> : 
  GB> : 	$obj->$methodname();
  GB> : 
  GB> : ought to be flagged.

  GB> C<use strict 'methods'> anyone?  Breakage bad, progress good.

post it to p5p and put on your flame retardant pajamas.

as damian said, since can will convert a method name to a real ref,
there is no need for the implied conversion for a string.

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, 12 Aug 1999 09:16:34 +1000
From: elephant@squirrelgroup.com (elephant)
Subject: Re: Running Scripts in Telnet (Win32)
Message-Id: <MPG.121caf582cc8b000989c0e@news-server>

Kevin Kuebler writes ..
>I have ActiveState Perl (build 518) running on an NT4 (SP4) server. When I
>loaded perl, I checked the option to associate .pl with perl.exe. I can go
>to a command prompt, change to a directory with a perl script, and execute
>it by simply typing the name of the script file.
>    ex: C:\Batch\Bin>test.pl
>This will run the test.pl script - no problem. Recently I loaded the telnetd
>service from the NT4 resource kit on this server. I can now log into the
>machine with a telnet client from my workstation. However, once I log into
>the machine with telnet and try to execute a script in the same manner as
>above, it doesn't work. The script never runs and I'm returned to the
>prompt. But if I invoke the script like this:
>    C:\Batch\Bin>perl test.pl
>- it runs fine. What's going on here? Is this a problem with perl or with
>the telnet service? Any advise would be appreciated.

file associations are read into the current environment by the NT 
command interpreter cmd.exe in your first example .. this is how it 
works

the command interpreter that telnet uses clearly does not read in those 
file associations .. hence you can't use them

-- 
 jason - elephant@squirrelgroup.com -


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

Date: 11 Aug 1999 19:05:05 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: s/// and interpolation
Message-Id: <x7iu6l9avy.fsf@home.sysarch.com>

>>>>> "CC" == Christopher Conway <chris_conway@my-deja.com> writes:

  >> Does perlfaq4, "How can I expand variables in text strings?", shed any
  >> light on your situation?

  CC> No, it doesn't. The problem is the variables in the string are
  CC> local to the s/// operation, so interpolation of them must take
  CC> place within it. It seems like there ought to be a way to tell
  CC> Perl, "Interpolate this variable, then interpolate the string
  CC> it contains."

guess what, there exists a way to do that. i leave it to you to find
it. search perlre for the answer.

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: 11 Aug 1999 19:45:23 -0400
From: elflord@news.newsguy.com (Donovan Rebbechi)
Subject: Re: sed vs. grep for string manipulation?
Message-Id: <slrn7r42oi.mst.elflord@panix3.panix.com>

On Wed, 11 Aug 1999 11:06:44 GMT, Chirag Kantharia wrote:
>On Sun, 08 Aug 1999 08:34:43 GMT, donturn@my-deja.com wrote:
>|    sed -e 's/card*=/replacestring/' lookfile.txt>newfile.txt
>
>This works -
>
>    sed -e 's/card.*=/replacestring/' lookfile.txt>newfile.txt

It matches too many things.

Hint:

"card1=foo and it's also true that card2 can card3=bar" -> 

"replacestring=bar"

-- 
Donovan


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

Date: Wed, 11 Aug 1999 20:13:14 -0400
From: brian@pm.org (brian d foy)
Subject: Re: Sesssion ID
Message-Id: <brian-ya02408000R1108992013140001@news.panix.com>

In article <7osmfg$12fk$1@slrn.eurobell.net>, "Troy Knight" <flexit@flexit.eurobell.co.uk> posted:

> Okay, I want to write a login program which asks for a login name and
> password and then keeps track of which user is using the script, someone
> told me to use session id's. I have been looking on the net for ages but
> can't find info on what session id's are and how to use them. Can anyone
> help?

why not just use the username?

-- 
brian d foy                    
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
Perl Monger Hats! <URL:http://www.pm.org/clothing.shtml>


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

Date: 11 Aug 1999 19:09:53 -0400
From: dha@panix.com (David H. Adler)
Subject: Re: spelling of foobar (was Re: Reading the Online Documentation?)
Message-Id: <slrn7r40lv.d4k.dha@panix.com>

On Tue, 10 Aug 1999 16:29:05 -0400, Elaine -HFB- Ashton
<elaine@chaos.wustl.edu wrote:

>Uri Guttman wrote:
>
>> i once read great history of the term foo and its cousins including other
>> name holders from around the world. does anyone know the link?
>
>Metasyntactic variable :)
>
>http://www.netmeg.net/jargon/terms/m/metasyntactic_variable.html

And here I thought it was all Bill Holman's fault...

(Smokey Stover)++

:-)

-- 
David H. Adler - <dha@panix.com> - http://www.panix.com/~dha/
"If you want a real optimist, look up Ray Bradbury. Guy's nuts.
He actually likes people." - David Brin


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

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" from
almanac@ruby.oce.orst.edu. The real FAQ, as it appeared last in the
newsgroup, can be retrieved with the request "send perl-users FAQ" from
almanac@ruby.oce.orst.edu. 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" from
almanac@ruby.oce.orst.edu. 

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 469
*************************************


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