[19521] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1716 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Sep 8 21:05:33 2001

Date: Sat, 8 Sep 2001 18:05:08 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <999997508-v10-i1716@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Sat, 8 Sep 2001     Volume: 10 Number: 1716

Today's topics:
        ANNOUNCE: Attribute::Protected, Attribute::Profiled, At <miyagawa@cpan.org>
        ANNOUNCE: IO::Tty 0.05 and Expect 1.12 <RGiersig@CPAN.org>
    Re: Black Perl (Jonadab the Unsightly One)
    Re: Disappearing Compiler messages <flavell@mail.cern.ch>
    Re: Extract the relative sorting of items from multiple (Tim Hammerquist)
    Re: Extract the relative sorting of items from multiple (Paul David Fardy)
    Re: guestbook <rob_13@excite.com>
    Re: How can I catch unimplemented options, using Getopt (Garry Williams)
    Re: OT: Re: Recommendations for a PERL editor (Jonadab the Unsightly One)
        Perl objects problems <mirvine@esatclear.ie>
    Re: Perl objects problems <Tassilo.Parseval@post.rwth-aachen.de>
    Re: Recommendations for a PERL editor (Jonadab the Unsightly One)
    Re: Recommendations for a PERL editor (Jonadab the Unsightly One)
    Re: running ActivePerl on W2k Prof <bwalton@rochester.rr.com>
    Re: Shared Libraries (Smiley)
    Re: Simple regexp (Chas Friedman)
    Re: SNMP.so? (Garry Williams)
    Re: SQL question <ron@indra.com>
    Re: sudhir: array references. <pilsl_@goldfisch.at>
    Re: user 'passwd' to change unix password in Perl scrip (lurker)
    Re: Where can I find a Perl SSH Telnet Client? <ben@rhumba.pair.com>
    Re: Wierd: SUN problem or Perl problem ? <ron@indra.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Sat, 08 Sep 2001 16:34:30 +0900
From: Tatsuhiko Miyagawa <miyagawa@cpan.org>
Subject: ANNOUNCE: Attribute::Protected, Attribute::Profiled, Attribute::Unimplemented
Message-Id: <tpl72qoju5kl55@corp.supernews.com>

Better late than never...  Announcing three Attribute modules.

Attribute::Protected - implementing proctected methods with attributes
http://search.cpan.org/search?dist=Attribute-Protected

Attribute::Profiled - Profiles specific methods in class
http://search.cpan.org/search?dist=Attribute-Profiled

Attribute::Unimplemented - mark unimplemented methods
http://search.cpan.org/search?dist=Attribute-Unimplemented


-- 
Tatsuhiko Miyagawa <miyagawa@cpan.org>




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

Date: Sat, 08 Sep 2001 22:28:34 GMT
From: Roland Giersig <RGiersig@CPAN.org>
Subject: ANNOUNCE: IO::Tty 0.05 and Expect 1.12
Message-Id: <tpl7323rmfqs58@corp.supernews.com>

Finally!  A much improved version of IO::Tty that now even works
under Cygwin, which means: (tada!) Expect for Windows!  Only a few
very basic tests have been done, so I expect that further bugfixes
may be needed, but it's still a small giant step...

Find attached the READMEs for IO::Tty and Expect.  Note that I have
enhanced documentation, especially for Expect.

Both modules are available from CPAN.

Feedback is (as always) appreciated.

Roland
--
RGiersig@cpan.org


IO::Tty v0.05
=============

IO::Tty and IO::Pty provide an interface to pseudo tty's

To build this distribution run

  perl Makefile.PL
  make
  make test
  make install

There is finally a 'make test' for this distribution!!
For manual tests there is still a script included called 'try'.

If try is run with arguments it will run then as a command with the
output connected via a pseudo tty, eg

   perl -Mblib try ls

This module was developed by Graham Barr <gbarr@pobox.com>
and is now maintained by Roland Giersig <RGiersig@cpan.org>.

