[10669] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4261 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Nov 19 23:07:17 1998

Date: Thu, 19 Nov 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, 19 Nov 1998     Volume: 8 Number: 4261

Today's topics:
    Re: $ENV{'HTTP_USER_AGENT'} List?? (Martien Verbruggen)
    Re: /g modifier: why not 'last' out of while loop? chrishabs@my-dejanews.com
    Re: Calling functions from a hash <rick.delaney@shaw.wave.ca>
    Re: CGI Problem is so far unsolvable any takers wanna t (brian d foy)
    Re: hiding a URL <prauz@sprynet.com>
    Re: hiding a URL <james@MatadorDesign.com>
    Re: HTTPS - I cannot find a module on CPAN for this. <prauz@sprynet.com>
        I download ActiveState but don't understand how to inst <proband@cam.org>
        interpolate please? <nospam.perl_rocks@hotmail.com>
    Re: interpolate please? <ajohnson@gatewest.net>
    Re: interpolate please? (Martien Verbruggen)
    Re: interpolate please? (Andre L.)
    Re: interpolate please? <nospam.perl_rocks@hotmail.com>
        Is it possible to run a web server on Win95? <kris@fit2print.com>
        LWP question <prauz@sprynet.com>
    Re: LWP question (brian d foy)
    Re: manipulating the last few lines of file efficiently (Martien Verbruggen)
        Open TTY failure Q's <bobm@cunix.com>
    Re: pattern matching (Martien Verbruggen)
    Re: Problem compiling with perl compiler B <dan@clockwork.net>
    Re: Problems building DB_File 1.52 elvis@NOTGRACELANDclark.net
    Re: programing fun: trees: FlattenAt <rick.delaney@shaw.wave.ca>
        Put your options list in a file, trick for the novices <proband@cam.org>
        scripts similar to hotmail <00000ctt@usa.net>
    Re: Server Administration with Perl (brian d foy)
        sort related ... <rakesh_puthalath@hotmail.com>
        Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)

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

Date: Fri, 20 Nov 1998 02:03:02 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: $ENV{'HTTP_USER_AGENT'} List??
Message-Id: <q5452.113$RQ1.210@nsw.nnrp.telstra.net>

In article <3654953C.70F869A@molyvos.net>,
	"P.Vogel" <pingv@molyvos.net> writes:
> Does anybody know if there is a list with all (or a lot of) possible
> $ENV{'HTTP_USER_AGENT'} replies?

There is no such list. I can write a client, and come up with my own
name.

Besides that, this has nothing to do with perl. In the future, ask web
related questions in the most appropriate group in the
comp.infosystems.www.* hierarchy, please.

> Please e-mail me too at: pip@mijnkeldertje.com (I cannot access news
> very often.)

Sorry, my email has been despammed. I can't send any anymore. Besides,
if you want email at that address, you should at least have the
courtesy of making sure that your From: or Reply-To: fields
contain it.

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | That's not a lie, it's a terminological
Commercial Dynamics Pty. Ltd.       | inexactitude.
NSW, Australia                      | 


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

Date: Fri, 20 Nov 1998 02:20:34 GMT
From: chrishabs@my-dejanews.com
Subject: Re: /g modifier: why not 'last' out of while loop?
Message-Id: <732jl5$hsd$1@nnrp1.dejanews.com>

In article <3652d910.0@mirage.iasi.com>,
  jdl@iasi.com wrote:
> I don't understand something in the Cookbook.  From pg. 170:
>
> [To find the Nth match in a string,]
> Use the /g modifier in a while loop, keeping count of matches:
>
> $WANT = 3;
> $count = 0;
> while (/(\w+)\s+fish\b/gi) {
>     if (++$count == $WANT) {
>         print "The third fish is a $1 one.\n";
>         # Warning: don't `last' out of this loop
>     }
> }
>
> Why can't a 'last' be used to bail out of the loop?
>

I was just burnt by this last week and posted to the group for enlightenment.

Randal Schwartz was kind enough to explain that the pos() where the /g
matched before exiting the loop is stored with the string and if you /g the
string again, it picks up matching at the stored pos() position, not from the
start of the string.

