[7326] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 951 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Aug 30 11:07:15 1997

Date: Sat, 30 Aug 97 08:00:34 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Sat, 30 Aug 1997     Volume: 8 Number: 951

Today's topics:
     >> 9 0 %  O F F << "DISCOUNTS !" software@discount-software8.com
     Re: A Complex Regex Needed (Gabor Egressy)
     Re: changing dir of parent shell <rootbeer@teleport.com>
     Re: Crash in Perl for Win32 5.003_07 (and older version <peterv@valkieser.nl>
     Does anybody know... <mike@accutekcomputers.com>
     Re: indexed Search Engine (Michael Schuerig)
     Re: Invalid Transmission error <rootbeer@teleport.com>
     Re: New to the business! <steve@mosby1.force9.net>
     Re: PERL,file locking, vipw & Solaris2.5.1 <doug@ono.tc.net>
     Re: Questions about passing by reference. <peterv@valkieser.nl>
     Re: Questions about passing by reference. <peterv@valkieser.nl>
     Re: Questions about passing by reference. <peterv@valkieser.nl>
     Re: Questions about passing by reference. <peterv@valkieser.nl>
     Re: Questions about passing by reference. <peterv@valkieser.nl>
     Re: Searching <tlawallANTISPAM@concentric.net>
     Re: Searching <rootbeer@teleport.com>
     Stripping | and carrage returns jason@pcauthority.com
     Re: Stripping | and carrage returns <rootbeer@teleport.com>
     Telnet Parameters?  Please Help! <monachus@arces.net>
     Re: Telnet Parameters?  Please Help! <Marc.Philips@tvd.be>
     Re: Win32::EventLog problem (Clay Irving)
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Sat, 30 Aug 1997 07:31:04 -0700
From: "DISCOUNTS !" software@discount-software8.com
Subject: >> 9 0 %  O F F <<
Message-Id: <300897073104@discount-software8.com>

<<<<<<<  COMPUTER SOFTWARE / HARDWARE  >>>>>>>

                            >>> UP  TO  90 % OFF <<<

                  http://www.quantcom.com/auctionfirst/





>>>><=>>>=<>>==><>==


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

Date: 30 Aug 1997 13:03:15 GMT
From: fubar@vinyl.quickweb.com (Gabor Egressy)
Subject: Re: A Complex Regex Needed
Message-Id: <5u95mk$3cq$1@flint.sentex.net>

Christopher Stetson (mentat@mail.patterndom.com) wrote:
: Hi All,

: I am trying to write a match-oriented regex that is taking a tab
: delimited set of fields as the target operand and trying to match it
: with a regex that is looking at various fields for a matchs.

: E.G.:

: Fields   | Movie Name    Actor Name    Director Name     Category
: Record 1 | Big        \t Tom Hanks  \t Penny Marshall \t Comedy

how about
($movie_name,$actor,$director,$category) = $line =~
    /[^|]+\|([^\t]+)\t([^\t]+)\t([^\t]+)\t(.+)/;

assuming that each line is read into $line.


--
And don't tell me there isn't one bit of difference between null and space,
because that's exactly how much difference there is.  :-)
        --Larry Wall in <10209@jpl-devvax.JPL.NASA.GOV>
Check out this site about the persecution of Randal Schwartz by Intel
http://www.rahul.net/jeffrey/ovs/


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

Date: Sat, 30 Aug 1997 07:28:59 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Les Schaffer <godzilla@futuris.net>
Subject: Re: changing dir of parent shell
Message-Id: <Pine.GSO.3.96.970830072832.23053D-100000@julie.teleport.com>

On 30 Aug 1997, Les Schaffer wrote:

> Subject: changing dir of parent shell
> 
> How do i get a perl script to change the directory i was just in to
> another one. 

    http://www.perl.com/CPAN/doc/FAQs/FAQ/html/perlfaq8/
          I_changed_directory_modified_m.html

Hope this helps!

-- 
Tom Phoenix           http://www.teleport.com/~rootbeer/
rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/



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

Date: Sat, 30 Aug 1997 13:22:26 +0200
From: Peter de Vroomen <peterv@valkieser.nl>
Subject: Re: Crash in Perl for Win32 5.003_07 (and older versions too)
Message-Id: <34080272.996BB4E6@valkieser.nl>

Tom Phoenix wrote:
> > I have a program written in Perl for win32 5.003_07 which crashes
> > when I try to read from a file.
> 
> Sounds like a bug! (It might be a bug in your system, though, rather
> than in Perl itself.) If it still exists in Sarathy's most recent
> port of Perl to Win32, you should file a bug report.

Well, Perl for Win32 is the Activeware port, I didn't know about another
win32 port until I read it somewhere in the newsgroup yesterday (I
normally run Perl on a Unix platform).

I downloaded the new Perl 5.004_01, and my program worked flawlessly
(except for some programming-bugs of course), so it seems it was a
problem in the Perl version 5.003. I guess it has to do something with
doing lots of array-operations and passing variables by reference.

Well, everything seems to work allright now. I guess it serves me right
for not using the newest version of Perl :-))).

Thanks for your reply,

Peter
-- 
Peter de Vroomen (e-mail: peterv@valkieser.nl), Software Engineer,
Valkieser Solutions, 's Gravelandseweg 80a, 1217 EW Hilversum,
The Netherlands, +31-(0)35-6714300, fax: +31-(0)35-6714333


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