GREAT NEWS!!  It now works on Windows under Cygwin
(http://source.redhat.com/cygwin) !!  For all those interested: Cygwin
provides /dev/ptmx semantics, but there is no actual file called
'/dev/ptmx'.  Still, when someone opens it, Cygwin emulates the Right
Thing (tm).  Deep Magic!

It should finally work with HPUX 11.0 and FreeBSD, but I cannot do any
in-depth testing, so please provide feedback.

Please note that pty creation is very system-dependend.  If you have
problems on your system, please send me (<RGiersig@cpan.org>) the output 
of a manual installation ('perl Makefile.PL; make; make test;') and 
I'll see what I can deduce from it.

Supported systems include Linux, Solaris, AIX, OSF, *BSD, HP-UX and
finally Windows (under the Cygwin environment, see
http://source.redhat.com/cygwin).  See the IO::Tty manpage for a list.
If it's working on your system, please send me a short note with
details (version number, distribution, etc. 'uname -a' is a good
start) so I can get an overview.  Thanks!

As this module is mainly used by Expect, support for it is available 
via the two Expect mailing lists, expectperl-announce and
expectperl-discuss, at

  http://lists.sourceforge.net/lists/listinfo/expectperl-announce

and

  http://lists.sourceforge.net/lists/listinfo/expectperl-discuss


Thanks to (in no particular order)

Mark Montague <markmont@umich.edu> 
Olaf Flebbe <o.flebbe@science-computing.de>
Nick Scott <Nick.Scott@veritect.com>
Theo Petersen <theo@acsp.com> 
Rocco Caputo <troc@netrus.net>
Dave Smith <dave.smith@candata.org>
Bob Showalter <Bob_Showalter@taylorwhite.com>

who helped fixing bugs on various platforms.

See the ChangeLog for details.

Roland <RGiersig@cpan.org>
2001-08-16



Expect.pm v1.12
===============

GREAT NEWS!  Expect should finally work under the cywin environment
for Windows NT!  All you need is the latest version of IO::Tty (0.05),
which has been severely enhanced and bugfixed.  Also, *BSD and HPUX
should work now.  Please refer to the IO::Tty documentation.

Expect requires IO::Tty and IO::Stty, also available from CPAN.
It is highly recommended that you also upgrade to the latest IO::Tty.
There is a Bundle::Expect available that installs everything for
you.

If you prefer manual installation, the usual

  perl Makefile.PL
  make
  make test
  make install

should work.  I finally started a simple testsuite for Expect, but
it doesn't really test anything deeper right now.  The problem is to
find some external program to use for generating reproducible output
that is available across all platforms.  Luckily, we can always use perl
itself...  Contributions to the testsuite are of course welcome.

It would probably be wise to read the docs on IO::Tty before doing a
make install with it (or at least when there are problems).  Note that
IO::Tty is very system-dependend.  I'm in the process to steal the
pty-creation code from the Tcl version of Expect, which should be much
more stable, but this may take a while (no free tuits at the moment).

The Expect for Perl module was inspired more by the functionality the
Tcl tool provides than any previous Expect-like tool such as Comm.pl
or chat2.pl.

The Tcl version of expect is a creation of Don Libes (libes@nist.gov).
The Tcl Expect home page is http://expect.nist.gov/.  Don has written
an excellent in-depth tutorial of Tcl/Expect, which is _Exploring
Expect_.  It is the O'reilly book with the monkey on the front.  Don has
several references to other articles on the Expect web page.

I try to stay as close to Tcl/Expect in interface and semantics
as possible (so I can refer questions to the Tcl/Expect docu).
Suggestions for improvement are always welcome.

There is now a FAQ section in the pod, complete with examples, so please
let me know if there's something you'd like to see answered there that
isn't.

There are two mailing lists available, expectperl-announce and
expectperl-discuss, at

  http://lists.sourceforge.net/lists/listinfo/expectperl-announce

and

  http://lists.sourceforge.net/lists/listinfo/expectperl-discuss


>From the Changes file:
======================

! exp_Max_Accum didn't work for interact.

- removed soft_close() from DESTROY.  Being overly nice to a doomed
  process doesn't pay off.  Old behaviour is available via
  $Expect::Do_Soft_Close = 1;

! cleanup of log and exp_internal output

+ added various aliases for functions starting with 'exp_'

! moved FAQ and intro into the main pod as I got the impression
  that many users didn't bother to read all the documentation
  or didn't know that it was there.

+ added a hook for log_file: can be set to a code ref.


Thanks to everybody who wrote to me, either with bug reports or
enhancement suggestions!

Roland Giersig (maintainer of Expect.pm, IO::Pty, IO::Stty,
Tie::Persistent)
RGiersig@cpan.org

2001-09-03




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

Date: Sat, 08 Sep 2001 21:16:14 GMT
From: jonadab@bright.net (Jonadab the Unsightly One)
Subject: Re: Black Perl
Message-Id: <3b9a8a69.24373859@news.bright.net>

mgjv@tradingpost.com.au (Martien Verbruggen) wrote:

> So, it certainly would parse under Perl 3, almost certainly under Perl
> 4, and not under Perl 5.

Twould be enormously and enjoyably ironic if it parsed under 
Perl 6, or some subsequent version.

Not that that's likely.

- jonadab


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

Date: Sat, 8 Sep 2001 22:17:57 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: Disappearing Compiler messages
Message-Id: <Pine.LNX.4.30.0109082203070.4168-100000@lxplus023.cern.ch>

On Sep 8, Jonadab the Unsightly One inscribed on the eternal scroll:

> "David F Dafoe" <david.f.dafoe@boeing.com> wrote:
>
> > A few things changed recently in my .PL files hosted on an NT server at a
> > large corporation.
> >
> > You're supposed to put this line:
> >
> > print "Content-type:text/html\n\n";
>
> That's just an HTTP header.

Actually it's a CGI header.  The resemblance is intentional, of
course, but there are subtle differences, so it's best IMHO to
keep the distinction in mind.

CGI headers are specified as a response from a CGI process to a web
server (HTTPD) on the same platform - as a result of which, the HTTPD
is supposed to generate an appropriate HTTP response over the network
to the client.  HTTP headers are specified as a network response from
an HTTPD to some client process, cross-platform.

RFC2616 governs the latter.  For the former, you'd want to consult the
draft CGI RFC at http://cgi-spec.golux.com/

>  Actually, you could put any HTTP headers
> there that you want to send to the browser,

 ..provided they form a consistent CGI response, yes

> as long as they don't
> duplicate one that the web server software is already sending.

That's not an accurate statement.

It's a pity that the comp.infosystems.www.authoring.cgi group seems to
be currently moribund (reputedly because its automoderation bot has
lost its usenet feed), because the problematical parts of the answers
to this off-topic issue ought really to be tackled there, knowing that
the locals here on clpm are highly resistant to their newsgroup being
turned into a sort of alt.cgi.

> You could also install Apache on your PC and _test_ your
> scripts there, to make sure they're actually working before
> you upload them.

Good advice.

all the best



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

Date: Sat, 08 Sep 2001 19:50:47 GMT
From: tim@vegeta.ath.cx (Tim Hammerquist)
Subject: Re: Extract the relative sorting of items from multiple lists
Message-Id: <slrn9pkubv.cr7.tim@vegeta.ath.cx>

Me parece que Benjamin Goldberg <goldbb2@earthlink.net> dijo:
> I forget where I saw it, but this makes me think of a quote that was
> something like "Real Programmers edit using 'cat'" :)

http://ars.userfriendly.org/cartoons/?id=19990508

It's actually DOS, but who couldn't have a similar argument about unix?

s/edit/pico/g;
s/edlin/ex/g;
s/copy con/cat/g;

-- 
You are alive. So live.
    -- Morpheus, The Sandman


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

Date: Sat, 8 Sep 2001 23:11:08 +0000 (UTC)
From: pdf@morgan.ucs.mun.ca (Paul David Fardy)
Subject: Re: Extract the relative sorting of items from multiple lists
Message-Id: <9ne8ic$49i$1@coranto.ucs.mun.ca>

Me parece que Benjamin Goldberg <goldbb2@earthlink.net> dijo:
>> I forget where I saw it, but this makes me think of a quote that was
>> something like "Real Programmers edit using 'cat'" :)

