[25037] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 7287 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Oct 22 14:07:22 2004

Date: Fri, 22 Oct 2004 11:05:09 -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           Fri, 22 Oct 2004     Volume: 10 Number: 7287

Today's topics:
        dbd-sybase ppd (Mike Solomon)
    Re: dbd-sybase ppd <1usa@llenroc.ude.invalid>
    Re: deciphering emails in PERL lesley_b_linux@yahoo.co.yuk
    Re: Guestbook hacked? <tadmc@augustmail.com>
    Re: Guestbook hacked? (krakle)
    Re: Help on Perl Split Function <1usa@llenroc.ude.invalid>
        How to monitor a process in system call (Howard)
    Re: How to monitor a process in system call <jurgenex@hotmail.com>
        list vs array <nospam@nospam.com>
    Re: list vs array <1usa@llenroc.ude.invalid>
    Re: list vs array <nospam@nospam.com>
    Re: list vs array <1usa@llenroc.ude.invalid>
    Re: list vs array <nospam@nospam.com>
    Re: list vs array <mritty@gmail.com>
    Re: list vs array <nospam@nospam.com>
    Re: list vs array <mritty@gmail.com>
    Re: localizing %SIG handlers <usenet@morrow.me.uk>
        Online forum source codes in Perl/CGI without SQL? <thefatcat28@hotmail.com>
    Re: overriding perl switch (J. Romano)
    Re: printing to web browser <ithinkiam@gmail.com>
    Re: printing to web browser <flavell@ph.gla.ac.uk>
    Re: printing to web browser <tadmc@augustmail.com>
    Re: printing to web browser (krakle)
    Re: Remote Permissions Problem <dsgSPAMFILTER@alum.dartmouth.org>
    Re: Special encoded character <yoann.wyffels@iloahosting.com>
    Re: Understanding of *$self <jim.mozley@exponential-e.com>
    Re: Understanding of *$self <bod@optusPANTSnet.com.au>
    Re: using range gives warning  <mritty@gmail.com>
        using range gives warning <mritty@gmail.com>
    Re: using range gives warning <mritty@gmail.com>
    Re: using range gives warning <uguttman@athenahealth.com>
    Re: using range gives warning <nobull@mail.com>
    Re: using range gives warning <mritty@gmail.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: 22 Oct 2004 10:18:09 -0700
From: mike_solomon@lineone.net (Mike Solomon)
Subject: dbd-sybase ppd
Message-Id: <56568be5.0410220918.326f8460@posting.google.com>

I am trying to find a ppd of dbd-sybase to install for perl 5.8

Active state only have it for 5.6

I have searched the web but had no luck

Can anyone here please point me to a place where I can get it

Thanks


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

Date: 22 Oct 2004 17:26:32 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: dbd-sybase ppd
Message-Id: <Xns958A88BDDFCC5asu1cornelledu@132.236.56.8>

mike_solomon@lineone.net (Mike Solomon) wrote in 
news:56568be5.0410220918.326f8460@posting.google.com:

> I am trying to find a ppd of dbd-sybase to install for perl 5.8
> 
> Active state only have it for 5.6
> 
> I have searched the web but had no luck
> 
> Can anyone here please point me to a place where I can get it

Haven't tried it myself, but check 

http://www.peppler.org/downloads/ActiveState/

Sinan.


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

Date: 22 Oct 2004 16:34:58 +0100
From: lesley_b_linux@yahoo.co.yuk
Subject: Re: deciphering emails in PERL
Message-Id: <m3hdomrckd.fsf@helmholtz.local>

"daniel kaplan" <nospam@nospam.com> writes:

> lol, no homework....but am in a small rush
> 
> 
> i really have bneen programming for years, C and Win32...but no C++ and no
> PERL
> 
> so my brain is stuck in C mode for 20 years...hard to just chnge direction


No excuse, Daniel :) I wrote my first C program about 1986 and I used Basic,
Algol, PLAN, Pascal and Assembler for a Motorola chip before that.  I wrote my
first BASIC program in 1975. I've also used Javascript and Java, done some Perl,
HTML and XHTML.  Oh yes and I've done Fortran and COBOL and some wierd ICL
language.  Ooops and some MFC and C++.  
And some shell scripts and DOS batch programs. I've even used IDL (no not the
Interface Definition Language, the Interactive Data Language but thinking
about it I did some of the former on a training course once). And, I freely
admit, to my shame, I did some VB once. But once was enough for that.  Oh yes,
and my first job after graduating from my first degree was working in MS
Basic with something called Microsoft Xenix which went on to become SCO Unix
in the late 1980's.  In the days when all we had was uucp.  Oh yes and I've
used SQL and Informix, SQLServer and ODBC. And some wierd graphical language
for sorting out telephones.  And I had to shift paradigms to grasp Windows
programming. 