Date: 30 Aug 1997 11:16:25 GMT
From: "Mike" <mike@accutekcomputers.com>
Subject: Does anybody know...
Message-Id: <01bcb535$f2da05c0$0500a8c0@computer5>

Does anybody know of a program which combines matt Wright's FormMail with
Spider's Credit Card Verifier program?  Both of these programs use Forms
and since you can't nest forms, it requires two separate processes. 
Customers don't want to type the same information twice.  Thank you.....

Mike



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

Date: Sat, 30 Aug 1997 16:40:06 +0200
From: uzs90z@uni-bonn.de (Michael Schuerig)
Subject: Re: indexed Search Engine
Message-Id: <19970830164006265914@rhrz-isdn3-p21.rhrz.uni-bonn.de>

Faust Gertz <faust@wwa.com> wrote:

> or you can just go to

my home page ;-) (http://www.uni-bonn.de/~uzs90z/)

And have a look at my stab add an indexing search engine.

Michael

--
Michael Schuerig                        Airtight arguments have
mailto:uzs90z@uni-bonn.de                  vacuous conclusions.
http://www.uni-bonn.de/~uzs90z/                -Amelie O. Rorty


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

Date: Sat, 30 Aug 1997 07:26:00 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Howard Haisten <bhaisten@bellsouth.net>
Subject: Re: Invalid Transmission error
Message-Id: <Pine.GSO.3.96.970830071854.23053C-100000@julie.teleport.com>

On Fri, 29 Aug 1997, Howard Haisten wrote:

> I'm new at cgi script configuration; I've looked through some "faq"
> offerings and am unable to figure out what to do about the following
> error message:
> 
> Invalid Transmission #3 received from: 32.96.65.181<br>If your 
> connection was interrupted, you must Enter the shop from the 
> beginning again.

This is bad. You'll probably have to spend hundreds of dollars on a new
transmission. Oh, wait.... :-)

You're right; this isn't a Perl message. It could be from your server, or
from your CGI script. The most likely is the script, since the message
mentions "the shop". 

> I am attempting to configure "Perlshop" on my server. Repeated rechecks
> of my configuration to the documentation/instructions is not revealing
> the source of my glitch.

This could be a problem with the network, a proxy, the server, or the
browser. You should probably see if you can duplicate the problem with a
different browser, at least. It's not likely to be the fault of either
Perl or Perlshop. But if Perlshop has a debugging mode, that may help you
to find out what's so Invalid about Transmission #3. Good luck!

-- 
Tom Phoenix           http://www.teleport.com/~rootbeer/
rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/




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

Date: Sat, 30 Aug 1997 13:03:32 +0000
From: Joe Mosby <steve@mosby1.force9.net>
To: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: New to the business!
Message-Id: <34081A22.9A40DAEF@mosby1.force9.net>

This is a multi-part message in MIME format.
--------------4038213B33CF166FA3E78927
Content-Type: multipart/alternative; boundary="------------F9F53ACE9CB4EF2F4B446F35"


--------------F9F53ACE9CB4EF2F4B446F35
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Okay,    Sorry about the vague description of what I wanted yesterday.I
shall try to give a more in-depth description and also show a couple of
ideas I had. As I said I want to add a "private message" facility to
this chat script. I have decided to use the "JDoe: The message" way of
sending a private message. To do this I was going to write something
like this. I will comment it all, even though I think it will be pretty
obvious to you all:

@Info = split(/:/, $formdata{'message'});        # Split the message on
the colon
@PrivateTest = split(/ /, $Info[0]);                  # Split the text
before thecolon
if($PrivateTest[1]) {                                       # Check to
see if there is more than one
&Normal;                                                      # word
before the colon. If there is, do the
}                                                                   #
Normal sub-routine
else {
&Private;                                                       #
Otherwise do the private
}

sub Private {
$Recieve = $Info[0];                          # The person the message
is to is before the colon
$Message = $Info[1];                         # The message is after the
colon
$Sender = "$formdata{'handle'}";       # The sender is the name the
person chose first

if($formdata{'handle'} eq "$Reciever") {                  # If the users
name eqs the $Recieve
print "($Sender whispered to you) $Message";         # scalar print the
senders name and
}
# message

elsif($formdata{'handle'} eq "$Sender") {                # If your name
eqs the
print "(You whispered to $Reciever) $Message";     # $Sender scalar.
Print who you sent
}
# The message to and you message

else
{                                                                      #
If neither of the above are true,
print "$Sender is whispering";                                  # Just
print the users name and tell

}
# the room they are talking privately
}

    Now I am pretty certain that there is more than one thing wrong with
this script. I would appreciate it if you could set me straight. I hope
the comments should help you understand what I'm trying to do, so that
you can maybe help me. Thanks for your help and time,

Joe

P.S If the above routine goes wrong when you recieve the E-Mail or
something, I have attached a file with comments and routine to this
mail. Thanks again

--------------F9F53ACE9CB4EF2F4B446F35
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit

<HTML>
Okay,&nbsp;&nbsp;&nbsp; Sorry about the vague description of what I wanted
yesterday.I shall try to give a more in-depth description and also show
a couple of ideas I had. As I said I want to add a "private message" facility
to this chat script. I have decided to use the "JDoe: The message" way
of sending a private message. To do this I was going to write something
like this. I will comment it all, even though I think it will be pretty
obvious to you all<B>:</B><B></B>

<P>@Info = split(/:/, $formdata{'message'});&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
# Split the message on the colon
<BR>@PrivateTest = split(/ /, $Info[0]);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
# Split the text before thecolon
<BR>if($PrivateTest[1]) {&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n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p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
# Otherwise do the private
<BR>}

<P>sub Private {
<BR>$Recieve = $Info[0];&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
# The person the message is to is before the colon
<BR>$Message = $Info[1];&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
# The message is after the colon
<BR>$Sender = "$formdata{'handle'}";&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
# The sender is the name the person chose first

<P>if($formdata{'handle'} eq "$Reciever") {&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
# If the users name eqs the $Recieve
<BR>print "($Sender whispered to you) $Message";&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
# scalar print the senders name and
<BR>}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n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nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
# the room they are talking privately
<BR>}
<BR>&nbsp;
<BR>&nbsp;&nbsp;&nbsp; Now I am pretty certain that there is more than
one thing wrong with this script. I would appreciate it if you could set
me straight. I hope the comments should help you understand what I'm trying
to do, so that you can maybe help me. Thanks for your help and time,

<P>Joe

<P>P.S If the above routine goes wrong when you recieve the E-Mail or something,
I have attached a file with comments and routine to this mail. Thanks again</HTML>

--------------F9F53ACE9CB4EF2F4B446F35--

--------------4038213B33CF166FA3E78927
Content-Type: application/x-unknown-content-type-cgi_auto_file; name="private.cgi"
Content-Transfer-Encoding: base64
Content-Disposition: inline; filename="private.cgi"

QEluZm8gPSBzcGxpdCgvOi8sICRmb3JtZGF0YXsnbWVzc2FnZSd9KTsgICAgICAjIFNwbGl0
IHRoZSBtZXNzYWdlIG9uIHRoZSBjb2xvbg0KQFByaXZhdGVUZXN0ID0gc3BsaXQoLyAvLCAk
SW5mb1swXSk7ICAgICAgICAgICAjIFNwbGl0IHRoZSB0ZXh0IGJlZm9yZSB0aGVjb2xvbg0K
aWYoJFByaXZhdGVUZXN0WzFdKSB7ICAgICAgICAgICAgICAgICAgICAgICAgICAjIENoZWNr
IHRvIHNlZSBpZiB0aGVyZSBpcyBtb3JlIHRoYW4gb25lIA0KJk5vcm1hbDsgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAjIHdvcmQgYmVmb3JlIHRoZSBjb2xvbi4g
SWYgdGhlcmUgaXMsIGRvIHRoZQ0KfSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAjIE5vcm1hbCBzdWItcm91dGluZQ0KZWxzZSB7DQomUHJpdmF0ZTsg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICMgT3RoZXJ3aXNlIGRvIHRo
ZSBwcml2YXRlDQ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ICAgIyBJZiBuZWl0aGVyIG9mIHRoZSBh
Ym92ZSBhcmUgdHJ1ZSwNCnByaW50ICIkU2VuZGVyIGlzIHdoaXNwZXJpbmciOyAgICAgICAg
ICAgICAgICAgIyBKdXN0IHByaW50IHRoZSB1c2VycyBuYW1lIGFuZCB0ZWxsDQogIH0gICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICMgdGhlIHJvb20gdGhl
eSBhcmUgdGFsa2luZyBwcml2YXRlbHkNCn0=
--------------4038213B33CF166FA3E78927--



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

Date: 30 Aug 1997 01:02:03 -0400
From: Douglas McNaught <doug@ono.tc.net>
Subject: Re: PERL,file locking, vipw & Solaris2.5.1
Message-Id: <m24t88l0vo.fsf@ono.tc.net>

[I would have mailed you a copy, but you don't have a valid address in
the header.]

twod@not.valid writes:

> I'm trying to write a PERL script that is to update the /etc/passwd or 
> /etc/shadow file directly and am having a tad of trouble trying to replicate
> the locking mechanisms used by Solaris.
 
[...]
 
> I can't seem to find a lock file in the expected places under Solaris and I 
> can't seem to find the correct method of opening the file under PERL - I've
> tried open(), sysopen(), fnctl(), and ioctl() in various combinations and
> can't seem to crack it :(

This is the kind of thing that's very system-dependent.  Most older
Unices used /etc/ptmp as a lockfile, and took advantage of the fact
that file (or link) creations on local filesystems are atomic.  This
works, but if the program crashes, it leaves the lockfile around,
preventing anybody from changing passwords until the sysadmin notices
and removes it by hand. 

More modern systems also use a lockfile, but they use 'flock()' or
'lockf()' or 'fcntl()' advisory locking, which is cleared by the
kernel when the process terminates.  SGI's Irix, for example, uses the
file /etc/.pwd.lock, and even gives you routines (lckpwdf() and
ulckpwdf()) to control the locking. 