tim@vegeta.ath.cx (Tim Hammerquist) writes:
>http://ars.userfriendly.org/cartoons/?id=19990508

>It's actually DOS, but who couldn't have a similar argument about unix?

DOS filesystems have inodes?  Isn't she's talking about a UNIX filesystem?

I recall my first days learning ed, reading Kernighan's "A Tutorial
Introduction to the ED Text Editor" instead of listening to the my high
school English teacher.  In the beginning, <em>the buffer</em> was this
wonderful mysterious thing.  It seemed to me that the text existed only
in <em>the buffer</em> and the paper (or the screen) could only show
glimpses of it.  The paper was image, <em>the buffer</em> was real.
I might have called it virtual reality, but the term probably hadn't
yet been coined.  Rarely did I grok even my own code well enough to go
without printing any of it, though.

On the other hand, at 300 baud or slower, everyone learns to be
conservative with printing. :-)  But we soon moved on to those
new-fangled vt100's, funky Cybernex XL87s, with 2400, 4800, or
even 9600! baud Gandalf port selector lines.  (There are times
still when I'd like to have that "HERE IS" key again.)

And as for editing blind, with speech synthesis and a few termcap
tweaks, vi's open mode can be surprisely effective.

This trip down memory lane brought to you by

Paul Fardy <pdf@mun.ca>
-- 
adb: the programmer's text segment editor.


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

Date: Sat, 08 Sep 2001 22:04:27 GMT
From: "Rob - Rock13.com" <rob_13@excite.com>
Subject: Re: guestbook
Message-Id: <Xns9116B7D43FA69rock13com@64.8.1.227>

stewie <news:9ndnf6$tap$1@news.planetinternet.be>:

> I've downloaded the perl code for a guestbook
> 
> It works fine, but it needs one more thing:
> The owner of the guestbook should be able to give a reaction on
> the guestboard true the admin tool.

Are you allowed to modify the guestbook? You should respect 
copyrights when they are present.

Perhaps you want a different guestbook. Maybe you want a forum 
instead of a guestbook. Otherwise, email the person who signed.

I suggest studying the file for a bit and let us know what you 
tried to do to add your functionality.

-- 
Rob - http://rock13.com/
Web Stuff: http://rock13.com/webhelp/


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

Date: Sat, 08 Sep 2001 19:40:37 GMT
From: garry@ifr.zvolve.net (Garry Williams)
Subject: Re: How can I catch unimplemented options, using Getopt::Mixed ?
Message-Id: <slrn9pkt1l.2fv.garry@zfw.zvolve.net>

On 7 Sep 2001 07:41:03 -0400, Stan Brown <stanb@panix.com> wrote:

> In C I usually put in a "catch all" option in the getopt parser.
> That is, if it's not a recognized option, I print out a ussage
> message for the program in question.
> 
> I'm using Getopt::Mixed in my perl scripts.
> 
> Is there a way to do this using this module? 

The module documentation would be a good place to start.  I assume the
module was inspired by Getopt::Std and Getopt::Long so they both give
an indication that an option was invalid (the return value from
getopts(), for example).  

-- 
Garry Williams


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

Date: Sat, 08 Sep 2001 21:44:50 GMT
From: jonadab@bright.net (Jonadab the Unsightly One)
Subject: Re: OT: Re: Recommendations for a PERL editor
Message-Id: <3b9a9102.26062958@news.bright.net>

tim@vegeta.ath.cx (Tim Hammerquist) wrote:

> > > Wine could only run two Win32 programs consistently 
> > 
> > It's not *that* bad.  
> 
> On my box it was.  Of course, most of the other applications I ran on
> Win32 were pretty dll-intensive; 

Ah.

I was able to get several apps to run, albeit not perfectly.
Font sizes were usually completely off, among other things.

> > But it isn't really stable, either, and if I'm going to 
> > accept instability I may as well use Windows.  
> 
> Very well put. May I quote you on that?  Seriously?

Um, sure.

- jonadab


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

Date: Sun, 09 Sep 2001 00:33:53 +0400
From: "Mark Irvine" <mirvine@esatclear.ie>
Subject: Perl objects problems
Message-Id: <cFxm7.8208$s5.86095@news.indigo.ie>

Hi,

I'm working my way through some of the Perl Objects documentation(perlobj, perlboot, perltoot etc), and the
Perl Cookbook. I'm trying to figure how to use objects in perl. I'm confused about why the code below produces
the output shown.

File spider:
-------8<----------------------------------------------------------------------
#!/usr/bin/perl -w

use strict;
use lib qw(./);
use Insect;

my $spider = Insect->new(3,'spider');

print "Spider Output\n------------
     \nAge: ".$spider->age.
    "\nStart :".$spider->start.
    "\nName: ".$spider->name."\n";
-------8<----------------------------------------------------------------------


Actual output:
-------8<----------------------------------------------------------------------
[mark@localhost.localdomain]$perl spider
insect init, Insect=HASH(0x812d53c) 3 spider
Spider Output
------------
Age: 3
Start :1000007084
Name: 3
-------8<----------------------------------------------------------------------


I want to initialize the name, so I want it to read 'spider', not 3. 
Any ideas on where I'm going wrong? 

I can see that when I call the _initialize sub in Insect.pm I have 3
args, so doing the shift gets the number 3(which should be age). 
How come when I do a shift on the @_, it still 
contains all the original args when it gets to _initialize() in Insect.pm?

The classes are shown below, any way I could 
improve on the way I'm implementing this. It's mostly based on stuff from the 
cookbook (ch13) and perlobj.pod

Cheers,
Mark Irvine


File Critter.pm:
-------8<----------------------------------------------------------------------
package Critter;

use strict;

sub new {
    my $classname  = shift;         # What class are we constructing?
    my $self      = {};             # Allocate new memory
    bless($self, $classname);       # Mark it of the right type
    $self->_init(@_);               # Call _init with remaining args 
    return $self;
} 

# "private" method to initialize fields.  
sub _init {
    my $self = shift;
    $self->{START} = time();
    $self->{AGE}   = shift;
} 


sub age {
    my $self = shift;
    if (@_) { $self->{AGE} = shift } 
    return $self->{AGE};
} 

sub start {
    my $self = shift; 
    return $self->{START};
} 

1;
-------8<----------------------------------------------------------------------

File Insect.pm:
-------8<----------------------------------------------------------------------
package Insect;

use strict;
use vars qw(@ISA);
use lib qw(./);
use Critter;
@ISA=('Critter');

sub new {
    my $classname  = shift;         # What class are we constructing?
    my $self       = $classname->SUPER::new(@_);
    $self->_initialize(@_);
    return $self;                   # And give it back
} 

sub _initialize {
    print "insect init, @_\n";
    my $self = shift;
    $self->{NAME}   = shift;   
}


sub name {
    my $self = shift;
    if (@_) { $self->{NAME} = shift } 
    return $self->{NAME};
} 

1;
-------8<----------------------------------------------------------------------


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

Date: Sun, 09 Sep 2001 02:12:13 +0200
From: Tassilo von Parseval <Tassilo.Parseval@post.rwth-aachen.de>
Subject: Re: Perl objects problems
Message-Id: <3B9AB3DD.8020807@post.rwth-aachen.de>

Mark Irvine wrote:

> I can see that when I call the _initialize sub in Insect.pm I have 3
> args, so doing the shift gets the number 3(which should be age). 
> How come when I do a shift on the @_, it still 
> contains all the original args when it gets to _initialize() in Insect.pm?

When calling _initialize, the first argument will be $self (or whatever 
you call it). So the second shift will shift out '3' and assign it to 
$self->{NAME} which is not what you want. The name is the third element 
of @_. Each time you call a method, the object itself is passed as 
*first* argument to this method unless it is the constructor in which 
case the class-name is the first argument. Hence:

> sub new {
>     my $classname  = shift;         # What class are we constructing?
>     my $self       = $classname->SUPER::new(@_);
                                    ^^^^^
Why SUPER here? I don't see any base-classes.

More to that, you do not bless anything:
       my $self = bless {}, $classname;

>     $self->_initialize(@_);
>     return $self;                   # And give it back
> } 
> 
> sub _initialize {
>     print "insect init, @_\n";
>     my $self = shift;

       $self->{AGE}    = shift;

>     $self->{NAME}   = shift;   
> }

Tassilo
-- 
$a=[(74,116)];$b=[($a->[1]-1,$a->[1]++,0x20)];$c=[(97,110)];$d=[($c->
[1]+1,$b->[1],"her")];for(@{[$a,$b,$c,$d]}){for(@{$_}){$_=~/\d+/?print
(chr($_)):print;}}$c=sub{$l=shift;[(0x20+$l-1,0x50,0x65,0x73-0x01,108
),(0x20,0x68,0x61,)]};print(map{chr($_)}@{($c->(1))});$h={a=>33*3,b=>
10**2+7,c=>"1"."0"."1",d=>0162};@h=sort(keys(%$h));for(@h){print(chr(
ord(chr($h->{$_}))))};



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

Date: Sat, 08 Sep 2001 22:28:34 GMT
From: jonadab@bright.net (Jonadab the Unsightly One)
Subject: Re: Recommendations for a PERL editor
Message-Id: <3b9a986d.27962849@news.bright.net>

helgi@NOSPAMdecode.is (Helgi Briem) wrote:

> UltraEdit is very good and I heartily recommend it.
> Believe it or not, I also recommend MS Word.

The college I went to had Word, and I used it there and
liked it, for producing paper copies, like things to hand
in to profs.  It's good, excellent, even, if your goal is 
to produce paper copies.  Handles that nicely.  

- jonadab


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

Date: Sat, 08 Sep 2001 21:38:25 GMT
From: jonadab@bright.net (Jonadab the Unsightly One)
Subject: Re: Recommendations for a PERL editor
Message-Id: <3b9a8abe.24458797@news.bright.net>

helgi@NOSPAMdecode.is (Helgi Briem) wrote:

> W9x crashes frequently, but it does not BSOD.  

Oh, yes, it most certainly does.

Not, however, as frequently as it crashes in other ways.
When NT crashes, it's usually a BSOD that you get (or so
I am told, not that I would know from personal experience;
I don't have any NT here).  With 9x, it's usually either 
something less elegant (like a bizarre clicking sound any 
time you move the mouse, and no response at all to the 
keyboard) or something a little less thoroughgoing (like 
Explorer suddenly just stops responding, which is fairly
recoverable if you happen to have a command prompt up
(MCL is handy for that), although it is highly advisable 
to reboot shortly).  But you do get a BSOD on occasion, 
complete with meaningless white hex numbers.  If you've
never seen a BSOD, you haven't pushed Windows very hard.

The feature is certainly not unique to NT; Win3 used to 
BSOD quite often, as I recall.  

- jonadab


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

Date: Sat, 08 Sep 2001 21:34:49 GMT
From: Bob Walton <bwalton@rochester.rr.com>
Subject: Re: running ActivePerl on W2k Prof
Message-Id: <3B9A8EC9.59355E69@rochester.rr.com>

The Executioner wrote:
 ...
> I'm trying to run a perl script on my computer.
> I have got Windows 2000 Prof.
> I have installed ActivePerl-5.6.1.628-MSWin32-x86-multi-thread.msi
> 
> Where is the cgi-bin, or where can I define the cgi-bin?

That will be on your web server.  If you have a web server on your local
computer, look there.  Otherwise, it will be on whatever computer your
web server is running on.  You'll have to look in the docs for your web
server, as the location for the cgi-bin diretory varies amongst web
servers.  And your Perl question was what?
-- 
Bob Walton

> 
> Thanks in advance, Maarten


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

Date: Sat, 08 Sep 2001 20:14:06 GMT
From: gurm@intrasof.com (Smiley)
Subject: Re: Shared Libraries
Message-Id: <3b9a7a43.98522377@news1.on.sympatico.ca>

Thanks for your help.  I already knot the principles of object
oriented programming, I studied C++ in college.  And I do know about
Perl Modules.  I guess I must be confused about what the chat program
wants.

The documents said that I should compile these functions into a shared
library in Linux, or a DLL in Windows.  I'm only a beginner at Linux
but that's what the server's running off of, so I figured it meant
that there was a way to compile your Perl scripts into a shared
library file.

The documents they sent me were fragmented and didn't give me any
clear-cut instructions, so I'm left to figure some of this stuff out
for myself.

Thanks again for your help, I'm going to contact the company on
Monday.

On Sat, 08 Sep 2001 12:56:50 GMT, William Seeley
<william-seeley@home.com> wrote:

>Perl is a semi-compliled language. Unlike C++ and Java, Perl is not compiled
>until runtime. Servlets are associated with Java.
>
>If your functions are already written you can put them in a single script or
>put them into a package so they are available to all your scripts.
>
>validate($user, $pw);
>This assumes sub validate{ } exists somewhere in your script.
>
>use chat;
>use lib '/path/to/library';
>chat::validate($user, $pw);
>This assumes you have written a package called chat.pm and that it contains a
>function called validate.
>
>These are very simple illustrations that barely scratch the surface. As I
>said earlier, OO is a big topic. If you are uninterested in buying a book,
>you could go to perl.com and perl.org. If you don't know how to access them
>on your system, the perl man pages are available on one or both of these
>sites.



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

Date: Sat, 08 Sep 2001 14:25:57 GMT
From: friedman@math.utexas.edu (Chas Friedman)
Subject: Re: Simple regexp
Message-Id: <3b9a29db.134738946@news.itouch.net>

On Sat, 08 Sep 2001 13:37:35 GMT, Scott <scotty99@earthlink.net>
wrote:

>Hi,
>
>Being a newbie to regexps, I find even the simplest of tasks extremely
>daunting.  Anyways imagine if you will the following code snippet:
>
>we have the following output piped in from a unix program:
>12312      /home/this
>3234        /home/that
>12213     /var/horses
>
>while(FD){
>#I need an expression here that will make $_  just the first number
>field
>#ie the first time around in this case would be 12312
>}
>
>I know this is probably simple.  In awk I'd just do {print $1}
>In perl I'm sure I can use a substitution pattern like s /something
>here/ /
>but I don't know what.
>
>Thanks,
>Scott
>
>
>
@lines=( '12312      /home/this', '3234        /home/that', '12213
/var/horses');
for (@lines){print /(\d+)/,"\n"}

produces:
12312
3234
12213


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

Date: Sat, 08 Sep 2001 19:54:59 GMT
From: garry@ifr.zvolve.net (Garry Williams)
Subject: Re: SNMP.so?
Message-Id: <slrn9pktsj.2fv.garry@zfw.zvolve.net>

On Fri, 07 Sep 2001 09:22:46 +0200, Josef Moellers
<josef.moellers@fujitsu-siemens.com> wrote:

> I'm trying to get mib2c to work, but it requires SNMP.so which I
> can't find on my system, neither is it built under ucd-snmp-4.1.2.
> Where do I get SNMP.so from?

SNMP.so is built as a result of installing the Perl SNMP module.  This
module is distributed in the perl subdirectory of ucd-snmp-4.1.2 and
on CPAN.  

-- 
Garry Williams


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

Date: Sat, 08 Sep 2001 12:40:25 -0600
From: Ron Reidy <ron@indra.com>
Subject: Re: SQL question
Message-Id: <3B9A6619.42B715C9@indra.com>

Matthew Frick wrote:
> 
> Probably not the right newsgroup but this is a problem I've got to solve to
> complete the perl script so sorta alright I hope.
> 
> perl script is connecting with an oracle db where I need to update a
> timestamp element of the db. To set the initial value I have been using {fn
> NOW()}. But inorder to basically suspend a user I need to increment the time
> by a year. Does anyone know of a simple command for this or is it one of
> those fiddley things where I will have to reset it by hand.
> 
> Thanks in advance.
> 
> --
> ___________________________________________________________
>                 -  l e a r n . e d   s o l u t i o n s   p t y   l t d  -
> 
> Matthew Frick                            Systems Administrator / Programmer
> www.learnedsolutions.com                     mfrick@learnedsolutions.com
> 
>     Level 1, 214 Greenhill Road, EASTWOOD, South Australia 5063
>       Phone: +61 8 8272 3111 (Ext. 643)      Fax: +61 8 8272 3211
> ___________________________________________________________
>                                   E-mail Disclaimer:
>                http://www.learnedsolutions.com/disclaimer.html
> ___________________________________________________________
Look at your Oracle docs for the UPDATE command, the SYSDATE
pseudo-column, and how to do date math.
-- 
Ron Reidy
Oracle DBA
Reidy Consulting, L.L.C.


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

Date: Sun, 9 Sep 2001 01:05:23 +0200
From: peter pilsl <pilsl_@goldfisch.at>
Subject: Re: sudhir: array references.
Message-Id: <3b9aa444$1@e-post.inode.at>

Sudhir Krishnan wrote:

> Thanks for the response!
> I've tried both setting and retrieving the values in the array as:
> 
> a[i][j][k]=value;
> and it seems to work.
> is this implicitly  the same as a->[i]->[i][k]; ?
>

no. 
$a[i][j][k] will work when @a is defined as array containing anonymous 
arrays. When $a is defined as anonymous array itself, you must use the 
'->' operator. 

@a=([1,2],[3,4]);
$a[1][1]=4;  #  OK !!
$a->[1][1]=4; # ERROR, cause $a is not defined yet, only @a

$b=[[1,2],[3,4]];
$b->[1][1]=4; # OK !!
$b[1][1]=4;  # ERROR, cause @b ist not defined, only $b

but the following is also possible:
$a[1]->[1]=4;
$b->[1]->[1]=4;

You can use or ommit the '->' in the latter indeces as you like, but usage 
before the first index is strictly required _XOR_ strictly forbidden, 
depending how you defined your structure.

When using $a[i][j][k] then perl will implecitely build a structure similar 
to my first example.

> $#{$a}       #DOES NOT WORK (I usually get -1)
> 
> Would u happen to know why the 3rd case does not work?
> 

Cause you use a structure like I used in my first example.
cause $a is not a reference but @a is an array.
You might try $#a instead and it will work.

I recommend not let perl build your structures implecitely, but preset your 
structures (and preallocate if using large matricces) to make yourself 
clear about the structure.
As I said in my last posting, I personally prefer the structure in the 
second example much more than the other, cause using references as 
parameters in functions is much easier than using arrays.

best,
peter



-- 
peter pilsl
pilsl_@goldfisch.at
http://www.goldfisch.at



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

Date: Sun, 09 Sep 2001 07:02:47 +0900
From: aquifer @dd.iijn4u.or.jp (lurker)
Subject: Re: user 'passwd' to change unix password in Perl script withou
Message-Id: <B7C0C497966830B55@192.168.0.2>

In article <cfbf10e5.0109061744.649b5958@posting.google.com>,
ryan326@graduate.hku.hk (Ryan Lam) wrote:

>Hi, 
>
>I am trying to write a perl script to change user's password throuth
>UNIX's "passwd" command.   The "passwd" command is a interactive
>program.
>I have read through many posts about this topics but all suggested to
>use the Expect script in Perl.
>
>For my case, I can't use Expect script and other Packages that are not
>included in standard packages of Perl. Also, I can't use other
>programming languages. Even, I can't modify the password file by
>myself though I can have the administrator accounts.
>
>Any suggestions and ideas? Thanks in advance.
>
>Ryan

Read "man passws".
You may find --stdin.






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

Date: Sat, 08 Sep 2001 18:17:36 GMT
From: Benjamin Trott <ben@rhumba.pair.com>
Subject: Re: Where can I find a Perl SSH Telnet Client?
Message-Id: <B7BFAECF.123F4%ben@rhumba.pair.com>

> Does anyone know where I can find an SSH Client that's written in Perl
> that will allow me to input telnet commands thru SSH Telnet?

Net::SSH::Perl

Net::SSH

Both are on CPAN and can be found at http://search.cpan.org/.

The former is a pure Perl implementation of SSH; the latter is a wrapper
around the 'ssh' command line program.

bye,
Ben



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

Date: Sat, 08 Sep 2001 12:43:45 -0600
From: Ron Reidy <ron@indra.com>
Subject: Re: Wierd: SUN problem or Perl problem ?
Message-Id: <3B9A66E1.991660E1@indra.com>

koff wrote:
> 
> Hi,
> 
> I just reinstall my SUN 2.6 and reinstall back Perl using
> perl-5.6.1-sol26-sparc-local.gz binary. It's work find and without
> hasle.
> 
> But I encounter a problem to install DBI and Data-Show-Table module (And
> of course DBD) . For instance during "make" DBI-1.18 I got this err msg:
> 
> ------8<------- snip ---
> # make
> gcc -c  -fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE
> -D_FILE_OFFSET_BITS=64 -O   -DVERSION=\"1.18\" -DXS_VERSION=\"1.18\"
> -fPIC -I/usr/local/lib/perl5/5.6.1/sun4-solaris/CORE -Wall -Wno-comment
> -DDBI_NO_THREADS Perl.c
> In file included from DBIXS.h:19,
>                  from Perl.xs:1:
> /usr/local/lib/perl5/5.6.1/sun4-solaris/CORE/perl.h:426: sys/types.h: No
> such file or directory
> In file included from DBIXS.h:19,
>                  from Perl.xs:1:
> /usr/local/lib/perl5/5.6.1/sun4-solaris/CORE/perl.h:457: ctype.h: No
> such file or directory
> /usr/local/lib/perl5/5.6.1/sun4-solaris/CORE/perl.h:465: locale.h: No
> such file or directory
> /usr/local/lib/perl5/5.6.1/sun4-solaris/CORE/perl.h:482: setjmp.h: No
> such file or directory
> /usr/local/lib/perl5/5.6.1/sun4-solaris/CORE/perl.h:488: sys/param.h: No
> such file or directory
> /usr/local/lib/perl5/5.6.1/sun4-solaris/CORE/perl.h:493: stdlib.h: No
> such file or directory
> /usr/local/lib/perl5/5.6.1/sun4-solaris/CORE/perl.h:498: unistd.h: No
> such file or directory
> In file included from DBIXS.h:19,
>                  from Perl.xs:1:
> /usr/local/lib/perl5/5.6.1/sun4-solaris/CORE/perl.h:519: string.h: No
> such file or directory
> /usr/local/lib/perl5/5.6.1/sun4-solaris/CORE/perl.h:649: netinet/in.h:
> No such file or directory
> /usr/local/lib/perl5/5.6.1/sun4-solaris/CORE/perl.h:653: arpa/inet.h: No
> such file or directory
> /usr/local/lib/perl5/5.6.1/sun4-solaris/CORE/perl.h:663: sys/stat.h: No
> such file or directory
> /usr/local/lib/perl5/5.6.1/sun4-solaris/CORE/perl.h:692: sys/time.h: No
> such file or directory
> /usr/local/lib/perl5/5.6.1/sun4-solaris/CORE/perl.h:699: sys/times.h: No
> such file or directory
> /usr/local/lib/perl5/5.6.1/sun4-solaris/CORE/perl.h:706: errno.h: No
> such file or directory
> /usr/local/lib/perl5/5.6.1/sun4-solaris/CORE/perl.h:713: sys/socket.h:
> No such file or directory
> /usr/local/lib/perl5/5.6.1/sun4-solaris/CORE/perl.h:740: netdb.h: No
> such file or directory
> /usr/local/lib/perl5/5.6.1/sun4-solaris/CORE/perl.h:807: sys/ioctl.h: No
> such file or directory
> /usr/local/lib/perl5/5.6.1/sun4-solaris/CORE/perl.h:830: dirent.h: No
> such file or directory
> /usr/local/lib/perl5/5.6.1/sun4-solaris/CORE/perl.h:863: sys/mode.h: No
> such file or directory
> 
> In file included from
> /usr/local/lib/gcc-lib/sparc-sun-solaris2.6/2.95.2/include/syslimits.h:7,
>                  from
> /usr/local/lib/gcc-lib/sparc-sun-solaris2.6/2.95.2/include/limits.h:11,
>                  from
> /usr/local/lib/perl5/5.6.1/sun4-solaris/CORE/perl.h:1127,
>                  from DBIXS.h:19,
>                  from Perl.xs:1:
> /usr/local/lib/gcc-lib/sparc-sun-solaris2.6/2.95.2/include/limits.h:117:
> limits.h: No such file or directory
> In file included from DBIXS.h:19,
>                  from Perl.xs:1:
> /usr/local/lib/perl5/5.6.1/sun4-solaris/CORE/perl.h:1130: float.h: No
> such file or directory
> /usr/local/lib/perl5/5.6.1/sun4-solaris/CORE/perl.h:1137: float.h: No
> such file or directory
> In file included from DBIXS.h:19,
>                  from Perl.xs:1:
> /usr/local/lib/perl5/5.6.1/sun4-solaris/CORE/perl.h:1158: float.h: No
> such file or directory
> /usr/local/lib/perl5/5.6.1/sun4-solaris/CORE/perl.h:1182: ieeefp.h: No
> such file or directory
> In file included from
> /usr/local/lib/perl5/5.6.1/sun4-solaris/CORE/perl.h:1527,
>                  from DBIXS.h:19,
>                  from Perl.xs:1:
> /usr/local/lib/perl5/5.6.1/sun4-solaris/CORE/handy.h:118: inttypes.h: No
> such file or directory
> In file included from
> /usr/local/lib/perl5/5.6.1/sun4-solaris/CORE/perl.h:1665,
>                  from DBIXS.h:19,
>                  from Perl.xs:1:
> /usr/local/lib/perl5/5.6.1/sun4-solaris/CORE/unixish.h:93: signal.h: No
> such file or directory
> In file included from
> /usr/local/lib/perl5/5.6.1/sun4-solaris/CORE/iperlsys.h:300,
>                  from
> /usr/local/lib/perl5/5.6.1/sun4-solaris/CORE/perl.h:1947,
>                  from DBIXS.h:19,
>                  from Perl.xs:1:
> /usr/local/lib/perl5/5.6.1/sun4-solaris/CORE/perlsdio.h:5: stdio.h: No
> such file or directory
> In file included from
> /usr/local/lib/perl5/5.6.1/sun4-solaris/CORE/perl.h:2215,
>                  from DBIXS.h:19,
>                  from Perl.xs:1:
> /usr/local/lib/gcc-lib/sparc-sun-solaris2.6/2.95.2/include/math.h:5:
> math.h: No such file or directory
> In file included from DBIXS.h:19,
>                  from Perl.xs:1:
> /usr/local/lib/perl5/5.6.1/sun4-solaris/CORE/perl.h:3340: sys/ipc.h: No
> such file or directory
> /usr/local/lib/perl5/5.6.1/sun4-solaris/CORE/perl.h:3341: sys/sem.h: No
> such file or directory
> /usr/local/lib/perl5/5.6.1/sun4-solaris/CORE/perl.h:3372: fcntl.h: No
> such file or directory
> make: *** [Perl.o] Error 1
> 
> Any idea to solve this ? Is it because of my Perl or my Sun ?
> 
> Thanks in advance.
> 
> Rgds,
> 
> --koff
Looks like an environment issue.  Do you have a C compiler installed? 
If not, you probably don't have the header files (usually located in
/usr/include).  Verify that you have a C compiler, and the headers are
indeed in /usr/include.
-- 
Ron Reidy
Oracle DBA
Reidy Consulting, L.L.C.


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

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
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.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.

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 V10 Issue 1716
***************************************


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