I wrote my first BASIC program in 1975 and it was transferred via ticker tape
from the local college to the Polytechnic 12 miles away for processing.

Feel fortunate that you have been able to stay in one language for so long.

Help on my Linux based system is available via :

perldoc perl

When I first started I worked through 

perldoc perlintro 

and have worked through the OO stuff (perlboot, perltoot1, but not yet
perltooc and perlbot), available with my installation of Perl.
perldsc and perldata are also useful. As is perldebtut if you like debuggers.

Get yourself a book.  As a programmer of moderate experience, I found the
Camel book (Programming Perl by Messrs Larry Wall, and Christansen abd Jon
Orwant) a little tedious to get through at times.  Despite that, Ch 5 is the one
I most reference out of it. Chs 28-33 are very useful indeed and there is stuff on
IPC, threading and sockets in there too.  If you only buy one Perl book buy
this one, not because it's concise and easy to read but because it's well
stocked with enough information to keep you busy for years. 

Of the rest of the Perl books I own : 

The Perl Cookbook - funny looking beast with horns - treats you like an adult.
Advanced Perl Programming - nice but distinctly unfriendly cat - slimmer than
the Camel or the Gnu - worth working through.
Algorithms in Perl - depressed or wary looking dingo or fox - computer science
favourites of linked lists, binary trees, random numbers, statistics and
graphs.  Fun for some :)
Perl Debugger - a bird, one of the crow family I think, I suspect a Jay - for
use with the debugger but then 'perldoc perldebtut' is pretty useful too.

If you've been programming C for 20 years you must be in your late thirties
to early 40's.  Age is no barrier.  I'm 45 and a half years old and wrote my
first Perl script 4 years ago without reference to any books or newsgroups,
just what I had on my disk.  It was a form processing CGI script and all I had
was a couple of pointers to the local documentation from a mate and the web.
Might not have been perfect, might have lacked style, might have been completely
inefficient, might have contained gaping holes within the remit of some terms
of 'correctness'  but it worked and did what was required.

To be fair to the other people here, read the posting guidelines.  Look for local
documentation on your machine, buy a book and use both.

Regards

L.


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

Date: Fri, 22 Oct 2004 07:47:47 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Guestbook hacked?
Message-Id: <slrncni0bj.ae6.tadmc@magna.augustmail.com>

Tad McClellan <tadmc@augustmail.com> wrote:
> J.Postma <no@spam.please> wrote:
> 
>> I am using the perl script of Matt version 2.3.1

> (it is crap code, use something else)


I suppose I should have helped to find something else to use:

   http://nms-cgi.sourceforge.net/


And see what Matt himself says about his (early) programs:

   http://nms-cgi.sourceforge.net/about.html


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: 22 Oct 2004 08:40:29 -0700
From: krakle@visto.com (krakle)
Subject: Re: Guestbook hacked?
Message-Id: <237aaff8.0410220740.33b33a72@posting.google.com>

J.Postma <no@spam.please> wrote in message news:<6scgn0pl7ohkjdq74tuk6munfqis6mr1ui@4ax.com>...
> A few times a week I find strange (spam) messages in my guestbook.
> Are the spammers realy visit my site a few times a week, fill in the
> form, and post a reaction in the guestbook or do the have a trick to
> automaticly fill my guestbook???
> 
> I am using the perl script of Matt version 2.3.1
> 
> Thanks,
> J.Postma

You may want to break out of using a 9 year old script.

And who knows what spammers are doing to your site... All we know is
that this is offtopic.


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

Date: 22 Oct 2004 13:17:12 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: Help on Perl Split Function
Message-Id: <Xns958A5E786C7EEasu1cornelledu@132.236.56.8>

Jim Gibson <jgibson@mail.arc.nasa.gov> wrote in news:211020041507350154%
jgibson@mail.arc.nasa.gov:

> By the time perl sees the command line argument, the shell has already
> removed the double quote marks. 

Thank you for catching that. While this is shell-specific, it is important 
to note that without this precaution the FAQ answer would not do one any 
good.

Sinan.


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

Date: 22 Oct 2004 08:46:45 -0700
From: hao.luan@gmail.com (Howard)
Subject: How to monitor a process in system call
Message-Id: <488b743f.0410220746.7d28da93@posting.google.com>

Hi All,

I am using Perl to automatic my regression flow with ASIC
verification. I use system() to call VCS to compile and run the
simulation. I don't have any problem when the compile and run
successfully. However, I got a scenario that I really don't know how
to handle.