Cheers

Chris H.

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Fri, 20 Nov 1998 03:03:51 GMT
From: Rick Delaney <rick.delaney@shaw.wave.ca>
Subject: Re: Calling functions from a hash
Message-Id: <3654DDC7.CD394145@shaw.wave.ca>

Bruce Mohler wrote:
> 
> Brand Hilton wrote:
> 
> > In article <365463D0.B54F556C@saic.com>,
> > Bruce Mohler  <bruce.w.mohler@saic.com> wrote:
> > >   my $Response = &{$Category{$Subcategory}}($Subcategory);
> >
> >    my $Response = &{${$Category}{$Subcategory}}($Subcategory);
> >
> > But you're kinda scaring me with all those symbolic references.
> >
> 
> In being "cute" I may have missed your point.  Is there a better way 
> to express what I'm trying to do?

Yes, use Perl's data structures--lists of lists, hashes of hashes, etc. 

    perldoc perldsc (data structure cookbook)
    perldoc perlref

Pretty much anywhere you've got categories and subcategories is a good
place to use a hash of hashes.

my %routines = (
    General => {
        Info => \&AddDummyField,
    },
);

You can then execute all the subroutines like this:

for my $category ( keys %routines ) {
    for my $subcategory ( keys %{ $routines{$category} } ) {
        &{ $routines{$category}{$subcategory} }($subcategory);
    }
}

Anyway, you should not get into the habit of using symbolic references.
They will turn on you some day.

-- 
Rick Delaney
rick.delaney@shaw.wave.ca


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

Date: 20 Nov 1998 03:25:37 GMT
From: comdog@computerdog.com (brian d foy)
Subject: Re: CGI Problem is so far unsolvable any takers wanna try to solve...
Message-Id: <comdog-1003380733010001@news.panix.com>
Keywords: just another new york perl hacker

In article <72tsqi$9m5$1@excalibur.flash.net>, "Scott Winterstein" <sw12467@advancedits.com> posted:

> I have been working out the kinks in a idea for a script that I have What I

how did it go in Annie Hall?  

   Right now it's only a notion, but I 
   think I can get money to make it into 
   a concept ... and later turn it into 
   an idea.

> want to do is place the number 123456789 into an existing page
> http://www.scottsdesk.com/signup_netrep.htm (where the number 1190755 is I
> want the number to be replaced by any number at the end of said link to) by
> placing the number at the end of the link URL from another page lets say
> http://www.scottsdesk.com/signup_netrep.htm?123456789 I know it can be done
> but the closest I have came to doing it is a script that will print the
> number in the page but I need it to place the number in a specific area
> includes is the first script I wrote and a copy of the page if anyone has
> the time to figure this out or can help me I would be greatly in debt to you
> and would appreciate the hell out of getting this off my back
> Thank You
> Scott

if you can explain the problem in less than twenty five words i'll solve
it.

perhaps some of those words as "i want to replace the number in the
query string with another number".

-- 
brian d foy                                 <http://computerdog.com>
Comprehensive Perl Archive Network (CPAN) <URL:http://www.perl.com>
Perl Mongers <URL:http://www.pm.org>


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

Date: Fri, 20 Nov 1998 02:31:22 +0000
From: Balazs Rauznitz <prauz@sprynet.com>
Subject: Re: hiding a URL
Message-Id: <3654D47A.5612CE7B@sprynet.com>

Gord Barentsen wrote:
> 
>         Hello...I'm not sure if this is a Perl-specific question, but
> I thought maybe it could be accomplished within a Perl CGI script.  Is
> there any way to cause the browser to hide the URL of a
> (protected/secure) web page, thus causing the browser NOT to display
> it in the LOCATION field?  Or at least to scramble/encrypt it so that
> it could not be bookmarked/copied?  Thanks in advance for any help
> anyone could give me!
No; it is neither a perl question nor is it possible as far as I know.

Balazs


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

Date: 19 Nov 1998 22:04:59 -0500
From: James Cameron <james@MatadorDesign.com>
Subject: Re: hiding a URL
Message-Id: <x74srvkqsk.fsf@server.matadordesign.com>