I just checked the one Solaris machine that I have access to, and it
looks as if that OS uses the same calls and lockfile as Irix.  Must be
a SYSVR4 thing.  You have two choices: use flock() from your Perl
script to lock the /etc/.pwd.lock file (creating it first if
necessary), or write a little XS wrapper for the lckpwd/ulckpwd calls
so you can call them from Perl.  The latter is theoretically better
(the API probably won't change even if the locking mechanism does) and
is fairly easy if you're any kind of a C programmer, but the former is
definitely simpler and should work fine unless Sun changes the locking
mechanism on you.

-Doug
-- 
sub g{my$i=index$t,$_[0];($i%5,int$i/5)}sub h{substr$t,5*$_[1]+$_[0],1}sub n{(
$_[0]+4)%5}$t='encryptabdfghjklmoqsuvwxz';$c='fxmdwbcmagnyubnyquohyhny';while(
$c=~s/(.)(.)//){($w,$x)=g$1;($y,$z)=g$2;$w==$y&&($p.=h($w,n$x).h($y,n$z))or$x==
$z&&($p.=h(n$w,$x).h(n$y,$z))or($p.=h($y,$x).h($w,$z))}$p=~y/x/ /;print$p,"\n";


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

Date: Sat, 30 Aug 1997 13:59:55 +0200
From: Peter de Vroomen <peterv@valkieser.nl>
To: Jot Powers <news@bofh.com>
Subject: Re: Questions about passing by reference.
Message-Id: <34080B3B.A755535F@valkieser.nl>

Hi Jot,

Jot Powers wrote:
> First thing you probably want to do is to go ahead and read the
> perlref (perl references) page.  Try perldoc perlref.

Well, I did this, but I got some unexpected crashes from Perl (see my
other posting in comp.lang.perl.misc). It turns out I was using a buggy
version of Perl (I know because my program crashed on both Activeware's
Perl for Win32 and Perl 5.003 on an SGI).

> >*foo = create_array;
> 
> Eek.  C-geek!  ;)

Thanks! How did you guess???

> You want $foo.  Here is my version of yours.
> 
> #!/usr/local/bin/perl -w
> use strict;
> 
> my $foo;
> 
> $foo = &create_array();
> 
> print "foo->[0]: $foo->[0]. foo->[1]: $foo->[1]\n";
> sub create_array {
>         my @ar;
> 
>         $ar[0] = 'A';
>         $ar[1] = 'B';
> 
>         return \@ar
> }
> node127% perl /tmp/test.pl
> foo->[0]: A. foo->[1]: B

Ehh? Ok, fine, it works, I can even understand it, but what are the
pro's for this kind of referencing? Does it speed up my program?

> So, no, I don't believe the * is valid, and yes, you can use a my'd
> array.

Page 117 of the Camel (yes, I do have it :-))) tells me:

( *a, *b ) = func( \@c, \@d );
etc.

So the * doesn't seem to be invalid to me, except that I _create_ the
array inside the function. The example on page 117 doesn't create
anything, but does return references the way I did in my example.

Also, the the last line of page 117 tells me 'It's a tad subtle, and
_also won't work if you're using my variables_, since only globals
(well,and locals) are in the synbol table'.

I'm a bit confused about all these 'subtleties', I guess this is a
common symptom of beginning Perl programmers :-)).

> Make the following changes:
> 
> sub print_element {
> 
>         my $bar = shift;
>         my $element = shift;
> 
>         print $bar->[$element] . "\n";
> }
> 
> print_element( $foo,1);
> 
> I think you have this off by one sort of thing.  $foo is the
> reference to the original my'd array.  You can then simply pass
> $foo as if it were a scalar, and then do the dref.

Maybe it's just better to accept the way you are referencing the
variables, just because you don't seem to have any problems with it
(which must mean other people are doing it the same way, and I don't
hear them complaining either :-))). You are right, if $foo is a variable
holding a reference, you don't have to dereference it when you are
passing them to subroutines. My C-devil keeps nagging me, however,
because I'm passing variables without making it clear in the code what
type they are, which (in the opinion of my C-devil) makes the code much
less readable to others (maybe it's even my Pascal-devil, I have one of
those too :-))).

> Try these changes.  Hope that helps.

Thanks for the long reply, it really helped me a lot putting things in
perspective and choosing the best way of using variables in Perl. You
made a lot of sense (really :-)), so I'm going to try and change my code
to use the -> operator more.

One thing though, the Camel tells me about the arrow operator on page
250, and compares different methods to each other. What it doesn't tell
me though, is what method is best. I have to admit though that when I
look at the examples, the arrow-operator makes the code less obscure,
although it hides the type of the variable, making the code less easy to
understand.

Thanks!

Peter
-- 
Peter de Vroomen (e-mail: peterv@valkieser.nl), Software Engineer,
Valkieser Solutions, 's Gravelandseweg 80a, 1217 EW Hilversum,
The Netherlands, +31-(0)35-6714300, fax: +31-(0)35-6714333


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

Date: Sat, 30 Aug 1997 14:34:20 +0200
From: Peter de Vroomen <peterv@valkieser.nl>
To: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Questions about passing by reference.
Message-Id: <3408134C.772EC88A@valkieser.nl>

Hi Tom,

