[8091] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1710 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Jan 22 23:07:30 1998

Date: Thu, 22 Jan 98 20:00:19 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Thu, 22 Jan 1998     Volume: 8 Number: 1710

Today's topics:
    Re: ? random text string <scottj@mthcsc.wfu.edu>
    Re: @ == @, comparing arrays (Tad McClellan)
    Re: Command line file editing/substitution (Spike Hernandez)
    Re: DOS: command line wildcards (Brendan Macmillan)
    Re: DOS: command line wildcards (Martien Verbruggen)
    Re: DOS: command line wildcards (Brendan Macmillan)
    Re: FAQ too big (Was: Re: PERL forking) <jt@epix.net>
    Re: How can i find files in dir. (Martien Verbruggen)
    Re: How can i find files in dir. (Tad McClellan)
        HOw to check for file existence in each home directory  <roberts_d@bms.com>
    Re: New Perl-Oriented Web Site has materials not availa (Martien Verbruggen)
    Re: Oraperl / DBD / Perl5 Performance : problems with A <anatolii.belomestnov@gecapital.com>
        Perl 5.004_04 memory bug <rohan.oberoiTAKETHISOUT@cornell.edu>
        Please please help a beginner... <lobsanov_family@email.msn.com>
        RADIUS accounting processing routines ? <courcoul@campus.qro.itesm.mx>
        relational operators and negative numbers (Michael Rocchetti)
        Retrieving pages from a secure Web site. <daryl@stonemicro.com.au>
    Re: Reverse of ReadParse (Tad McClellan)
    Re: space searching? <tchrist@mox.perl.com>
        UNIX to %$$@! Win: Script Won't Go (N.A.F. McNelly)
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Thu, 22 Jan 1998 22:16:40 -0500
From: Kevin Scott <scottj@mthcsc.wfu.edu>
Subject: Re: ? random text string
Message-Id: <34C80B98.328558A7@mthcsc.wfu.edu>

Lars Kr. Lundin wrote:
> 
> Can anybody tell me how to produce a random text string that matches
> /^\w{8}$/ ?
> 
> I would be surprised if it is difficult...
> 
[snip]