This is not the correct forum for this question (there are plenty of 
html/cgi/java/javascript newsgroups) but the answer to your question
is: yes.  

However, this is *not* truly secure and anyone who really wants to get
around it can.  Here's some HTML code for browsers that support javascript:

<A HREF="http://www.matadordesign.com/"
  onclick="window.open('http://www.matadordesign.com/',
  'new_window','toolbar=no,menubar=no,location=no,resizable=yes,
  scrollbars=yes')">Testing</A>

In short, the first URL is for what happens in the current window
and the second URL is for what happens in the new window that does not
allow you to easily know the urls of the pages *after* the first one
that opens.  This is *not* secure...don't try to pretend it is if you
actually need security.  Instead, write a secure cgi script for what
you need to do.  You can easily protect documents, images, and
anything else with a well written application.

-James Cameron  
Matador Design, Inc.
http://www.MatadorDesign.com
WebEvent, web calendar software for the world.



gpb@ppaolucci.com (Gord Barentsen) writes:

> 	Hello...I'm not sure if this is a Perl-specific question, but
> I thought maybe it could be accomplished within a Perl CGI script.  Is
> there any way to cause the browser to hide the URL of a
> (protected/secure) web page, thus causing the browser NOT to display
> it in the LOCATION field?  Or at least to scramble/encrypt it so that
> it could not be bookmarked/copied?  Thanks in advance for any help
> anyone could give me!
> 
> Gord Barentsen


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

Date: Fri, 20 Nov 1998 02:11:41 +0000
From: Balazs Rauznitz <prauz@sprynet.com>
To: Joseph DuBois <jdubois@keane.com>
Subject: Re: HTTPS - I cannot find a module on CPAN for this.
Message-Id: <3654CFDD.2D133058@sprynet.com>

Joseph DuBois wrote:
> 
> Well met,
> 
>    I am looking for a module to work with a HTTPS server. I looked
> on CPAN, but could not find either by catagory or module. Am I looking
> for the wrong thing, or is there another way to do this.

Search for SSL at www.perl.com. Please let me know if you figure out how
to call a secure page; I'm cuorious about it.


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

Date: Thu, 19 Nov 1998 20:55:38 -0500
From: Sylvain Lavigne <proband@cam.org>
Subject: I download ActiveState but don't understand how to install it on Win98
Message-Id: <3654CC1A.EDEFF758@cam.org>

Hi!
I download ActiveState but don't understand how to install it on Win98.
I supposed I have to play around with the registries but don't know
exacly how to doit to make it work.
I am using Netscape Communicator, do I need to configure other things
there?
So, what is the best procedure and fastest procedure to make it work.

Thank you for your help

Sylvain







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

Date: Thu, 19 Nov 1998 21:22:09 -0500
From: sara starre <nospam.perl_rocks@hotmail.com>
Subject: interpolate please?
Message-Id: <3654D251.39F6FB46@hotmail.com>

Since I belong to the "less code is better code" school , I wonder, is
there any way to make perl interpolate more than $-vars withing a
literal, such as:

   print "processing case ++$i\n";

instead of:
   ++$i;
   print "processing case $i\n";

I guess what I need is an "anti-\" :)

HUG,
S
-- -- --
"I'll quit using PERL when they pry my cold, dead fingers off the
mouse.."
-Sara Starre 1998




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

Date: Thu, 19 Nov 1998 20:58:53 -0600
From: Andrew Johnson <ajohnson@gatewest.net>
Subject: Re: interpolate please?
Message-Id: <3654DAED.4B180E51@gatewest.net>

sara starre wrote:
!
! Since I belong to the "less code is better code" school , I wonder,
! is there any way to make perl interpolate more than $-vars withing a
! literal, such as:
! 
!    print "processing case ++$i\n";
! 
! instead of:
!    ++$i;
!    print "processing case $i\n";
! 
! I guess what I need is an "anti-\" :)

see perlfaq4 for the entry:
    How do I expand function calls in a string?

it really deals with expanding arbitrary expressions
in a string ... here are two examples, the first providing
scalar context (in 5.005) and second providing list context:

my $i =0;
print "processing case ${\++$i}\n";
print "processing case @{[++$i]}\n";