Tom Phoenix wrote:
> > to the array to the caller. I don't want to create a global array,
> > and creating a 'my' array is one of the most stupid things I could
> > do,
> 
> Why would that be stupid? That's acceptable Perl, to return a
> reference to a variable which is going out of scope. The variable
> will stay around, although you can no longer reference it by name (of
> course).

Well, I presumed 'my' variables would be garbage-collected when they
went out of scope (something like automatic variables in java). I read
that local variables are just global variables in disguise, and I
presumed my-variables would be _real_ local variables. It seems I didn't
read far enough, because it turns out the big difference between local
and my variables is just the scope :-)).

> > Can I treat references in Perl as I would treat pointers in C?
> 
> No.

This seems to be the root of my problem :-))). Well, I'll just have to
accept it, things are slowly becoming clear to me. My biggest problem is
that I've become a native C-programmer over the years (well, 4 years to
be exact), and I want to know how things work at the lowest level (I
could, of course, dive into the source-code of Perl, but I'm a bit
afraid af what I'm going to see there :-))).

> > Can Perl become confused about where to allocate the memory for new
> > elements in an array passed by reference (and does this count for
> > hash-tables too)?
> 
> No, but the programmer can. :-)

<sigh>, I know all about it.

> > If I pass a variable by reference to a subroutine, and
> > this subroutine passes the same variable by reference to another
> > subroutine, will this work?
> 
> Yes.

I just have to accept that a reference is just some kind of pointer into
a symbol-table, that makes things a lot easier. Until yesterday I was
under the impression that Perl used different symbol-tables for
different kinds of variable-scopes, something like static and automatic
variables in C, where automatic variables get cleaned up when they go
out of scope. It seems Perl variables never get cleaned up (maybe they
do when Perl finds out there's no reference to them altogether). So if
you have a reference, the thing the reference points to is allways
valid.

Thanks for your answer, it's cleared a lot of things up for me (together
with the answers of others). These answers have helped me more than
reading the Camel ten times over :-)).

Peter
-- 
Peter de Vroomen (e-mail: peterv@valkieser.nl), Software Engineer,
Valkieser Solutions, 's Gravelandseweg 80a, 1217 EW Hilversum,
The Netherlands, +31-(0)35-6714300, fax: +31-(0)35-6714333


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

Date: Sat, 30 Aug 1997 14:15:00 +0200
From: Peter de Vroomen <peterv@valkieser.nl>
To: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Questions about passing by reference.
Message-Id: <34080EC4.314E00CD@valkieser.nl>

Hi Tom,

Tom Phoenix wrote:
> > to the array to the caller. I don't want to create a global array,
> > and creating a 'my' array is one of the most stupid things I could
> > do,
> 
> Why would that be stupid? That's acceptable Perl, to return a
> reference to a variable which is going out of scope. The variable
> will stay around, although you can no longer reference it by name (of
> course).

Well, I presumed 'my' variables would be garbage-collected when they
went out of scope (something like automatic variables in java). I read
that local variables are just global variables in disguise, and I
presumed my-variables would be _real_ local variables. It seems I didn't
read far enough, because it turns out the big difference between local
and my variables is just the scope :-)).

> > Can I treat references in Perl as I would treat pointers in C?
> 
> No.

This seems to be the root of my problem :-))). Well, I'll just have to
accept it, things are slowly becoming clear to me. My biggest problem is
that I've become a native C-programmer over the years (well, 4 years to
be exact), and I want to know how things work at the lowest level (I
could, of course, dive into the source-code of Perl, but I'm a bit
afraid af what I'm going to see there :-))).

> > Can Perl become confused about where to allocate the memory for new
> > elements in an array passed by reference (and does this count for
> > hash-tables too)?
> 
> No, but the programmer can. :-)

<sigh>, I know all about it.

> > If I pass a variable by reference to a subroutine, and
> > this subroutine passes the same variable by reference to another
> > subroutine, will this work?
> 
> Yes.

I just have to accept that a reference is just some kind of pointer into
a symbol-table, that makes things a lot easier. Until yesterday I was
under the impression that Perl used different symbol-tables for
different kinds of variable-scopes, something like static and automatic
variables in C, where automatic variables get cleaned up when they go
out of scope. It seems Perl variables never get cleaned up (maybe they
do when Perl finds out there's no reference to them altogether). So if
you have a reference, the thing the reference points to is allways
valid.

Thanks for your answer, it's cleared a lot of things up for me (together
with the answers of others). These answers have helped me more than
reading the Camel ten times over :-)).

Peter
-- 
Peter de Vroomen (e-mail: peterv@valkieser.nl), Software Engineer,
Valkieser Solutions, 's Gravelandseweg 80a, 1217 EW Hilversum,
The Netherlands, +31-(0)35-6714300, fax: +31-(0)35-6714333


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

Date: Sat, 30 Aug 1997 14:33:36 +0200
From: Peter de Vroomen <peterv@valkieser.nl>
To: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Questions about passing by reference.
Message-Id: <34081320.CAF3D2F5@valkieser.nl>

Hi Tom,

Tom Phoenix wrote:
> > to the array to the caller. I don't want to create a global array,
> > and creating a 'my' array is one of the most stupid things I could
> > do,
> 
> Why would that be stupid? That's acceptable Perl, to return a
> reference to a variable which is going out of scope. The variable
> will stay around, although you can no longer reference it by name (of
> course).