When I submit the task using system (vcs ...), sometime simulation
could not finish and stops at cli> and give back the control to unix.
It waits for user input at this point. Normally people types in quit
to let it exit from vcs and keep the regression going.

However, I don't how to do this in Perl to know it sits on cli> and
type in quit and let it keep going.

Any advice?


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

Date: Fri, 22 Oct 2004 16:01:28 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: How to monitor a process in system call
Message-Id: <s9aed.24$jD4.0@trnddc06>

Howard wrote:
> Hi All,
>
> I am using Perl to automatic my regression flow with ASIC
> verification. I use system() to call VCS to compile and run the
> simulation. I don't have any problem when the compile and run
> successfully. However, I got a scenario that I really don't know how
> to handle.
>
> When I submit the task using system (vcs ...), sometime simulation
> could not finish and stops at cli> and give back the control to unix.
> It waits for user input at this point. Normally people types in quit
> to let it exit from vcs and keep the regression going.
>
> However, I don't how to do this in Perl to know it sits on cli> and
> type in quit and let it keep going.

I think you are looking for the Expect module.

jue 




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

Date: Fri, 22 Oct 2004 12:40:48 -0400
From: "daniel kaplan" <nospam@nospam.com>
Subject: list vs array
Message-Id: <1098463265.457208@nntp.acecape.com>

could someone please tell the difference between a "list" and an
"array"...or is it simply the way you reference direct data vs. assigned
data (to a variable) ?

thanks ahead




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

Date: 22 Oct 2004 16:46:59 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: list vs array
Message-Id: <Xns958A8209CDF91asu1cornelledu@132.236.56.8>

"daniel kaplan" <nospam@nospam.com> wrote in news:1098463265.457208
@nntp.acecape.com:

> could someone please tell the difference between a "list" and an
> "array"...or is it simply the way you reference direct data vs. assigned
> data (to a variable) ?

This is a FAQ. Indeed, if you type 

perldoc -q "What is the difference between a list and an array?"

on the command line, or look at perlfaq4 in the documentation installed on 
your computer, you will find the answer.

Have you read the posting guidelines for this group? You need to check the 
FAQ list first.

Sinan.


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

Date: Fri, 22 Oct 2004 13:13:08 -0400
From: "daniel kaplan" <nospam@nospam.com>
Subject: Re: list vs array
Message-Id: <1098465205.879168@nntp.acecape.com>

Ok, may I ask this then?

Since I am not using anything commandline, in fact I had to remove Perl and
Debugger from my machine cause of what it did, I am purely working
remotely....Text here, upload to Server, then run.

What sites then, may I aks, is the main one to go for, fo FAQ?   Like
Perldoc, and Cpan.  I have their links saved, but unsure as to their
relationship..i.e.  which one is the main, etc etc?

thanks ahead




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

Date: 22 Oct 2004 17:20:52 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: list vs array
Message-Id: <Xns958A87C87C80Casu1cornelledu@132.236.56.8>

"daniel kaplan" <nospam@nospam.com> wrote in
news:1098465205.879168@nntp.acecape.com: 

You need to quote enough of the previous messages to give context.

> Since I am not using anything commandline, in fact I had to remove
> Perl and Debugger from my machine cause of what it did,

Let's get one thing straight. Neither Perl nor the debugger did anything to 
your machine. You did it.

> I am purely working remotely....Text here, upload to Server, then run.

Do you have shell access on the server? If so, you can use perldoc on the 
server.
 
> What sites then, may I aks, is the main one to go for, fo FAQ?   Like
> Perldoc, and Cpan.  I have their links saved, but unsure as to their
> relationship..i.e.  which one is the main, etc etc?

http://faq.perl.org/ 

See also: http://faq.perl.org/perlfaq2.html#What_modules_and_ext

http://www.perldoc.com/

Sinan.


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

Date: Fri, 22 Oct 2004 13:30:56 -0400
From: "daniel kaplan" <nospam@nospam.com>
Subject: Re: list vs array
Message-Id: <1098466335.391321@nntp.acecape.com>

> Let's get one thing straight. Neither Perl nor the debugger did anything
to
> your machine. You did it.

Don't take it against Perl...ActiveState took forever to load on my machine,
and the before or after speeds are much higher.  And please, no personal
attacks...know enough about kumputers.

> Do you have shell access on the server? If so, you can use perldoc on the
> server.
Alas, no...working on a shared enviornment, purely in the startup phase.
And at this shared enviornment place, all you get is FTP.  Which is the
"biggest" problem I have here.  When I learned C it was all about
chnage/debug, change/debug, as many times as I needed.  In the situation I
am in it takes much longer.