but readability can suffer if you use these kinds
of things too much.

regards
andrew


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

Date: Fri, 20 Nov 1998 03:05:47 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: interpolate please?
Message-Id: <f0552.135$RQ1.420@nsw.nnrp.telstra.net>

In article <3654D251.39F6FB46@hotmail.com>,
	sara starre <nospam.perl_rocks@hotmail.com> writes:
> Since I belong to the "less code is better code" school

Heh, must be a different school than the one I went to :)

>    print "processing case ++$i\n";
> 
> instead of:
>    ++$i;
>    print "processing case $i\n";

Even though there are ways of expanding code in a string, I usually
prefer to use printf in cases like this:

printf "processing case %d\n", ++$i;

sprintf of course can be used to format up a string in this way,
and the perlfunc entry for sprintf contains all your conversions.

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | If it isn't broken, it doesn't have
Commercial Dynamics Pty. Ltd.       | enough features yet.
NSW, Australia                      | 


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

Date: Thu, 19 Nov 1998 23:18:44 -0500
From: alecler@cam.org (Andre L.)
Subject: Re: interpolate please?
Message-Id: <alecler-1911982318440001@dialup-640.hip.cam.org>

In article <3654D251.39F6FB46@hotmail.com>, sara starre
<nospam.perl_rocks@hotmail.com> wrote:

> Since I belong to the "less code is better code" school , I wonder, is
> there any way to make perl interpolate more than $-vars withing a
> literal, such as:
> 
>    print "processing case ++$i\n";
> 
> instead of:
>    ++$i;
>    print "processing case $i\n";
> 
> I guess what I need is an "anti-\" :)


You can write:

   print 'Processing case ', ++$i, "\n";

because print() takes a list of arguments.


Or you can use this little trick:

   print "processing case ${\++$i}\n";

HTH,
Andre


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

Date: Thu, 19 Nov 1998 22:34:36 -0500
From: sara starre <nospam.perl_rocks@hotmail.com>
Subject: Re: interpolate please?
Message-Id: <3654E34C.3081B3B4@hotmail.com>

Thanks guys- as always you came thru for me like knights! Interesting
solution Martin- looks like c (giggle).. I didn't know that perl even HAD
printf but I guess i should have figured from Larry's comments about
making more than 1 way to do things..

BTW- I had to go back to some perl script that I'd written about 3 months
ago when I was REALLY a newbie.. Wow... What a difference- it looked like
kindergarden PERL. I owe 1/2 of my improvement to reading CAMEL and
www-sites, but the other 1/2 to you guys.. You've been wonderful. Just
wanted to let you know that a few sentances about a topic (like you just
sent) make a HUGE difference to my abilities.. I hope that in a few months
I can make some actual contributions here too. I tried a few times but I
floundered badly :)

HUG,
S

-S

sara starre wrote:

> Since I belong to the "less code is better code" school , I wonder, is
> there any way to make perl interpolate more than $-vars withing a
> literal, such as:
>
>    print "processing case ++$i\n";
>
> instead of:
>    ++$i;
>    print "processing case $i\n";
>
> I guess what I need is an "anti-\" :)
>
> HUG,
> S
> -- -- --
> "I'll quit using PERL when they pry my cold, dead fingers off the
> mouse.."
> -Sara Starre 1998

--
"I'll quit using PERL when they pry my cold, dead fingers off the mouse.."

-Sara Starre 1998




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

Date: Fri, 20 Nov 1998 03:39:10 GMT
From: Kris <kris@fit2print.com>
Subject: Is it possible to run a web server on Win95?
Message-Id: <3654E41F.BA773505@fit2print.com>

I have Apache 1.3.3 and Perl 5.0, and I'm wondering if its worth my time
trying to figure out how to configure them to run on Win95 (4.00.950b,
96 megs RAM, Pentium 166).  Looking through the documentations it seems
that you can, but I wanted to get some feedback before I spend too much
time on it.  From what I can tell I don't need C++ to run it, but I
could be mistaken.  I've gotten to where I can Apache from a command
line, but that's about it.  Any tips on what to do if I can?  Thanks.