Well, I presumed 'my' variables would be garbage-collected when they
went out of scope (something like automatic variables in java). I read
that local variables are just global variables in disguise, and I
presumed my-variables would be _real_ local variables. It seems I didn't
read far enough, because it turns out the big difference between local
and my variables is just the scope :-)).

> > Can I treat references in Perl as I would treat pointers in C?
> 
> No.

This seems to be the root of my problem :-))). Well, I'll just have to
accept it, things are slowly becoming clear to me. My biggest problem is
that I've become a native C-programmer over the years (well, 4 years to
be exact), and I want to know how things work at the lowest level (I
could, of course, dive into the source-code of Perl, but I'm a bit
afraid af what I'm going to see there :-))).

> > Can Perl become confused about where to allocate the memory for new
> > elements in an array passed by reference (and does this count for
> > hash-tables too)?
> 
> No, but the programmer can. :-)

<sigh>, I know all about it.

> > If I pass a variable by reference to a subroutine, and
> > this subroutine passes the same variable by reference to another
> > subroutine, will this work?
> 
> Yes.

I just have to accept that a reference is just some kind of pointer into
a symbol-table, that makes things a lot easier. Until yesterday I was
under the impression that Perl used different symbol-tables for
different kinds of variable-scopes, something like static and automatic
variables in C, where automatic variables get cleaned up when they go
out of scope. It seems Perl variables never get cleaned up (maybe they
do when Perl finds out there's no reference to them altogether). So if
you have a reference, the thing the reference points to is allways
valid.

Thanks for your answer, it's cleared a lot of things up for me (together
with the answers of others). These answers have helped me more than
reading the Camel ten times over :-)).

Peter
-- 
Peter de Vroomen (e-mail: peterv@valkieser.nl), Software Engineer,
Valkieser Solutions, 's Gravelandseweg 80a, 1217 EW Hilversum,
The Netherlands, +31-(0)35-6714300, fax: +31-(0)35-6714333


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

Date: Sat, 30 Aug 1997 14:36:00 +0200
From: Peter de Vroomen <peterv@valkieser.nl>
To: rootbeer@teleport.com
Subject: Re: Questions about passing by reference.
Message-Id: <340813B0.E5AC690C@valkieser.nl>

Hi Tom,

Tom Phoenix wrote:
> > to the array to the caller. I don't want to create a global array,
> > and creating a 'my' array is one of the most stupid things I could
> > do,
> 
> Why would that be stupid? That's acceptable Perl, to return a
> reference to a variable which is going out of scope. The variable
> will stay around, although you can no longer reference it by name (of
> course).

Well, I presumed 'my' variables would be garbage-collected when they
went out of scope (something like automatic variables in java). I read
that local variables are just global variables in disguise, and I
presumed my-variables would be _real_ local variables. It seems I didn't
read far enough, because it turns out the big difference between local
and my variables is just the scope :-)).

> > Can I treat references in Perl as I would treat pointers in C?
> 
> No.

This seems to be the root of my problem :-))). Well, I'll just have to
accept it, things are slowly becoming clear to me. My biggest problem is
that I've become a native C-programmer over the years (well, 4 years to
be exact), and I want to know how things work at the lowest level (I
could, of course, dive into the source-code of Perl, but I'm a bit
afraid af what I'm going to see there :-))).

> > Can Perl become confused about where to allocate the memory for new
> > elements in an array passed by reference (and does this count for
> > hash-tables too)?
> 
> No, but the programmer can. :-)

<sigh>, I know all about it.

> > If I pass a variable by reference to a subroutine, and
> > this subroutine passes the same variable by reference to another
> > subroutine, will this work?
> 
> Yes.

I just have to accept that a reference is just some kind of pointer into
a symbol-table, that makes things a lot easier. Until yesterday I was
under the impression that Perl used different symbol-tables for
different kinds of variable-scopes, something like static and automatic
variables in C, where automatic variables get cleaned up when they go
out of scope. It seems Perl variables never get cleaned up (maybe they
do when Perl finds out there's no reference to them altogether). So if
you have a reference, the thing the reference points to is allways
valid.

Thanks for your answer, it's cleared a lot of things up for me (together
with the answers of others). These answers have helped me more than
reading the Camel ten times over :-)).

Peter
-- 
Peter de Vroomen (e-mail: peterv@valkieser.nl), Software Engineer,
Valkieser Solutions, 's Gravelandseweg 80a, 1217 EW Hilversum,
The Netherlands, +31-(0)35-6714300, fax: +31-(0)35-6714333


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

Date: Sat, 30 Aug 1997 01:34:31 -0600
From: "T. LaWall" <tlawallANTISPAM@concentric.net>
To: David Hayden <dhayden@netcomuk.co.uk>
Subject: Re: Searching
Message-Id: <3407CD07.114F@concentric.net>

David Hayden wrote:
> 
> I am trying to write a 'searching' script which takes a sinlge word input
> and looks through a list of report names and prints the report name if that
> word appears in it. 
> 

Here's a solution:

#!/usr/local/bin/perl
print "Enter Word to search for: ";
chop($target = <STDIN>);  
open(IN, "doclist.txt") or die("Could not open doclist.txt! $!");
@lines = <IN>;
close(IN);
if(@found = grep(/$target/, @lines)){
	foreach $line (@found){
		@segments = split(/,/, $line);
		print "$segments[0]\n";
	}
}