In fact if anyone could recommend a decent Perl w/debugger shareware, or
something with a good trial period I would appreciate it!

> http://faq.perl.org/
Thanks, found it, but then can I ask what CPAN is?  Is there a relationship?
Are they alternatives?

Thanks ahead




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

Date: Fri, 22 Oct 2004 17:36:23 GMT
From: "Paul Lalli" <mritty@gmail.com>
Subject: Re: list vs array
Message-Id: <rybed.31$PZ4.12@trndny07>

"daniel kaplan" <nospam@nospam.com> wrote in message
news:1098466335.391321@nntp.acecape.com...
> > http://faq.perl.org/
> Thanks, found it, but then can I ask what CPAN is?  Is there a
relationship?
> Are they alternatives?

Do you really not see the irony in saying that you just found the FAQ,
but not checking that FAQ before asking this question?

There is a FAQ that exactly matches your question: "What is CPAN?"

Paul Lalli




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

Date: Fri, 22 Oct 2004 13:53:47 -0400
From: "daniel kaplan" <nospam@nospam.com>
Subject: Re: list vs array
Message-Id: <1098467649.587719@nntp.acecape.com>

> There is a FAQ that exactly matches your question: "What is CPAN?"

I did look, and what I got:  CPAN is the Comprehensive Perl Archive Network,
a large collection of Perl software and documentation. You can begin ......

But I still don't understand the relationship.  Is CPAN a subset of Perl?




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

Date: Fri, 22 Oct 2004 18:06:01 GMT
From: "Paul Lalli" <mritty@gmail.com>
Subject: Re: list vs array
Message-Id: <d_bed.30$eU2.4@trndny05>

"daniel kaplan" <nospam@nospam.com> wrote in message
news:1098467649.587719@nntp.acecape.com...
> > There is a FAQ that exactly matches your question: "What is CPAN?"
>
> I did look, and what I got:  CPAN is the Comprehensive Perl Archive
Network,
> a large collection of Perl software and documentation. You can begin
 ......
>
> But I still don't understand the relationship.  Is CPAN a subset of
Perl?

What part of "a large collection of Perl software and documentation" is
unclear?  And what do you mean by "subset" of Perl?  Perl is a language.
CPAN is a large collection of sofware written in that language and
documentation about that language.

Paul Lalli




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

Date: Thu, 21 Oct 2004 22:20:48 +0100
From: Ben Morrow <usenet@morrow.me.uk>
Subject: Re: localizing %SIG handlers
Message-Id: <gqll42-j35.ln1@osiris.mauzo.dyndns.org>


Quoth anno4000@lublin.zrz.tu-berlin.de (Anno Siegel):
> Charles DeRykus <ced@bcstec.ca.boeing.com> wrote in comp.lang.perl.misc:
> >
> > unless ( defined sigprocmask(SIG_BLOCK, $sigset, $old_sigset) ) {
> >    die "can't block SIGHUP\n";
> > } else {
> >    local $SIG{ HUP} = sub { $count_b ++ };
> >    unless ( defined sigprocmask(SIG_UNBLOCK, $old_sigset) ) {
> >       die "can't unblock SIGHUP\n";  # restore
> >    }
> >    ...
> > }
> 
> That's a way around, but it shouldn't be needed.

However, it suggests a third, I think rather attractive alternative to
the two I suggested earlier, namely that $SIG{FOO} = undef; should mask
SIGFOO... This suffers from the same potential breakage of scripts that
rely on undef ~~ 'DEFAULT', and will also require %SIG to be initialised
to all 'DEFAULT', but I feel it could be quite useful in the right
circumstances...

Comments? Or should I take this to p5p?

Ben

-- 
"If a book is worth reading when you are six,                * ben@morrow.me.uk
it is worth reading when you are sixty." - C.S.Lewis


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

Date: Fri, 22 Oct 2004 23:00:43 +0800
From: "Kelvin" <thefatcat28@hotmail.com>
Subject: Online forum source codes in Perl/CGI without SQL?
Message-Id: <clb56l$2v3$1@reader01.singnet.com.sg>

Is there any forum source code (open source) that doesn't use SQL database?
My website package doesn't give me SQL service :(




---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.773 / Virus Database: 520 - Release Date: 05/10/2004




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

Date: 22 Oct 2004 08:09:18 -0700
From: jl_post@hotmail.com (J. Romano)
Subject: Re: overriding perl switch
Message-Id: <b893f5d4.0410220709.13e27864@posting.google.com>