Kris

--
fit2print.com - Your Digital Newsstand
Order individual magazines @ http://www.fit2print.com




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

Date: Fri, 20 Nov 1998 01:58:03 +0000
From: Balazs Rauznitz <prauz@sprynet.com>
Subject: LWP question
Message-Id: <3654CCAB.5C95157@sprynet.com>

Hi there,

I wrote a program to grab stock info from the net at 1 minute
intervalls. I use:
$content = LWP::Simple::get($URL);

and then parse the HTML file for the stock prices.
The whole program is a big infinite loop, but after many hours (8) of
running the above call just simply blocks and the program doesn't go
further. Does anyone have any experience ?
I use  $Id: Simple.pm,v 1.28 1998/04/20 07:11:24 aas Exp $
(taken from Simple.pm)

Thanks for any help:

Balazs


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

Date: 20 Nov 1998 03:40:09 GMT
From: comdog@computerdog.com (brian d foy)
Subject: Re: LWP question
Message-Id: <comdog-1003380747350001@news.panix.com>
Keywords: just another new york perl hacker

In article <3654CCAB.5C95157@sprynet.com>, Balazs Rauznitz <prauz@sprynet.com> posted:

> Hi there,
> 
> I wrote a program to grab stock info from the net at 1 minute
> intervalls. I use:
> $content = LWP::Simple::get($URL);
> 
> and then parse the HTML file for the stock prices.
> The whole program is a big infinite loop, but after many hours (8) of
> running the above call just simply blocks and the program doesn't go
> further. Does anyone have any experience ?

no experience with this problem, but generally when i write such things
i quit the process after so long and restart it.  this is the same sort
of thing that web servers do with child processes.  at least you can
treat the symptom until you figure out the problem :)

-- 
brian d foy                                 <http://computerdog.com>
Comprehensive Perl Archive Network (CPAN) <URL:http://www.perl.com>
Perl Mongers <URL:http://www.pm.org>


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

Date: Fri, 20 Nov 1998 02:13:23 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: manipulating the last few lines of file efficiently?
Message-Id: <7f452.116$RQ1.210@nsw.nnrp.telstra.net>

In article <3654BAE1.1FA1A586@std.teradyne.com>,
	Chen Wang <wangc@std.teradyne.com> writes:
> 1) read the FAQ, doesn't present efficient solutions

If you are not happy with the way the FAQ suggests, (probably because
you don't want to read the whole file?) then you'll have to do some
buffering. I cna't think of many other ways.

> 2) tried buffering 4 lines, but complicates old code

open file
go to end
walk backwards until you have the required number of newlines+1, go
forward one again, and that should be the start of the nth line from
the end.

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | If it isn't broken, it doesn't have
Commercial Dynamics Pty. Ltd.       | enough features yet.
NSW, Australia                      | 


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

Date: Thu, 19 Nov 1998 21:21:20 -0500
From: Bob Mariotti <bobm@cunix.com>
Subject: Open TTY failure Q's
Message-Id: <3654D220.38E3A61C@cunix.com>

We have been struggling for a week or two with protecting and
serializing multi-tasking access to a tty port unsuccessfully.

In order to perform a flock on the tty port we have the following line:

open(TTY, "+<$cx_main::CUPORT") or die "Open TTY failure: $!";

Using the perl debugger and by inserting `print ...` statements we have
been able to trace the logic and variable contents.  The
$cx_main::CUPORT package variable contains /dev/tty2 and with we run the
script from the command line, it works.  If run from the web, it fails
with the message "A file or directory in the path name does not exist".
The first thing we did after verifying the content of the variable was
to check the permissions.  The directory where the cgi resides is
rwxrwxrwx the /dev/tty2 is crw-rw-rw and just about everything else
checks out.  Several long days struggling with this rather simple
problem has become "major frustrating".

Can someone shed some light on this problem?  Thanks in advance.
ps: and please e-mail in addition to posting. Thanks.

+-----------------------+---------------------------+
+ Bob Mariotti          + Financial DataCorp (FDC)  +




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

Date: Fri, 20 Nov 1998 02:00:34 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: pattern matching
Message-Id: <63452.112$RQ1.210@nsw.nnrp.telstra.net>