This script is:
	A) Quick
	B) Dirty
	C) A fast hack
	D) All of the above

Yup, that's right, D.  If you guessed D, well, there is no prize,
so the script will have to be it for now.

> This is only my second script so please excuse the poor structure etc.
Weeeelll, Ok.  Just promise you'll work on it. 

> Many Thanks
Hey, that's what we're here for... No Problemo.

E-mail me if you have any questions.
Todd

P.S. I thought this a little odd:
> #Web Program
Is that what you intend this program for?  If so, you need to learn
not only more PERL, but also the CGI interface.  Don't fret if you
don't know what CGI is, there's plenty of good books and online 
documentation on it.  I suggest looking at the following URLs:

http://hoohoo.ncsa.uiuc.edu/cgi/  --  The CGI Documentation Home Page

http://skydive.ncsa.uiuc.edu/events/webmaster/webmaster95/
present/wm07/frank/CGI/description.html
-- 
  -------------------------------------------------
  T. LaWall
  To reply, remove ANTISPAM from my address
  -------------------------------------------------
  Where do I want to go today? 
  With Linux, Anywhere I want, TOLL FREE!
  -------------------------------------------------


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

Date: Sat, 30 Aug 1997 07:37:36 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: "T. LaWall" <tlawallANTISPAM@concentric.net>
Subject: Re: Searching
Message-Id: <Pine.GSO.3.96.970830073205.23053F-100000@julie.teleport.com>

On Sat, 30 Aug 1997, T. LaWall wrote:

> #!/usr/local/bin/perl
> print "Enter Word to search for: ";
> chop($target = <STDIN>);  

(It would be a little better to use chomp.) So, you've gotten a word
into $target there...

> open(IN, "doclist.txt") or die("Could not open doclist.txt! $!");
> @lines = <IN>;
> close(IN);
> if(@found = grep(/$target/, @lines)){

(It would be a little better to just grep the line input operator
directly, rather than storing the lines into @lines, perhaps.) 

 ...but here you're using $target as a regular expression. It would be
better to pick one or the other - especially since a bad regexp will cause
Perl to upchuck. I'd use index() to search for words, probably. But if
your users will be regexp savvy, you could use this code (with a different
prompt). 

Cheers!

-- 
Tom Phoenix           http://www.teleport.com/~rootbeer/
rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/



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

Date: Sat, 30 Aug 1997 01:01:41 -0400
From: jason@pcauthority.com
Subject: Stripping | and carrage returns
Message-Id: <3407A935.32064046@pcauthority.com>

passme


I have a database with the | symbol to seperate fields.
My two problems happen when someone enters a | in a text box
or presses the enter key.  Up to now i have just used a one line text
box, but that will no longer suffice.

I would appreciate an explanation of the code so i know what the code is
doing...  Something about teaching a man how to fish......


Thanks,
Jason


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

Date: Sat, 30 Aug 1997 07:30:39 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: jason@pcauthority.com
Subject: Re: Stripping | and carrage returns
Message-Id: <Pine.GSO.3.96.970830072932.23053E-100000@julie.teleport.com>

On Sat, 30 Aug 1997 jason@pcauthority.com wrote:

> I have a database with the | symbol to seperate fields.
> My two problems happen when someone enters a | in a text box
> or presses the enter key.  Up to now i have just used a one line text
> box, but that will no longer suffice.
> 
> I would appreciate an explanation of the code so i know what the code is
> doing...  Something about teaching a man how to fish......

So, what are the two problems you mention? :-)  (I'm not trying to be mean
here, but I can't see where you're stuck.) Cheers!

-- 
Tom Phoenix           http://www.teleport.com/~rootbeer/
rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/



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

Date: 30 Aug 1997 07:31:46 GMT
From: "Monachus Silentium" <monachus@arces.net>
Subject: Telnet Parameters?  Please Help!
Message-Id: <01bcb517$1ffd4ae0$f3481bcc@forces.arces.net>

I've got a telnet client which is terribly simple (slightly modified
version of the one in the O'Reilly book or the perlipc manpage), but it has
a huge flaw.

It connects to a server on a specific port (not port 23).  The server
outputs a screen of information before asking for a login.  My client
receives all of this information 
except for the login.  It isn't until after the connection times out that
the login request is displayed.

I don't believe this is a perl problem as much as it is a programming flaw
because i wrote the same thing as an ActiveX control in VB and as an applet
in Java, and both of those do the same thing.  It's as though the login
request is not sent as a stream and has to be requested or something, but I
don't have enough experience with sockets to debug it.

Anyone have any ideas?  Please respond via email.
-- 

Adrian Goins
<admin@arces.net>
http://www.arces.net


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

Date: Sat, 30 Aug 1997 13:27:58 +0200
From: Marc Philips <Marc.Philips@tvd.be>
To: Monachus Silentium <admin@arces.net>
Subject: Re: Telnet Parameters?  Please Help!
Message-Id: <340803BE.554E4E4D@tvd.be>

This is a cryptographically signed message in MIME format.

--------------msBD921100A75E4AC3061BD56B
Content-Type: multipart/alternative; boundary="------------EE15A895B67473A569180D26"