"sravi" <sravi.in@gmail.com> wrote in message news:<1098077002.510869.242450@f14g2000cwb.googlegroups.com>...
> I have a perl switch -w in my program
> #!/usr/bin/perl -w
> 
> If i invoke this program, from the shell it is invoked
> with -w switch. Is there a way i can override this?
> That is i should be able to invoke this without -w switch.
> 
> If i invoke this script like this
> /usr/bin/perl <script>
> the -w switch is also enabled. Is there a way to override
> this? Please help.


Dear sravi,

   I'm giving you a response based on the assumption that you want to
know how to override any switch, not just the -w switch.

   Of course, the obvious way to "undo" a switch is to use your
favorite text editor and remove that switch manually.  Save your
changes, and viola'!  The switch is no more!

   Granted, you may want to just suppress the switch's behavior
without editing the file.  I question why you would want to do this,
but in case you really, really want to, here is a way you can suppress
all the switches:

Say that you want to run a script called myscript.pl as if it didn't
have any switches.  You can run it like this:

      perl -pe "BEGIN{<>}" myscript.pl | perl

   I still wonder why you would want to disable certain switches in a
Perl script.  Whatever the reason, if you should use this approach and
end up making things worse for yourself (due to the fact that undo-ing
the switches often causes more harm than good), you have nobody to
blame but yourself.  In other words, I recommend against disabling any
switch you didn't put in yourself.

   -- J.


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

Date: Fri, 22 Oct 2004 14:37:48 +0100
From: Chris Cole <ithinkiam@gmail.com>
Subject: Re: printing to web browser
Message-Id: <pan.2004.10.22.13.37.46.679958@gmail.com>

On Fri, 22 Oct 2004 06:15:30 -0500, Tad McClellan wrote:

> Paul Robson <autismuk@autismuk.freeserve.co.uk> wrote:
>> On Thu, 21 Oct 2004 15:24:05 -0700, Jim Gibson wrote:
>> 
>>> In article <1098395030.248283@nntp.acecape.com>, daniel kaplan
>>> <nospam@nospam.com> wrote:

<snip>
> 
> Experienced Perl programmers don't spell it "PERL", because
> it is not an acronym.

I beg to differ ;-) 
From the Perl manpage:

NAME
       perl - Practical Extraction and Report Language


Chris.


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

Date: Fri, 22 Oct 2004 14:39:10 +0100
From: "Alan J. Flavell" <flavell@ph.gla.ac.uk>
Subject: Re: printing to web browser
Message-Id: <Pine.LNX.4.61.0410221438010.4061@ppepc56.ph.gla.ac.uk>

On Fri, 22 Oct 2004, Tad McClellan wrote:

> If you call it PERL then you do not know the secret handshake.

The Perl FAQ is surely only a "secret" to those who treat this
group as a write-only medium.


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

Date: Fri, 22 Oct 2004 09:10:14 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: printing to web browser
Message-Id: <slrncni566.amg.tadmc@magna.augustmail.com>

Chris Cole <ithinkiam@gmail.com> wrote:
> On Fri, 22 Oct 2004 06:15:30 -0500, Tad McClellan wrote:

>> Experienced Perl programmers don't spell it "PERL", because
>> it is not an acronym.
> 
> I beg to differ ;-) 


You know better than the Perl FAQ?


   What's the difference between "perl" and "Perl"?

   One bit.  Oh, you weren't talking ASCII? :-) Larry now uses "Perl" to
   signify the language proper and "perl" the implementation of it,
   i.e. the current interpreter.  Hence Tom's quip that "Nothing but perl
   can parse Perl."  You may or may not choose to follow this usage.  For
   example, parallelism means "awk and perl" and "Python and Perl" look
   OK, while "awk and Perl" and "Python and perl" do not.  But never
   write "PERL", because perl is not an acronym, apocryphal
   folklore and post-facto expansions notwithstanding.


> From the Perl manpage:
> 
> NAME
>        perl - Practical Extraction and Report Language


If it was an acronym it would have been spelled in ALL CAPS.

It appears that you have helped to prove my point. Thanks!

It is not an acronym, it is what might be called a "backronym"
since the word came first and the expansion of the letters in
the word came later.


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: 22 Oct 2004 08:43:31 -0700
From: krakle@visto.com (krakle)
Subject: Re: printing to web browser
Message-Id: <237aaff8.0410220743.144e0d4e@posting.google.com>