In article <7323jc$3sc$1@nnrp1.dejanews.com>,
	ha@canes.gsw.peachnet.edu writes:
> Hi, New to the site but not a novice.

site? Newsgroup, you mean?

> the following statement
> 
> if ($file[$counter] =~ /$var/)
> produces "Use of an Unitialized Value"

That means that either $counter, $var, or the $counter-th element of
@file is undefined. You'll have to figure out which it is.

You could consider a line like:

print "$counter, $var, $file[$counter]\n";

Just to see which of the three is empty. To know for sure, you'll have
to use the defined operator/function.

# perldoc -f defined

> Even if i am able to print it out but apparentlly it makes the
> compiler ungry,

Heh. There are only three words in English that end in -gry. Hungry,
Angry and Aggry. Which of the first two did you mean? :)

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | In a world without fences, who needs
Commercial Dynamics Pty. Ltd.       | Gates?
NSW, Australia                      | 


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

Date: Thu, 19 Nov 1998 21:10:21 -0600
From: Dan Brian <dan@clockwork.net>
Subject: Re: Problem compiling with perl compiler B
Message-Id: <3654DD9D.81557E11@clockwork.net>

The compiler in 5.005 includes several bugs within B::; the best workaround is to
use 5.004_x and download the alpha 3 compiler from CPAN. Be sure to use the '-u'
option to force a tree trace, which should find the modules.

Christian Ismer wrote:

> I have the same problem:
>
> substcont: op = LOGOP (0x2d9660) pp_substcont, pmop = PMOP (0x2ce5c0) pp_subst
> pmopsym = (OP*)&pmop_list[19]
> No definition for sub Socket::PF_INET
> No definition for sub Socket::PF_INET (unable to autoload)
> ...
>
> Seems the compiler can't find any modules? I have got no clue.
>
> "Bryan M. Kramer" wrote:
>
> > I'm trying out the experimental compiler that comes with perl 5.005.
> >
> > I'm getting the message
> >
> > No definition for sub Getopt::Long::GetOptions
> > No definition for sub Getopt::Long::GetOptions (unable to autoload)
> >
> > when compiling as below:
>
> --
>  Christian Ismer
>
> ----------------------------------------------------
>
> Visit the new oneMission site!
> http://oneMission.com/
>
> ----------------------------------------------------





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

Date: 20 Nov 1998 03:07:46 GMT
From: elvis@NOTGRACELANDclark.net
Subject: Re: Problems building DB_File 1.52
Message-Id: <732me2$jmv$1@callisto.clark.net>

elvis@NOTGRACELANDclark.net wrote:

Nevermind.  I got 1.60 of DB_File and it worked. :)

Bill

: I have perl 5.004.04
: Make DB_File 1.52 completes fine.  However when I run make test:

: Makefile:736: warning: overriding commands for target `Makefile' Makefile:657: warning: ignoring
: old commands for target `Makefile' PERL_DL_NONLAZY=1 /bin/perl -I./blib/arch -I./blib/lib
: -I/usr/local/lib/perl5/sun4-solaris/5.00404 -I/ usr/local/lib/perl5 -e 'use Test::Harness
: qw(&runtests $verbose); $verbose=0; runtests @ARGV;' t/*.t t/db-btree..........Can't load
: './blib/arch/auto/DB_File/DB_File.so' for module DB_File: ld.so.1: /bin /perl: fatal: relocation
: error: file ./blib/arch/auto/DB_File/DB_File.so: symbol db_version: reference d symbol not found
: at /usr/local/lib/perl5/sun4-solaris/5.00404/DynaLoader.pm line 166.
:  at t/db-btree.t line 21 BEGIN failed--compilation aborted at t/db-btree.t line 21. dubious
:         Test returned status 2 (wstat 512, 0x200)

: I cannot make heads or tails of this error message.

: Any ideas why I am getting relocation error?

: Thanks.

: Bill

-- 
Bill
elvis@NOTGRACELAND.clark.net


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