--------------EE15A895B67473A569180D26
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Monachus Silentium wrote:

> I've got a telnet client which is terribly simple (slightly modified
> version of the one in the O'Reilly book or the perlipc manpage), but it has
> a huge flaw.
>
> It connects to a server on a specific port (not port 23).  The server
> outputs a screen of information before asking for a login.  My client
> receives all of this information
> except for the login.  It isn't until after the connection times out that
> the login request is displayed.
>
> I don't believe this is a perl problem as much as it is a programming flaw
> because i wrote the same thing as an ActiveX control in VB and as an applet
> in Java, and both of those do the same thing.  It's as though the login
> request is not sent as a stream and has to be requested or something, but I
> don't have enough experience with sockets to debug it.
>
> Anyone have any ideas?  Please respond via email.

My guess is that your client reads lines of text with the <filehandle>
operator. The "information" lines that the server sends to your client are all
terminated with a CRLF but the line containing the login prompt isn't so your
<> never returns until the server closes the connection.

Try using sysread to get bytes (not lines) from your socket and select to find
out if there is anything to read (see the perlfunc man page).

I hope this helps,

Marc


> --
>
> Adrian Goins
> <admin@arces.net>
> http://www.arces.net



--------------EE15A895B67473A569180D26
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit

<HTML>
Monachus Silentium wrote:
<BLOCKQUOTE TYPE=CITE>I've got a telnet client which is terribly simple
(slightly modified
<BR>version of the one in the O'Reilly book or the perlipc manpage), but
it has
<BR>a huge flaw.

<P>It connects to a server on a specific port (not port 23).&nbsp; The
server
<BR>outputs a screen of information before asking for a login.&nbsp; My
client
<BR>receives all of this information
<BR>except for the login.&nbsp; It isn't until after the connection times
out that
<BR>the login request is displayed.

<P>I don't believe this is a perl problem as much as it is a programming
flaw
<BR>because i wrote the same thing as an ActiveX control in VB and as an
applet
<BR>in Java, and both of those do the same thing.&nbsp; It's as though
the login
<BR>request is not sent as a stream and has to be requested or something,
but I
<BR>don't have enough experience with sockets to debug it.

<P>Anyone have any ideas?&nbsp; Please respond via email.</BLOCKQUOTE>
My guess is that your client reads lines of text with the &lt;filehandle>
operator. The "information" lines that the server sends to your client
are all terminated with a CRLF but the line containing the login prompt
isn't so your &lt;> never returns until the server closes the connection.

<P>Try using <B>sysread</B> to get bytes (not lines) from your socket and
<B>select</B> to find out if there is anything to read (see the <I>perlfunc</I>
man page).

<P>I hope this helps,

<P>Marc
<BR>&nbsp;
<BLOCKQUOTE TYPE=CITE>

<P>--

<P>Adrian Goins
<BR>&lt;admin@arces.net>
<BR><A HREF="http://www.arces.net">http://www.arces.net</A></BLOCKQUOTE>
&nbsp;</HTML>

--------------EE15A895B67473A569180D26--

--------------msBD921100A75E4AC3061BD56B
Content-Type: application/x-pkcs7-signature; name="smime.p7s"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="smime.p7s"
Content-Description: S/MIME Cryptographic Signature

MIIKdgYJKoZIhvcNAQcCoIIKZzCCCmMCAQExCzAJBgUrDgMCGgUAMAsGCSqGSIb3DQEHAaCC
COQwggQuMIIDl6ADAgECAhAQMWJKjf4ZqjjD8I9xIt59MA0GCSqGSIb3DQEBBAUAMGIxETAP
BgNVBAcTCEludGVybmV0MRcwFQYDVQQKEw5WZXJpU2lnbiwgSW5jLjE0MDIGA1UECxMrVmVy
aVNpZ24gQ2xhc3MgMSBDQSAtIEluZGl2aWR1YWwgU3Vic2NyaWJlcjAeFw05NzA4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IhvcNAwICASgwIwYJKoZIhvcNAQkEMRYEFNcnGU5pUna90ur1
M6Y/h8+hTdXsMA0GCSqGSIb3DQEBAQUABEAjPUTo3TPkdOrGKDcFjOCgw0b81AaOACJ6yq8j
QB42VoNYjKl7sUtqMYOrQwYiDyq+FD33h1uTL+S6mpO1NU+u
--------------msBD921100A75E4AC3061BD56B--



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

Date: 30 Aug 1997 10:05:54 -0400
From: clay@panix.com (Clay Irving)
Subject: Re: Win32::EventLog problem
Message-Id: <5u99c2$bfj@panix.com>

In <01bcb4b0$1900ae10$0101010a@turfpit> "David Richards" <dave@turfpit.demon.co.uk> writes:

>Try

>http://www.inforoute.cgs.dr/leberre1/

 http://www.inforoute.cgs.fr/leberre1/
                          ^
                          |

>for excellent and accurate Eventlog & Registry documentation for Perl for
>Win32.

-- 
Clay Irving <clay@panix.com>                   http://www.panix.com/~clay/


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

Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 8 Mar 97)
Message-Id: <null>


Administrivia:

The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc.  For subscription or unsubscription requests, send
the single line:

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.

The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.

The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.

For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V8 Issue 951
*************************************

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