Jim Gibson <jgibson@mail.arc.nasa.gov> wrote in message news:<211020041524059555%jgibson@mail.arc.nasa.gov>...
> In article <1098395030.248283@nntp.acecape.com>, daniel kaplan
> <nospam@nospam.com> wrote:
> 
> > still new to PERL, anyway  write now i do all OUTPUTTING to the web browser
> > with:
> 
> Experienced Perl programmers don't use all CAPS.

Then why did you use CAPS?


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

Date: Fri, 22 Oct 2004 09:17:22 -0400
From: "David Gale" <dsgSPAMFILTER@alum.dartmouth.org>
Subject: Re: Remote Permissions Problem
Message-Id: <2tsfg8F22jutnU1@uni-berlin.de>

Quoth Jon Ericson <Jon.Ericson@jpl.nasa.gov>:
> "David Gale" <dsgSPAMFILTER@alum.dartmouth.org> writes:
>
>> PS: I'm sure someone's going to suggest setting up ssh keys for
>> passwordless access, but our sysadmin doesn't want to do that, since
>> that would give anyone who managed to crack one box passwordless
>> access to the server.
>
> This isn't really a perl question you know -- you're likely to get
> better advice from an ssh or security group.  I would have suggested
> using ssh keys (which is how I've solved this sort of problem).  Maybe
> ssh-agent would help, though I haven't needed to use it myself.
>
> Jon

True, this aspect of it isn't specifically a perl problem.  However, my
current attempt is to use Perl::Expect; I'm just not sure how to tell if the
process completes successfully--does expect give you access to the exit
value of the process once its terminated?  How do you access it?

This question, at least, seems to be group-appropriate.  Perhaps I wasn't
clear enough in my original post.

-D.





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

Date: Fri, 22 Oct 2004 18:48:27 +0200
From: "Yoann Wyffels" <yoann.wyffels@iloahosting.com>
Subject: Re: Special encoded character
Message-Id: <417939a3$0$8961$636a15ce@news.free.fr>

> This script might help...but it might corrupt your terminal.
> remember "reset".
>
> #!/usr/bin/perl -C
> # by Tim Toady of perlmonks
> #show-unicode.pl
>
> binmode STDOUT, ":utf8";
> $pat = "@ARGV";
> if (ord $pat > 256) {
>    $pat = sprintf("%04x", ord $pat);
> }
>   elsif (ord $pat > 128) {        # arg in sneaky UTF-8
>     $pat = sprintf("%04x", unpack("U0U",$pat));
> }
>
> @names = split /^/, do 'unicore/Name.pl';
>
> for (@names) {
>  if (/$pat/io) {
>      $hex = hex($_);
>      print chr($hex),"\t",$_;
>   }
> }
>
> __END__
>
>
> -- 
> I'm not really a human, but I play one on earth.
> http://zentara.net/japh.html



Hi,

Don't really understand the script, can u explain ?

Thx.
Yoann. 




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

Date: Fri, 22 Oct 2004 14:12:45 +0100
From: Jim Mozley <jim.mozley@exponential-e.com>
Subject: Re: Understanding of *$self
Message-Id: <2tsf8iF23m64kU1@uni-berlin.de>

Anno Siegel wrote:

> Why would you want to make that change?  It doesn't make sense.

I was just trying different things to see is it would help my 
understanding, sorry for causing confusion.

> 
> 
>>I get the error:
>>
>>"Not a HASH reference at.."
> 
> 
> Of course.  Your objects are globs, so you must access them as
> globs.  You'd see the same error if they were scalars or arrays or
> what-have-you.
> 
> 
>>Using Data::Dumper on my instance variable I get...
>>
>>$VAR1 = bless( \*Symbol::GEN0, 'Ee::Net::Device' );
>>
>>So I assume that as the error tells me my instance is not a ref to a 
>>hash. That's where my understanding ends at the moment.
> 
> 
> Then ask concrete questions.  The complete explanation is in the
> docs.  If all you say is "I don't get it", there is little we can
> do.

OK I'll try...

What does the *$self represent (i know it's the object)? Is it a 
reference to a specific symbol table ( Symbol::GENO )?

Knowing this might help me understand ${*$self}{hash_ref}. Does this 
mean get the value of the key hash_ref from the hash referenced by the 
scalar in the symbol table? Not sure that makes sense to me, let me try 
again. Does ${*$self} mean get the scalar from the symbol table 
referenced by $self? As the scalar is a reference one can follow this to 
the hash and get the value of the key hash_ref.

Jim Mozley


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

Date: Sat, 23 Oct 2004 01:40:13 +1000 (EST)
From: Brendan O'Dea <bod@optusPANTSnet.com.au>
Subject: Re: Understanding of *$self
Message-Id: <clb9kt$ees$1@ernie.optusnet.com.au>

In article <2ts7e1F226h5oU1@uni-berlin.de>,
Jim Mozley  <jim.mozley@exponential-e.com> wrote:
>I am writing a sub class of Net::Telnet that is specific for our 
>companies network devices. I have looked at Net::Telnet::Cisco as an 
>example of this and have what I want working. However, I have done this 
>by copying what is done in that module but I don't understand it! As 
>this is a bad thing I am seeking understanding of what it does and why.
>
>In the Net::Telnet::Cisco new method...
>
>$self = $class->SUPER::new(@_) or return;
>*$self->{net_telnet_cisco} = {
>	<snip hash key => values>
>};
>
>And in order to access the hash in other methods...
>
>$ {*$self}{net_telnet_cisco}{last_cmd}
>
>(^ the space above is in the module code)
>
>Can someone please explain the use of *$self in creating the object 
>instance and retrieving it's attributes? I'm assuming this is something 
>to do with filehandles and having to use typeglobs?

Correct.  See the section on "I/O Operators" in perlop(1).  Specifically
where it discusses what angle brackets may contain:  basically either
the name of a filehandle, a typeglob, or a typeglob reference.

Now also take a look at the section on "Tying FileHandles" in
perltie(1).

While the latter document would seem to indicate that you can use
any old reference as $self, the trick used by the IO::* classes (which
Net::Telnet::Cisco is heir to) to allow the object returned by "new"
work as <$fh> without an explicit tie is to use a reference to a glob as
$self.

The upshot of which is that if you want to store instance data in the
object, you need to get yourself a hash--which can be achieved by
dereferencing the glob ref to a glob (*$self) and then using that as the
"name" of a hash.

An example of how this works would be:

  $ perl -le '%x; $gr = \*x; ${*$gr}{foo} = 42; print $x{foo}'
  42

IO::Handle and decendents use Symbol::gensym to fetch a unique glob per
filehandle to prevent collisions.

--bod

Remove PANTS to reply.


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

Date: Fri, 22 Oct 2004 17:41:59 GMT
From: "Paul Lalli" <mritty@gmail.com>
Subject: Re: using range gives warning 
Message-Id: <HDbed.110$Xq3.65@trndny01>

"Paul Lalli" <mritty@gmail.com> wrote in message
news:zrbed.35$9R4.19@trndny09...
> I seem to have found an odd ... well, I don't want to say "bug",
because
> that would be arrogant of me.  Nonetheless, I am thoroughly confused.
> Perhaps someone can help explain:
>
> use strict;
> use warnings;
> my @foo;
> $foo[0] = (6..10);
> print "Foo: @foo\n";
> __END__
>
> This small program returns a warning:
> Use of uninitialized value in range (or flip) at - line 4.

And now I realize my error - I wasn't using .. to create a list, I was
using the scalar "flip" operator without realizing it, because I was
assigning to a scalar.  And the "uninitialized value" refers to the $.
variable, because I'm not reading a file.

Apologies for wasting bandwidth.  Really wish I could retract this whole
thread...

Paul Lalli





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

Date: Fri, 22 Oct 2004 17:29:03 GMT
From: "Paul Lalli" <mritty@gmail.com>
Subject: using range gives warning
Message-Id: <zrbed.35$9R4.19@trndny09>

I seem to have found an odd ... well, I don't want to say "bug", because
that would be arrogant of me.  Nonetheless, I am thoroughly confused.
Perhaps someone can help explain:

use strict;
use warnings;
my @foo;
$foo[0] = (6..10);
print "Foo: @foo\n";
__END__

This small program returns a warning:
Use of uninitialized value in range (or flip) at - line 4.

And output of:
Foo:

If I switch line four to:
$foo[0] = (6,7,8,9,10);
I get the output I expect (four warnings about using a scalar in void
context, followed by assigning $foo[0] to 10).

This gets more bizzare if I add
use diagnostics;
after use warnings.  Rather than pulling the correct warning explanation
from perldiag, the warning disappears altogether.

I have verified this on Perl 5.8.0 on solaris, and 5.8.3 (ActiveState)
on Win2k.

Can someone explain to me what's going on?  Why would using a range of
6..10 produce a warning like that, when the expansion does not?

Oh, and just to explain the code - it was written to help explain to
someone a situation in which using @foo[0] instead of $foo[0] would
produce incorrect results, rather than simply a warning message.

Thank you,
Paul Lalli

-- 

--
Paul Lalli
Senior Software Engineer
ES11 Information Systems
8 Stanley Circle, Suite #8
Latham, NY 12110
p 518-782-1111
f  518-782-1212
e pdl@es11.com




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

Date: Fri, 22 Oct 2004 17:38:17 GMT
From: "Paul Lalli" <mritty@gmail.com>
Subject: Re: using range gives warning
Message-Id: <dAbed.12$CX4.2@trndny06>

"Paul Lalli" <mritty@gmail.com> wrote in message
news:zrbed.35$9R4.19@trndny09...
> I seem to have found an odd ... well, I don't want to say "bug",
because
> that would be arrogant of me.  Nonetheless, I am thoroughly confused.
> Perhaps someone can help explain:
>
> use strict;
> use warnings;
> my @foo;
> $foo[0] = (6..10);
> print "Foo: @foo\n";
> __END__
>

I should have tried this first, of course, so my apologies.  But this
odditty is demonstrated in simpler terms without the array messiness:

use strict;
use warnings;
my $foo;
$foo = (6..10);
print "Foo: $foo\n";
__END__

(The rest of my post still applies to this new code, so I'm leaving it
intact below)

Paul Lalli


> This small program returns a warning:
> Use of uninitialized value in range (or flip) at - line 4.
>
> And output of:
> Foo:
>
> If I switch line four to:
> $foo[0] = (6,7,8,9,10);
> I get the output I expect (four warnings about using a scalar in void
> context, followed by assigning $foo[0] to 10).
>
> This gets more bizzare if I add
> use diagnostics;
> after use warnings.  Rather than pulling the correct warning
explanation
> from perldiag, the warning disappears altogether.
>
> I have verified this on Perl 5.8.0 on solaris, and 5.8.3 (ActiveState)
> on Win2k.
>
> Can someone explain to me what's going on?  Why would using a range of
> 6..10 produce a warning like that, when the expansion does not?
>
> Oh, and just to explain the code - it was written to help explain to
> someone a situation in which using @foo[0] instead of $foo[0] would
> produce incorrect results, rather than simply a warning message.
>
> Thank you,
> Paul Lalli




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

Date: Fri, 22 Oct 2004 13:42:27 -0400
From: Uri Guttman <uguttman@athenahealth.com>
Subject: Re: using range gives warning
Message-Id: <m3k6ti6458.fsf@linux.local>

>>>>> "PL" == Paul Lalli <mritty@gmail.com> writes:

  PL> use strict;
  PL> use warnings;
  PL> my $foo;
  PL> $foo = (6..10);

range is very different in list and scalar contexts. rtfm. :)

uri


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

Date: Fri, 22 Oct 2004 18:42:26 +0100
From: Brian McCauley <nobull@mail.com>
Subject: Re: using range gives warning
Message-Id: <clbghd$hqd$1@sun3.bham.ac.uk>



Paul Lalli wrote:

> I seem to have found an odd ... well, I don't want to say "bug", because
> that would be arrogant of me.  Nonetheless, I am thoroughly confused.
> Perhaps someone can help explain:
> 
> use strict;
> use warnings;
> my @foo;
> $foo[0] = (6..10);

 > This small program returns a warning:
 > Use of uninitialized value in range (or flip) at - line 4.

You appear to be confused by the behaviour of the range operator.

Have you considered the possibility of reading the explaination of the 
behaviour of the range operator in the reference manual?  (At least as 
far as the end of the first sentence).

Looking up the thing you are confused about in the reference manual 
should come earlier in you problem solving path than posting to Usenet.

Range Operators

        Binary ".." is the range operator, which is really two
        different operators depending on the context.  In list
        context, it [ is a range operator and does what you expect]

        In scalar context, ".." [it is a "flip" operator and does
        something else entirely].

If you read the description of the something else it will become clear 
that it is the special variable $. that is undefined.



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

Date: Fri, 22 Oct 2004 17:48:55 GMT
From: "Paul Lalli" <mritty@gmail.com>
Subject: Re: using range gives warning
Message-Id: <bKbed.460$Ae3.99@trndny02>

"Brian McCauley" <nobull@mail.com> wrote in message
news:clbghd$hqd$1@sun3.bham.ac.uk...
> You appear to be confused by the behaviour of the range operator.
>
> Have you considered the possibility of reading the explaination of the
> behaviour of the range operator in the reference manual?  (At least as
> far as the end of the first sentence).
>
> Looking up the thing you are confused about in the reference manual
> should come earlier in you problem solving path than posting to
Usenet.

Yup.  And in fact, I did read perldoc perlop prior to posting - but
because of the circumstance in which I found this error, I was looking
for an explanation regarding something that had to do with assigning to
an array element.  It simply didn't occur to me that I was using scalar
context.

My apologies again

Paul Lalli




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

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.  

NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice. 

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


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