Date: Fri, 20 Nov 1998 02:11:55 GMT
From: Rick Delaney <rick.delaney@shaw.wave.ca>
Subject: Re: programing fun: trees: FlattenAt
Message-Id: <3654D19A.BECC0F4E@shaw.wave.ca>

David Alan Black wrote:
> 
> my $tree = [ [8, ['a']], [3, ['b', 4, ['c', 'd'], 5], 6] ];
> my $flat = FlattenAt($tree, [1,1,2]);
> 
> print @{$flat->[1][1]}  # prints b4cd5
> 

Very nice, but it should be pointed out that the original tree is
altered.

    print @{$tree->[1][1]}  # prints b4cd5 too

The simplest solution to this is to make a copy of the tree first.  Here
is one way:

    sub CopyTree { # assumes only scalar or array ref elements
        return [map { ref($_) ? CopyTree($_) : $_ } @{$_[0]}];
    }

-- 
Rick Delaney
rick.delaney@shaw.wave.ca


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

Date: Thu, 19 Nov 1998 21:09:49 -0500
From: Sylvain Lavigne <proband@cam.org>
Subject: Put your options list in a file, trick for the novices
Message-Id: <3654CF6D.4C29F47B@cam.org>

Stop handwriting all your options. use this instead.  When you need to
add another option
you just add it to the file.  You don't need anymore to code it on your
script.

# sample cities.dat, make a flat file with the cities, this will be used
as options list

cities.dat

New-York
Washington
New-Jersey
Miami


# where the options list will reside
$cgipath="/home/proband/public_html/cgi-bin";

 print "<SELECT NAME=\"cities\" SIZE=\"4\">\n";
 print "<OPTION VALUE=\"NONE\">Select a city, or select this one for
none\n";
 print "<OPTION VALUE=\"NONE\">-----------------------------------\n";
# call the routine here
 &get_options_list("cities.dat");
 print "</SELECT>\n";



##########
# the routine
#########
sub get_options_list
{
  open (DATABASE, "$cgipath/$_[0]");
  flock(DATABASE, $LOCK_SH);
  while (<DATABASE>)
    {
     $row = $_;
     chop $row;
     print "<OPTION VALUE=\"$row\">$row\n";
    }
  close (DATABASE);
}

from: Sylvain Lavigne




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

Date: Sun, 15 Nov 1998 02:25:39 +0800
From: CTT <00000ctt@usa.net>
Subject: scripts similar to hotmail
Message-Id: <364DCB23.9E1F8D3E@usa.net>

I'd like to creat a web based email system like hotmail in my server, i
know how to do the pop3 mail stuff in perl, but i dont know how to do
the add user stuff in unix.....what command should i use in order to
creat a new user (with email account)?



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

Date: 20 Nov 1998 03:33:26 GMT
From: comdog@computerdog.com (brian d foy)
Subject: Re: Server Administration with Perl
Message-Id: <comdog-1003380740520001@news.panix.com>
Keywords: just another new york perl hacker

In article <36540E2A.EA0BCCF9@sidhe.net>, Evert Smit <admin@sidhe.net> posted:

> i am looking for a solution to have a web based application, that let's
> users edit their various services on a webserver. Issues like managing
> the e-mail forwarder account, issues like creating new e-mail accounts
> or simple things like passwort protecting their directories. Any help,
> hints and tips will be greatly apprecitated.

um, use Perl?  personally, i don't recommend admin-ing a box via the
web.  but then, i don't allow root logins from remote machines for 
the same reason ;)

do you have more specific questions?

-- 
brian d foy                                 <http://computerdog.com>
Comprehensive Perl Archive Network (CPAN) <URL:http://www.perl.com>
Perl Mongers <URL:http://www.pm.org>


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

Date: Fri, 20 Nov 1998 11:17:38 +0800
From: Rakesh Puthalath <rakesh_puthalath@hotmail.com>
Subject: sort related ...
Message-Id: <3654DF52.A48559CF@hotmail.com>

1               @new = sort {
2                     ($b =~ /=(\d+)/)[0] <=> ($a =~ /=(\d+)/)[0]
5                } @old;

Can someone explain, line 2

Thanks
Rakesh



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

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


Administrivia:

Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.

If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu. 


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

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