You can do it with rand() and a lookup table.  For example:

	@table = ('0'..'9','a'..'z','A'..'Z');
	srand(time,$$);
	foreach $i (1..8) {
		$randstr .= $table[rand($#table+1)];
	}

If the rand formulation looks suspicious to you, just recall that 
rand returns fractional expressions.

Hope this helps.
Kevin.

-- 
******  Kevin Scott
*******  Department of Mathematics & Computer Science
********  Wake Forest University
*******  scottj@mthcsc.wfu.edu
******  http://www.wfu.edu/~scotjk98


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

Date: Thu, 22 Jan 1998 20:02:55 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: @ == @, comparing arrays
Message-Id: <fot8a6.p45.ln@localhost>

Martien Verbruggen (mgjv@comdyn.com.au) wrote:
: In article <34C792B6.21A7@wco.com>,
: 	Steven Smith <steves@wco.com> writes:
: > I had assumed that @a1 == @a2 would compare two arrays and
: > tell me if they were the same.  It doesn't and that makes
: > sense to me -- we're taking the arrays into scalar context
: > and comparing the number of elements in each group, right?

: yep.

[snip]

: If you had done a search on dejanews for: 

: 	[~g:comp.lang.perl.misc +arrays +compare]

: You would have found these answers as well.


Or even if you had searched for 'array' in the questions in the
Perl FAQ, part 4:

   "How do I compute the difference of two arrays?  
    How do I compute the intersection of two arrays?"


If the set difference is empty for both orders (@a1,@a2 and @a2,@a1)
then the sets are equal.


--
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: Fri, 23 Jan 1998 01:04:02 GMT
From: webmaster@gardenweb.com (Spike Hernandez)
Subject: Re: Command line file editing/substitution
Message-Id: <34c7ec51.20389504@news.digex.net>

On 23 Jan 1998 00:37:56 GMT, mgjv@comdyn.com.au (Martien Verbruggen)
wrote:

>Your shell is probably expanding $1 before perl ever sees it. Use
>single quotes or escape the $:
>
>perl -p -i -e 's/(fred)\w+/$1/;' filename
>
>Martien


Martien,

Yes that was it! Thanks very much for the help!

Spike


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

Date: 23 Jan 1998 01:07:00 GMT
From: bren@fangorn.cs.monash.edu.au (Brendan Macmillan)
Subject: Re: DOS: command line wildcards
Message-Id: <6a8qfk$iql$1@towncrier.cc.monash.edu.au>

Gabor (gabor@vinyl.quickweb.com) wrote:
: In comp.lang.perl.misc, B Macmillan <bren@fangorn.cs.monash.edu.au> wrote :

: # 	perl -n test.pl *.dat
: # but the wildcard does not seem to be expanded into all the matching
: # filenames! This is a fundamental feature of tools like grep and awk -

: It's not a feature of the tools.  It's the shell's feature, a real
: shells's, that is.
Hmm.. true of the (original) unix tools; but the DOS ports I have of
these tools do have this feature... I'm using 16 bit DOS 5.0, BTW
 
: # how do I get perl to do it?
: It's the shell that is supposed to expand the wildcard.  In DOS, if I
: recall correctly, the shell doesn't expand wildcards.  So you have to
: do it yourself.  

Sort of goes against the idea of Perl, doesn't it? Quoting from the
preface of Camel book:

	"Perl is different. In a nutshell, Perl is designed to make the
easy jobs easy, without making the hard jobs impossible."

OTOH, this was surely talking about the Unix version of Perl, which
does have access to a real shell.

-- 
Brendan Macmillan


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

Date: 23 Jan 1998 01:54:15 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: DOS: command line wildcards
Message-Id: <6a8t87$d2p$2@comdyn.comdyn.com.au>

In article <6a8qfk$iql$1@towncrier.cc.monash.edu.au>,
	bren@fangorn.cs.monash.edu.au (Brendan Macmillan) writes:

>: # how do I get perl to do it?
>: It's the shell that is supposed to expand the wildcard.  In DOS, if I
>: recall correctly, the shell doesn't expand wildcards.  So you have to
>: do it yourself.  
> 
> Sort of goes against the idea of Perl, doesn't it? Quoting from the
> preface of Camel book:
> 
> 	"Perl is different. In a nutshell, Perl is designed to make the
> easy jobs easy, without making the hard jobs impossible."

Irrelevant. the perl script expects a list of files in @ARG. The fact
that unix type shells do globbing for you, and replace globs with an
actual list of files has nothing to do with perl. Perl is designed ot
make jobs easy, but perl was not designed to do everything for you.
Surely you don't suggest that perl should have all the internals of a
full OS in it, do you? I mean, there are things which can be done on
Unices, but not on DOS/Win32, e.g. symbolic links.

I want to create a FIFO(*) special file on my DOS box running DOS 1.12,
how can I do that with perl?

I want to use 18 GB of internal memory, but DOS won't allow it. How
can perl fix this?

You see, there are things that perl cannot fix. What your shell does
with a glob expression is something that is totally outside of perl's
control. I suggest you either get a shell that does it (and yes, there
are some), or use one of the perl builtin globbing functions, or one
of the globbing modules (there is one for DOS style, and one for ksh
style, I think.

Even perl has to succumb to the GIGO(**) rules.

Martien

(*) First In, First Out
(**) Garbage In, Garbage Out
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | Advertising:  The science of arresting
Commercial Dynamics Pty. Ltd.       | the human intelligence long enough to
NSW, Australia                      | get money from it.


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

Date: 23 Jan 1998 03:27:39 GMT
From: bren@fangorn.cs.monash.edu.au (Brendan Macmillan)
Subject: Re: DOS: command line wildcards
Message-Id: <6a92nb$p3i$1@towncrier.cc.monash.edu.au>

Martien Verbruggen (mgjv@comdyn.com.au) wrote:
: > 	"Perl is different. In a nutshell, Perl is designed to make the
: > easy jobs easy, without making the hard jobs impossible."
: 
: Perl is designed to make jobs easy, but perl was not designed to
: do everything for you.

Perl was designed to work with a shell that does these things for you?
The statement seems perfectly true in that context.


: I suggest you either get a shell that does it (and yes, there are some),
I've looked long and hard for unix-style shells for DOS; but I haven't
found a nice, small one yet - if you can reccommend one, I'd be happy
yo try it.

: or use one of the perl built-in globbing functions,
Perl 4.0 doesn't seem to have the glob fn:
	while (<*>) {print;}
does nothing.

: or one of the globbing modules (there is one for DOS style, and one for
: ksh style, I think.
These are for Perl 5.0, aren't they?
 

Perhaps my question should be: how can I expand the wildcards in perl?

If it has to be written in great detail, I'm probably really better
off staying with awk.

-- 
Brendan Macmillan


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

Date: Thu, 22 Jan 98 21:35:38 -0500
From: "Julian Thomas" <jt@epix.net>
Subject: Re: FAQ too big (Was: Re: PERL forking)
Message-Id: <34c80211$1$wg$mr2ice@news.epix.net>

In <34cbccc2.9107443@news.tornado.be>, on 01/21/98 
   at 10:58 AM, bart.mediamind@tornado.be (Bart Lateur) said:

>Not everybody uses Unix, where you can use grep to look it up for you...
>On a PC, you have to (manually) open and search through 9 documents.

Look harder for grep for dos.
 
-- 
 Julian & Mary Jane Thomas
 jt@epix.net  http://www.epix.net/~jt
 In the beautiful Finger Lakes Wine Country of New York State!
 --------------------------------------------------
 In toto . . . does NOT mean "Dorothy's dog ate it!"




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

Date: 23 Jan 1998 00:43:20 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: How can i find files in dir.
Message-Id: <6a8p38$cj7$9@comdyn.comdyn.com.au>

(Original article didn't arrive at my server yet, and there was
nothing quoted, so I don't know the original question)

In article <34C7D74F.D688EA9C@nowhere.net>,
	adam <none@nowhere.net> writes:
> you can say: 
> 	
> 	opendir DIR, "$path_to_directory";
> 	@files = readdir (DIR);
> 	closedir DIR;
> 	
> 	@html_files = grep { /.htm/i } @files;

Of course, you could do that in one step:

@files = grep { /\.html?$/i } readdir(DIR);

I also changed the regexp a little bit, so it won't match files with
names like

this_is_not_html
htm_htm.gif
notHtml.jpg
this_is_htmspecialstuff

Assuming that the original question was something like 'how do I get
all html files in a directory?'.
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | That's not a lie, it's a terminological
Commercial Dynamics Pty. Ltd.       | inexactitude.
NSW, Australia                      | 


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

Date: Thu, 22 Jan 1998 20:09:59 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: How can i find files in dir.
Message-Id: <n5u8a6.p45.ln@localhost>

brian d foy (comdog@computerdog.com) wrote:
: In article <34C67A50.327@cse.bridgeport.edu>, seong@cse.bridgeport.edu posted:


: >My question is that How can i find files with extention 'html' or
: >'htm'.  

: my @files = grep /\.html?$/, readdir DIRHANDLE;

: as seen in the readdir documentation;

: >As you can see from my subroutine, this will search all of html and htm
: >files on specific dir recursively.
                         ^^^^^^^^^^^
                         ^^^^^^^^^^^
: >Please help me to make this subroutin work.


Golly. Three followups so far, all ignoring that part.



use File::Find;

 ...to do the recursive searching, and the grep/readdir from other 
followups in each directory.


--
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: Thu, 22 Jan 1998 17:38:14 -0500
From: Dan Roberts <roberts_d@bms.com>
Subject: HOw to check for file existence in each home directory of Unix users
Message-Id: <34C7CA56.198FA24F@bms.com>

Hello

What I need to do is check for the existence of a .forward file in each
of my users homme directories.
Then, if there is no .forward file in the users hoem dir I would get
that users loginid
printed to a file.
Can someone help me out here??..>thanks!!!.Dan


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

Date: 23 Jan 1998 00:51:11 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: New Perl-Oriented Web Site has materials not available elsewhere
Message-Id: <6a8phv$cj7$10@comdyn.comdyn.com.au>

In article <6a8kar$9ch$1@news1.teleport.com>,
	Mark-Jason Dominus <mjd@plover.com> writes:
> 
> My Perl Paraphernalia web site, at
> 
> 	<URL:http://www.perl.com/~mjd/perl>

nope. not there. Maybe you mean http://www.plover.com/~mjd/perl/?

Thanks for putting it on-line anyway :)

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | I'm just very selective about what I
Commercial Dynamics Pty. Ltd.       | accept as reality - Calvin
NSW, Australia                      | 


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

Date: Thu, 22 Jan 1998 09:08:22 -0500
From: Anatolii Belomestnov <anatolii.belomestnov@gecapital.com>
To: Mark Rostron <mwrostron@imation.com>
Subject: Re: Oraperl / DBD / Perl5 Performance : problems with APACHE::DBI implmentation on HPUX10.20/oracle7.3.3
Message-Id: <34C752D6.C64905DC@gecapital.com>

Mark,

at this point, when you compile mod_perl, the DBI and DBD::Oracle
modules are better be installed into perl location.
Since they wont end up in the libperl.a anyway, you have to link
them to the httpd executable by including the modules (.a)
into PERL_STATIC_EXTS variable,
to find the ones to link I did the following command

# uname -a 
HP-UX crefsdev B.10.20 A 9000/847 1436314251 two-user license
# cd /opt/perl5/lib/site_perl
# find ./ -name "*.a"  
 ./PA-RISC1.1/auto/DBI/DBI.a
 ./PA-RISC1.1/auto/DBD/Oracle/Oracle.a
 ./PA-RISC1.1/auto/MIME/Base64/Base64.a
 ./PA-RISC1.1/auto/Data/Dumper/Dumper.a
 ./PA-RISC1.1/auto/MD5/MD5.a
 ./PA-RISC1.1/auto/Parse/ePerl/ePerl.a
# 

you take the names between 'auto' and *.a name and put them into the PERL_STATIC_EXTS
with '::' between the doubled words:

perl Makefile.PL EVERYTHING=1 PERL_STATIC_EXTS="DBI DBD::Oracle MIME::Base64 Data::Dumper MD5 Parse::ePerl"

By the way, do the EVERYTHING=1 instead of PERL_STACKED_HANDLERS=1 
it'll give you more options.

NOTE: Make sure all of those modules are 'make install'--ed before you build mod_perl

Let me know what happens
Anatolii

> perl Makefile.PL PERL_STATIC_EXTS=DBI PERL_STACKED_HANDLERS=1
> 
> this will successfully link httpd, but now when I run httpd, I get the
> following message:



Mark Rostron wrote:
 
 Hi,
 
 We are using a CGI interface to oraperl as Tim describes below:
 ora_login("","scott/secret_password@instance","")
 
 performance varies but is generally a little on the slow side compared with
 pre-compiled queries you would have gotten from your old faithful character
 based forms, due mainly I think to overhead of new connection made to the
 database for every query (CGI).
 
 We have mostly used small cache values in the ora_open calls due to
 requirement by design for each page access to be short (about 100-200
 rows) - hence the queries need to be carefully thought through - to avoid
 network hit and wait time on browser side.
 
 We have done some work on building a prototype data dictionary model which
 maps over a sql query result set resulting in auto-formatted tables in HTML,
 using CGI.pm as the driver. We have also had some success in generating
 clickable histograms as GIF image maps by filtering a query set, generating
 a set of rectangular coords to feed into GD and also to generate the <MAP>
 tags.
 
 In order to get better performance I am now attempting to implement
 Apache::DBI and make use of persistent connections. Apache standalone
 compiles and links like a dream, but implementing DBI has had no luck yet.
 
 to get it to statically link the DBD-Oracle, I use the following to tack-on
 mod-perl:
 
 perl Makefile.PL PERL_STATIC_EXTS=DBI PERL_STACKED_HANDLERS=1
 
 this will successfully link httpd, but now when I run httpd, I get the
 following message:
 
 Null FIlename used at (eval 4) level 1
 
 Still working through this - dont know if it's the link, the
 perl_stacked_handlers or what?
 
 anyone care to input ?
 
 thnx
 mr


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

Date: 22 Jan 1998 16:59:02 GMT
From: Rohan Oberoi <rohan.oberoiTAKETHISOUT@cornell.edu>
Subject: Perl 5.004_04 memory bug
Message-Id: <6a7tsm$t7n@newsstand.cit.cornell.edu>

I seem to have uncovered a bug in Perl, based on the fact that I'm getting
SEGV core dumps, which I believe I shouldn't get under any circumstances.
Unfortunately, I only get these after running several copies of my (fairly 
complicated, ~800 lines) script for close to an hour, so it's hard to pin
down the bug (that's also why I hesitate to use perlbug).  Not all the 
processes get SEGV: it seems like some of them randomly step into areas of
memory they shouldn't be in when they're pushing the limits of the system 
memory.

Here's perl -V, in case there's anything obviously wrong with my version:

----------------------------------------------------------------------------
Summary of my perl5 (5.0 patchlevel 4 subversion 4) configuration:
  Platform:
    osname=solaris, osvers=2.5.1, archname=sun4-solaris
    uname='sunos kernighan 5.5.1 generic_103640-12 sun4u sparc sunw,ultra-1 '
    hint=recommended, useposix=true, d_sigaction=define
    bincompat3=y useperlio=undef d_sfio=undef
  Compiler:
    cc='cc', optimize='-fast -xO5 -xdepend -xchip=ultra -xarch=v8plus', gccversion=
    cppflags=''
    ccflags =''
    stdchar='unsigned char', d_stdstdio=define, usevfork=false
    voidflags=15, castflags=0, d_casti32=define, d_castneg=define
    intsize=4, alignbytes=8, usemymalloc=y, prototype=define
  Linker and Libraries:
    ld='cc', ldflags =''
    libpth=/usr/local/lib /lib /usr/lib /usr/ccs/lib
    libs=-lsocket -lnsl -ldl -lm -lc -lcrypt
    libc=/lib/libc.so, so=so
    useshrplib=false, libperl=libperl.a
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' '
    cccdlflags='-Kpic', lddlflags='-G'


Characteristics of this binary (from libperl): 
  Built under solaris
  Compiled at Dec  8 1997 17:29:09
  @INC:
    /usr/local/lib/perl5/sun4-solaris/5.00404
    /usr/local/lib/perl5
    /usr/local/lib/perl5/site_perl/sun4-solaris
    /usr/local/lib/perl5/site_perl
    .
----------------------------------------------------------------------------

The main part of the script is an OO module that maintains some
fairly complicated data structures.  Two of the class variables are
pointers to anonymous hashes which cache data, and during the course
of processing -- which is CPU- and memory- intensive -- instances of a
a data structure that looks like

@foo = ( [ $bar, $baz, [  [ $foo1, $bar1 ],
                          [ $foo2, $bar2 ] 
                       ]
         ],
         [ $bar, $baz, [  [ $foo1, $bar1 ],
                          [ $foo2, $bar2 ] 
                       ]
         ]
       );

are repeatedly created inside a Sybase::CTlib fetch loop, i.e.

while(my @row = $self->{'db_connection'}->ct_fetch) {

Several times, while going through the loop, I run

undef @foo;

and recreate it.  Could this be doing dangerous things with 
reference counts (it seems unlikely) ?   I'm thinking of doing
away with the complex data structure and replacing it with 
several simple arrays, to see if that has anything to do with
the problem.

Has anyone else seen SEGV problems in this version of Perl?

Thanks,

Rohan.

remove TAKETHISOUT from email address before replying.



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

Date: Thu, 22 Jan 1998 22:15:34 -0500
From: "Ilia  Lobsanov" <lobsanov_family@email.msn.com>
Subject: Please please help a beginner...
Message-Id: <ewgKm06J9GA.123@upnetnews04>

Hello, I'm new to Perl, and so my first program doesn't work...
I would very much appreciate if you can tell me what is wrong with it.

This script is supposed to read a form with 3 elements: nickname, homePage,
and bio. It then searches line by line from a file to find the nickname, and
upon finding, it updates that line with the new data. It then reads from
this modified data file and puts the contents into an HTML table. And
finally redirects the client to a page.

The data file is a database of users: each user on a separate line, and each
user's data separated by double ampersand ( && ).

-- I thank you for any help you can provide...

Here is the script:

#!/usr/bin/perl

$database = "/www/htdocs/ilia/cgi-bin/friends/friends.dat";

read(STDIN, $input, $ENV{'CONTENT_LENGTH'});

 @pairs = split(/&/, $input);
 foreach $pair (@pairs) {
  ($name, $value) = split(/=/, $pair);

  $name =~ tr/+/ /;
  $name =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
  $value =~ tr/+/ /;
  $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;

     $FORM{$name} = $value;
 }

$as_nickname = $FORM{'nickname'};
$as_homePage = $FORM{'homePage'};
$as_bio = $FORM{'bio'};

### Open friends database to update record
open (DATABASE, ">$database");
@lines = <DATABASE>;

 foreach $line (@lines) {
  ($nickname, $homePage, $bio) = split(/ && /, $line);

  if ($nickname eq "$as_nickname") {
   print DATABASE "$nickname && $as_homePage && $as_bio\n";
  }
  else {
   print DATABASE $line;
  }
 }
close (DATABASE);

### Update friends table
open (DATABASE, "$database");
@database = <DATABASE>;
close (DATABASE);

# Join updated friends database into one large string.
# $friends = join('', @database);
# Now split the large string into lines.
# @friendsAray = split(/\n/, $friends);

# Open friends table.
open (TABLE, ">/www/htdocs/ilia/friends_table.htm");

 print TABLE "<TABLE border=0 cellspacing=0 cellpadding=0>\n";

 foreach $friend (@database) {
  ($nickname, $homePage, $bio) = split(/ && /, $friend);
  if ($nickname eq "$as_nickname") {
   print TABLE "<TR><TD colspan=3><HR SIZE=1></TD></TR>\n";
   print TABLE "<TR><TD><A
HREF=\"$as_homePage\">$as_nickname</A></TD><TD>&nbsp;&nbsp;</TD><TD>$as_bio<
/TD></TR>\n";
  }
  else {
   print TABLE "<TR><TD colspan=3><HR SIZE=1></TD></TR>\n";
   print TABLE "<TR><TD><A
HREF=\"$homePage\">$nickname</A></TD><TD>&nbsp;&nbsp;</TD><TD>$bio</TD></TR>
\n";
  }
 }
 print TABLE "</TABLE>\n";

close(TABLE);

print "Location: http://detoronics.net/ilia/friends.shtml\n\n";





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

Date: Thu, 22 Jan 1998 20:22:46 -0600
From: "Juan M. Courcoul" <courcoul@campus.qro.itesm.mx>
Subject: RADIUS accounting processing routines ?
Message-Id: <34C7FEF6.F6753CCC@campus.qro.itesm.mx>

Are there any packages/libraries/routines available for processing the
accounting records generated by a RADIUS server ?

We're in the process of setting up a access server, using RADIUS
authentication and accounting, and I need to be able to process the
accounting information generated by the server. BTW, I'm using an
Ascend-modified RADIUS daemon on a Sun Sol 2.6 box.

Thanks in advance for any information or pointers

John Courcoul
Monterrey Tech,
Queretaro Campus
Mexico


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

Date: 23 Jan 1998 03:04:40 GMT
From: miker@miracle.net (Michael Rocchetti)
Subject: relational operators and negative numbers
Message-Id: <6a91c8$99m@bellboy.ucc.uconn.edu>

Dear God - I pray that this is not a stupid question.....

I want to compare numbers and execute a bad_entry subroutine if b is greater
than a.

The code looks like this:

&bad_entry if ($FORM{'b'} > $FORM{'a'});

this seems to work well when both a and b are positive numbers - but it 
doesn't work when one or both of the numbers are negative.

Am I doing something wrong? How do I use numeric relational operators to 
compare negative numbers?

Any help would be greatly appreciated.

Mike Rocchetti
PERL Newbie



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

Date: 23 Jan 1998 13:35:45 -0500
From: Daryl Sayers <daryl@stonemicro.com.au>
Subject: Retrieving pages from a secure Web site.
Message-Id: <u5lnw7kpha.fsf@marge.stone.oz.au>


I have subscribed to a service on the Web. This service requires you
to log in with a password to give you access to a secure Web area.
I would like to automate the retrieval of a page within this area on
a daily basis and filter this information. In Netscape the page is
accessed via a https:// request and the Netscape key in Bottom left
is Unbroken dark blue background. The URL has a session id attached to
it for all subsiquent requests.

My question is:

How do I send my login/password to this service to retrieve access to
the secure area. Then using this information how do I access the specific
page I require.

NOTE:
I can retrieve normal web pages using the standard perl network func of
socket/connect/send etc. eg:

----- quick and nasty eg: ------------
$remote = shift || 'autoproxy.site.com';
$port = $fwport ; # fire-wall port
$iaddr = inet_aton($remote)  or die "no host: $remote";
$paddr = sockaddr_in($port, $iaddr);
$proto = getprotobyname ('tcp');

$mymsg = "GET http://www.view.site/index.html HTTP/1.0\n\n";
socket(SOCK, AF_INET, SOCK_STREAM, $proto) or die "socket: $!";
connect(SOCK, $paddr)                    or die "connect: $!";
send(SOCK,$mymsg,0)                      or die "send $!";
while($line=<SOCK>) {
	print "$line";
}
close(SOCK)                              or die "close: $!";
----------------------------------------
As you may notice I am very new to Perl and web security (am more). So
any verbose answers would be very appreciative.

Daryl.



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

Date: Thu, 22 Jan 1998 20:18:47 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Reverse of ReadParse
Message-Id: <7mu8a6.v65.ln@localhost>

J T (jtsai@saturn.superlink.net) wrote:

: 	So I should've said:

: 	$a =~ s/[^a-zA-Z0-9]/'%'.unpack('H2',$&)/eg;

: 	Sorry for the waste of bandwidth...what was I thinking with $1...?


Step one) Have a look at this Frequently Asked Question:

   "Why does using $&, $`, or $' slow my program down?"

 
Step two) rewrite the above (*do* use $1, but you better tell perl to
                             put stuff in there first ;-):


   $a =~ s/([^a-zA-Z0-9])/'%'.unpack('H2',$1)/eg;
           ^            ^                 ^^
           ^            ^                 ^^

;-)

--
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: 23 Jan 1998 01:12:47 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: space searching?
Message-Id: <6a8qqf$pa8$1@csnews.cs.colorado.edu>

 [courtesy cc of this posting sent to cited author via email]

In comp.lang.perl.misc, steveo@panix.com (Steven M. O'Neill) writes:
:Please be aware thah using html tags in usenet posts is poor form if not
:out and out poor taste.  And besides, the <sarcasm> tag isn't even
:supported by lynx.

<silly>
    Don't kid around.  Check the <flicker>content-type</flicker>
    in the headers.  You're not interpreting <eerie>plain text</eerie>
    as HTML, are you? :-)
</silly>
-- 
	Tom Christiansen	tchrist@jhereg.perl.com


sum to check equivalent files should use sum -a. --Andrew Hume


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

Date: Thu, 22 Jan 1998 22:04:27 -0500
From: nmcnelly@bu.edu (N.A.F. McNelly)
Subject: UNIX to %$$@! Win: Script Won't Go
Message-Id: <nmcnelly-2201982204270001@ppp-82-12.bu.edu>

I am trying to help a friend install one of my scripts on
a Windows 95 machine running Win32 perl.  The number-crunching
bit works just fine, but when it gets to graphics, it's useless.
I've checked repeatedly, and he has the script in the same
directory with the gifs, where it should be.

Now I know binmode is nescessary for Win output, so that's not
the problem (I even gave him a little test version that defined
gif input as binmode).  But he can't even get a short test
version to work. (I should add that both the long and test versions
do just fine with UNIX and MacPerl)

Is there anyone who knows perl for Windows who can tell me what's
going wrong here?

His error messsage is:

Can't open first gif. at C:\perl\datef\test.pl
line 9, <stdin> chunk 1.


The short test.pl script is:

#!/usr/local/bin/perl
use GD;
print "Enter The Desired Name of the Output File: ";
$name=<STDIN>;
$last=".gif";
$nme=$name . $last;
open (GIF,"start.gif") || die ("can't open first gif");
$im = newFromGif GD::Image(GIF);
close GIF;
open (GIF,"second.gif") || die ("can't open other gif");
$src = newFromGif GD::Image(GIF);
close GIF;
$im->copy($src,169,271,0,0,83,116);
open(OUT,">$nme") || die;
binmode (OUT);
print OUT $im->gif;
close(OUT);
print "\n";
print "There should now be a gif named ";
chop ($name);
print "$name";
print ".gif\n";
print "in the datef directory"

-- 
 .................................................................
Nancy McNelly                 
http://www.halfmoon.org/
Rabbit in the Moon: Mayan Hieroglyphics and Architecture


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

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


Administrivia:

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

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

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

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

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

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

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

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


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

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