[6541] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 166 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Mar 24 00:12:36 1997

Date: Sun, 23 Mar 97 21:00:24 -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           Sun, 23 Mar 1997     Volume: 8 Number: 166

Today's topics:
     Re: "Shared Hash" <tchrist@mox.perl.com>
     -d -f options <dinendra@blarg.net>
     Re: -d -f options (Nathan V. Patwardhan)
     Re: -d -f options < hansm@icgned.nl>
     Re: : Q: cgi --directly execute program with added-info <eric@nettown.com>
     Re: Bringing more traffic to your web site (William X. Walsh)
     Re: case sensativity (Jon Bell)
     Re: DB_File.pm? (Arpad Geller)
     dereferencing an object in a hash? (Arpad Geller)
     Re: File upload (Nathan V. Patwardhan)
     Re: Getting the time for a date (Michael Fuhr)
     Re: Help!: database data replacement with perl <rootbeer@teleport.com>
     Re: How can I find the current working directory? <rootbeer@teleport.com>
     Re: How to drop .cgi on perl script? <tchrist@mox.perl.com>
     Is CGI a part of or similiar to Perl? ccrox39754@aol.com
     Re: Is CGI a part of or similiar to Perl? (Michael Fuhr)
     Re: Is CGI a part of or similiar to Perl? (Jon Bell)
     NOTE: Re: : Q: cgi --directly execute program with adde <eric@nettown.com>
     Problems Installing Perl 5 (Mason Withers)
     q: multikey lists, sort by key#1,key#2, save/load, etc? (Apple-O)
     Question <andy@wwdatalink.com>
     Re: Question (Joshua Lerner)
     Question: Redirecting to URLs... <webmaster@amygrant.org>
     Re: regex for UNIX usernames needed! <tchrist@mox.perl.com>
     Re: Single character representing all regexp metacharac < hansm@icgned.nl>
     Re: Taking parameters from scrollboxes and then display (Simon Hyde (aka Jeckyll))
     Re: Unix 'Cat' equivelent (Bill)
     Re: What's a good Perl book? (John Congson)
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: 24 Mar 1997 01:55:19 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: "Shared Hash"
Message-Id: <5h4mu7$pb5$2@csnews.cs.colorado.edu>

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

In comp.lang.perl.misc, 
    "Paulo C. Marques F." <paul@u-netsys.com.br> writes:
:Is there any way to have a hash shared by two or more scripts? Let me 
:explain that. We have a CGI-Script which does some text processing
:using a hash %dictionary. The hash has 10.000 entries, and is loaded
:to the memory as the script starts.

Tie it to a dbm version.

--tom
-- 
	Tom Christiansen	tchrist@jhereg.perl.com

    The autodecrement is not magical.
            --Larry Wall in the perl man page


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

Date: Sun, 23 Mar 1997 14:56:59 -0800
From: dinendra <dinendra@blarg.net>
Subject: -d -f options
Message-Id: <3335B53B.16A6@blarg.net>

Hi,

I am writing a program in which I want to open a directory and want to read in the entries and find 
out whether it is a file or a directory. So I do the following

opendir(DIRCONTENT,"$parentdir") || die "Cannot open dir $parentdir\n";	
$dircontent= readdir(DIRCONTENT); 
$dircontent = readdir(DIRCONTENT); #read and discard the name of directory above
while($dircontent =  readdir(DIRCONTENT))
{
	if(-d $dircontent)
	{
		print "Dir : $dircontent\n";
	}
	elsif (-f $dircontent)	
	{
		print"File : $dircontent\n";
	}
}
closedir(DIRCONTENT);


But this doesn't seem to work. Am I not using -d and -f the right way. Any response would be 
appreciated.

Deepa Dinendra


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

Date: 24 Mar 1997 00:26:57 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: -d -f options
Message-Id: <5h4hoh$e4j@fridge-nf0.shore.net>

dinendra (dinendra@blarg.net) wrote:

: I am writing a program in which I want to open a directory and want to read in the entries and find 
: out whether it is a file or a directory. So I do the following
[directory stuff snipped]


opendir(DIRCONTENT,"$parentdir") || die "Cannot open dir $parentdir\n";	
while($dircontent =  readdir(DIRCONTENT)) {
	if(-d $dircontent) {
	  print "Dir : $dircontent\n";
	} elsif (-f $dircontent) {
	  print"File : $dircontent\n";
	}
}
closedir(DIRCONTENT);

OR if you're feeling a bit daring you can use the File::Find, and 
File::Recurse modules to do the dirty work for you!

--
Nathan V. Patwardhan
nvp@shore.net



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

Date: 24 Mar 1997 01:39:44 GMT
From: Hans Mulder< hansm@icgned.nl>
Subject: Re: -d -f options
Message-Id: <5h4m10$o03@news.euro.net>

nvp@shore.net (Nathan V. Patwardhan) wrote:
> dinendra (dinendra@blarg.net) wrote:
> 
> : I am writing a program in which I want to open a directory and want to read in the entries 
and find 
> : out whether it is a file or a directory. So I do the following
> [directory stuff snipped]
> 
> 
> opendir(DIRCONTENT,"$parentdir") || die "Cannot open dir $parentdir\n";	
> while($dircontent =  readdir(DIRCONTENT)) {
> 	if(-d $dircontent) {
> 	  print "Dir : $dircontent\n";
> 	} elsif (-f $dircontent) {
> 	  print"File : $dircontent\n";
> 	}
> }
> closedir(DIRCONTENT);

That's not going to work (unless $parentdir happens to be "."), becuasereaddir
returns paths relative to the directory it's reading, and -f takes paths relative
to the current directory.  You'll want:

opendir(DIRCONTENT,"$parentdir") || die "Cannot open dir $parentdir: $!\n";	
while ($dircontent = readdir(DIRCONTENT)) {
	if (-d "$parentdir/$dircontent") {
	  print "Dir: $dircontent\n";
	} elsif (-f _) {
	  print"File: $dircontent\n";
	} else {
	  print "Something else: $dircontent\n";
	}
}
closedir(DIRCONTENT);


Note the use of ``-f _''.

--
Hope this helps,

HansM


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

Date: Sun, 23 Mar 1997 17:40:42 +0000
From: Eric Poindexter <eric@nettown.com>
To: Mousheng Xu <mxu@eecs.ukans.edu>
Subject: Re: : Q: cgi --directly execute program with added-information
Message-Id: <33356B1A.153FC1B9@nettown.com>

Mousheng Xu wrote:
> 
> Dear Perl/CGI experts:
>         In a perl cgi program, if one wants to go to another program
> after some
> work, he can use require("anotherprogram.cgi") to do it. But How if I
> have to give my "anotherprogram.cgi" some extra information
> which is normally passed through $ENV variable? Suppose I want to pass
> STUDENT-ID=12345 to "anotherprogram.cgi", is there a nice way to do it?
> I know you can use <form action="anotherprogram.cgi?STUDENT-ID=12345">
> ... to achieve this with one mouse click. Suppose I don't want even a
> signle mouse click -- I want it directly go to "anotherprogram.cgi" with
> "STUDENT-ID=12345" as the environment information.
>         Thanks in advance. Any help is highly appreciated.
> 
> M. Xuprint "Location:

Do a redirect with a GET method:

print "Location:
    http://nettown.com/perl/eg/CGI_Lite.eg.cgi?msg=hello\n\n";
exit;

Be sure to exit after the redirect.

In the redirected-to program, in the above case,
$ENV{QUERY_STRING} will contain "msg=hello"

--
Eric
<mailto:eric@nettown.com>
[http://nettown.com/perl/]
have a good day! (yes, Poindexter is Really my name :-)


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

Date: Mon, 24 Mar 1997 03:35:49 GMT
From: wwalsh@wxweb.ml.org (William X. Walsh)
Subject: Re: Bringing more traffic to your web site
Message-Id: <3338f55a.25846669@news.lightspeed.net>

It is IMHO that search engines generate LITTLE if ANY traffic to your
site, at least not much in the way of quality traffic.

And besides, with SO MANY >>>>>FREE<<<<< submission services, WHY PAY?

check out http://www.submit-it.com for one free resource for this.

Email me if you want more, we are developing a web site specifically
listing FREE RESOURCES for web site owners/developers, and it should
be up in April.

Till then, email me and I will answer as best I can about free
resources.

William Walsh
WXWeb Services
http://wxweb.ml.org
wwalsh@wxweb.ml.org

50MB Virtual Servers with FULL CGI for $29.95/mo
check it out at http://wxweb.ml.org/virtual



On 23 Mar 1997 18:25:38 GMT, ellison@ingress1.murdoch.edu.au (Tony
Ellison[ny][shoplet.com]) wrote:

>
>                INTERNET PROMOTION OUTLET
>
>           (http://www.shoplet.com/pr/index.html)
>
>
>More important than how great your site looks is making sure that
>people come to visit. There are many search engines, directories and
>sites on the Internet.  Listing your site on all of them can be very
>time consuming and frustrating task.  Now, you can enlist your site
>with 50, 100, or 150 top search engines in two minutes for as low as:
>
>
>
>        * Index In Top 50 Search Engines for only  $9.95
>
>        * Index In Top 100 Search Engines for only  $19.95
>
>        * Index In Top 150 Search Engines for only  $29.95
>
>
>
>We will provide you with the confirmation of each search engine that
>your site was indexed successfuly. We will also offer to monitor your
>site activity before and after.
>
>We accept, Visa, Amex, MasterCard, and Discover.
>
>
>For more please see:  http://www.shoplet.com/pr/index.html
>
>
>Thank you,
>
>Tony Ellison
>
>President
>
>
>
>





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

Date: Sun, 23 Mar 1997 23:01:11 GMT
From: jtbell@presby.edu (Jon Bell)
Subject: Re: case sensativity
Message-Id: <E7IqLz.ACA@presby.edu>

 Andrew M. Langmead <aml@world.std.com> wrote:
>mirage@tsil.net writes:
>
>>Is there anyway to keep Perl, Java, JavaScript, etc from being 
>>case sensitive?
>
>I think that I'm missing something, first you compain about perl
>et. al. being case sensitive. (That the identifers, $VAR, $Var, and
>$var are different.) and then complain that you can't use mixed case
>(To me implying that you must use $var, and the identifiers $VAR or
>$Var are illegal.) Or are you saying that because the identifiers are
>case sensitive you force yourself to use all lowercase letters to
>prevent using the wrong case?

No, he's saying that he wants (for example) $var, $VAR, $Var, $VaR, etc, to 
all refer to the same variable.  This is the way Pascal works.  I bet 
that's the language he's coming from.  

-- 
Jon Bell <jtbell@presby.edu>                        Presbyterian College
Dept. of Physics and Computer Science        Clinton, South Carolina USA
[for beginner's Usenet info, see http://web.presby.edu/~jtbell/usenet/ ]


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

Date: 24 Mar 1997 03:45:51 GMT
From: arpad@tezcat.com (Arpad Geller)
Subject: Re: DB_File.pm?
Message-Id: <5h4tdf$gh9@chinx10.tpa.net>

In article <5h31kg$8ba@pheidippides.axion.bt.co.uk>, pmarquess@bfsec.bt.co.uk 
says...
>
>[ Posted & Mailed ]
>
>Jonathan R. Seagrave (jrs@abiogenesis.com) wrote:
>: Hi.  This little sample program works fine with MacPerl 5.1.3.r2 but
>: doesn't work under NeXTStep 3.2 with perl 5.00301.  according to the NeXT
>: there's no DB_File.pm file.  In fact, there *is* no DB_File.pm in with the
>: other .pm files.
>
>If it didn't get installed, it means that Configure didn't find db on
>your system. It needs to find both db.h and libdb.a in one of the
>standard include & library directories.
>
>:                                                                        Is

I'm having similar problems on NeXT3.3.

I couldn't get db.1.85 compiled on the NeXT so I got someone
else's copy of libdb.a (already compiled Quad FAT) which I
stuck in /usr/local/lib

Then, I had to move db.h from the db.1.85/include directory into
/usr/local/include.

Then, I had to tell Configure (when recompiling Perl)  to also search 
/usr/local/lib for libraries and /usr/local/include for headers.  I also 
had to specify to it to build all of the extensions it was going to build -- 
I have gdbm and ndbm installed (GDBM_File, NDBM_File) -- and ALSO DB_File.

I was then missing cdefs.h in /usr/local/lib/sys, so someone sent it to me as 
an attachment and I also installed that.

Now, I'm almost through the Perl compile but not quite.

I get:

        Making DB_File (dynamic)
Writing Makefile for DB_File
 ../../miniperl -I../../lib -I../../lib ../../lib/ExtUtils/xsubpp -noprototypes 
-typemap ../../lib/ExtUtils/typemap -typemap typemap DB_File.xs >DB_File.tc && 
mv DB_File.tc DB_File.c
cc -c  -DUSE_NEXT_CTYPE -O     -DVERSION=\"1.01\"  -DXS_VERSION=\"1.01\"  
-I../..  DB_File.c
DB_File.c: In function `ParseOpenInfo':
DB_File.c:322: warning: assignment from incompatible pointer type
DB_File.c:362: warning: assignment from incompatible pointer type
Running Mkbootstrap for DB_File (/usr/local/lib/libdb.a)
Writing DB_File.bs
chmod 644 DB_File.bs
LD_RUN_PATH="/usr/local/lib" ld -o ../../lib/auto/DB_File/DB_File.so -r 
-L/usr/local/lib DB_File.o    -L/usr/local/lib 
chmod 755 ../../lib/auto/DB_File/DB_File.so
cp DB_File.bs ../../lib/auto/DB_File/DB_File.bs
chmod 644 ../../lib/auto/DB_File/DB_File.bs


and it compiles but Perl can't find DB_File.pm and, in fact, it doesn't
exist in the Perl module directory.

-- 
Peace,
David 
arpad@tezcat.com
Chicago, IL
    UNSOLICITED COMMERCIAL EMAIL IS NOT APPRECIATED
The Internet is not your "free" advertising medium. We all pay



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

Date: 24 Mar 1997 03:43:32 GMT
From: arpad@tezcat.com (Arpad Geller)
Subject: dereferencing an object in a hash?
Message-Id: <5h4t94$gh9@chinx10.tpa.net>

I'm have question about accessing a method as the value
field when assigning a hash.

I can access $query->param($key) as a scalar value
properly in the print statement below but I can't
(no matter how I try to dereference it) get the value
into the value field of %Quest in the line after that.

Can someone help me with the proper syntax for this to
help me on my way to fully understanding Perl referencing?

No matter what I've tried, I always get "key=school value=HASH(0x1068fc)"
and not "key=school value=UIC".

Thanks.  CODE:


$query = new CGI;
	
tie (%Quest, GDBM_File, "filename", &GDBM_WRCREAT, 0640);
	
@names = $query->param;

foreach $key (@names) {
	print "key = $key value = ", $query->param($key), "\n";
	$Quest{$key} = {$query->param($key)};
}

untie (%Quest);


-- 
Peace,

David Geller
arpad@tezcat.com
Chicago, IL
    UNSOLICITED COMMERCIAL EMAIL IS NOT APPRECIATED
The Internet is not your "free" advertising medium. We all pay



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

Date: 23 Mar 1997 20:39:14 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: File upload
Message-Id: <5h44di$bg@fridge-nf0.shore.net>

Raul Almquist (imrs@winternet.com) wrote:

:   You can try using CGI.pm but I would not recommend using it as it has
: too many lacks (esp. a functional upload example), however you could get
: CGI_Lite.pm which is currently in v1.7 from any CPAN site, it does work
: pretty good.

P'shaw!  CGI.pm is just fine; in fact, it's great, and even better when it's
discussed in the proper forum: comp.infosystems.www.authoring.cgi.  The
beauty of Perl modules is that you can add functionality (or extend) an
existing module if it lacks the functionality you need.  What CGI.pm might
"lack" in terms of file uploading, it certainly compensates 100-fold with
its other functionality - plus it's nicely documented.

--
Nathan V. Patwardhan
nvp@shore.net



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

Date: 23 Mar 1997 13:22:59 -0700
From: mfuhr@dimensional.com (Michael Fuhr)
Subject: Re: Getting the time for a date
Message-Id: <5h43f3$k82@nova.dimensional.com>

    [cc to author]
brian@brie.com (Brian Lavender) writes:

>I am trying to get the time for a date in seconds. As far as I can
>see, the function time returns the current time in seconds since the
>date January 1, 1970. I want to get the time for another date. How do
>I do that?

Check out the Date::Manip module on CPAN.

-- 
Michael Fuhr
http://www.dimensional.com/~mfuhr/


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

Date: Sun, 23 Mar 1997 19:05:24 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: bergy@abacom.com
Subject: Re: Help!: database data replacement with perl
Message-Id: <Pine.GSO.3.96.970323185146.29414C-100000@kelly.teleport.com>

On Sun, 23 Mar 1997, Bergy wrote:

> What is the best way to replace a
> data field in a separate text file with perl? e.g:
> 
> data.txt opened:
> John;Smith;3;65;(819)555-5555;
> 
> and I want to replace 65 by 75...
> Further more, I would like to erase this line from my database.

You want to edit the data that you're about to delete? You must have
experience in government work. In any case, there are good methods for
editing text files in a FAQ near you. Hope this helps!

    news:comp.lang.perl.announce
    http://www.perl.com/CPAN/doc/manual/html/pod/perlfaq.html
    http://www.perl.org/CPAN/doc/manual/html/pod/perlfaq.html

-- Tom Phoenix        http://www.teleport.com/~rootbeer/
rootbeer@teleport.com   PGP  Skribu al mi per Esperanto!
Randal Schwartz Case:     http://www.lightlink.com/fors/



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

Date: Sun, 23 Mar 1997 18:06:47 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Chris <webmaster@surewould.com>
Subject: Re: How can I find the current working directory?
Message-Id: <Pine.GSO.3.96.970323180625.29414B-100000@kelly.teleport.com>

On Sun, 23 Mar 1997, Chris wrote:

> Subject: How can I find the current working directory?

If you type 'perldoc cwd' you might get a nice surprise. :-)

-- Tom Phoenix        http://www.teleport.com/~rootbeer/
rootbeer@teleport.com   PGP  Skribu al mi per Esperanto!
Randal Schwartz Case:     http://www.lightlink.com/fors/



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

Date: 23 Mar 1997 20:56:43 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: How to drop .cgi on perl script?
Message-Id: <5h45eb$c01$1@csnews.cs.colorado.edu>

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

In comp.lang.perl.misc, 
    soccer@microserve.net (Geoffrey Hebert) writes:
:I am writing a general purpose routine.  The routine would cross
:reference a perl script or group of perl scripts.  Currently all my
:perl scripts require .cgi at the end.
:
:What must be done to eliminate this requirement?

You have a misconfigured web server.  Somewhere you have a mediatype
(mimetype) that says that to execute it should end in dot-cgi.  this is
a bad idea.  much better to constrain exec-cgi rights on a per-directory
basis, not a per-extension basis.

You know, this actually has nothing to do with Perl.  I'd sniff
around the cgi group instead if I were you.

--tom
-- 
	Tom Christiansen	tchrist@jhereg.perl.com
    It won't be covered in the book.  The source code has to be useful for
    something, after all...  :-)
            --Larry Wall in <10160@jpl-devvax.JPL.NASA.GOV>


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

Date: 24 Mar 1997 01:04:46 GMT
From: ccrox39754@aol.com
Subject: Is CGI a part of or similiar to Perl?
Message-Id: <19970324010400.UAA00999@ladder01.news.aol.com>

I've seen numerous references in this newsgroup to cgi. Is CGI a part of perl or are we talking about two different things here? I realize this may be a stupid question, but I hope maybe someone can explain it.

Thanks,

Carlos Croxton


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

Date: 23 Mar 1997 18:47:30 -0700
From: mfuhr@dimensional.com (Michael Fuhr)
Subject: Re: Is CGI a part of or similiar to Perl?
Message-Id: <5h4mfi$qkf@nova.dimensional.com>

ccrox39754@aol.com writes:

>I've seen numerous references in this newsgroup to cgi. Is CGI a part of perl or are we talking about two different things here? I realize this may be a stupid question, but I hope maybe someone can explain it.

The Common Gateway Interface (CGI) is the protocol that web servers
use to communicate with other programs.  Perl is a programming
language.  While Perl is currently the most popular language for
writing CGI programs, you could use any other suitable language
for the same purpose.  CGI and Perl might be in bed together, but
they're not married :-)

Here are a few useful links on CGI and Perl:

    http://hoohoo.ncsa.uiuc.edu/cgi/
    http://www.cis.ohio-state.edu/hypertext/faq/usenet/www/cgi-faq/faq.html
    http://www.perl.com/perl/faq/
    http://www.perl.com/perl/faq/perl-cgi-faq.html

There's also a CGI newsgroup:

    news:comp.infosystems.www.authoring.cgi

Hope this helps.
-- 
Michael Fuhr
http://www.dimensional.com/~mfuhr/


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

Date: Mon, 24 Mar 1997 01:56:42 GMT
From: jtbell@presby.edu (Jon Bell)
Subject: Re: Is CGI a part of or similiar to Perl?
Message-Id: <E7IyqJ.1D0@presby.edu>

  <ccrox39754@aol.com> wrote:
>I've seen numerous references in this newsgroup to cgi. Is CGI a part of 
>perl or are we talking about two different things here? I realize this 
>may be a stupid question, but I hope maybe someone can explain it. 

CGI (Common Gateway Interface) refers to a type of software that is used
in conjunction with Web servers and Web pages.  Perl is a programming
language that is often used for writing CGI software, because it has 
excellent text-manipulation facilities.

-- 
Jon Bell <jtbell@presby.edu>                        Presbyterian College
Dept. of Physics and Computer Science        Clinton, South Carolina USA
[for beginner's Usenet info, see http://web.presby.edu/~jtbell/usenet/ ]


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

Date: Sun, 23 Mar 1997 17:47:49 +0000
From: Eric Poindexter <eric@nettown.com>
To: Eric Poindexter <eric@nettown.com>
Subject: NOTE: Re: : Q: cgi --directly execute program with added-information
Message-Id: <33356CC5.41E38E2F@nettown.com>

Eric Poindexter wrote:
> 
> Mousheng Xu wrote:
> >
> > Dear Perl/CGI experts:
> >         In a perl cgi program, if one wants to go to another program
> > after some
> > work, he can use require("anotherprogram.cgi") to do it. But How if I
> > have to give my "anotherprogram.cgi" some extra information
> > which is normally passed through $ENV variable? Suppose I want to pass
> > STUDENT-ID=12345 to "anotherprogram.cgi", is there a nice way to do it?
> > I know you can use <form action="anotherprogram.cgi?STUDENT-ID=12345">
> > ... to achieve this with one mouse click. Suppose I don't want even a
> > signle mouse click -- I want it directly go to "anotherprogram.cgi" with
> > "STUDENT-ID=12345" as the environment information.
> >         Thanks in advance. Any help is highly appreciated.
> >
> > M. Xuprint "Location:
> 
> Do a redirect with a GET method:
> 
> print "Location:
>     http://nettown.com/perl/eg/CGI_Lite.eg.cgi?msg=hello\n\n";
> exit;
> 
> Be sure to exit after the redirect.
> 
> In the redirected-to program, in the above case,
> $ENV{QUERY_STRING} will contain "msg=hello"
> 
> --
> Eric
> <mailto:eric@nettown.com>
> [http://nettown.com/perl/]
> have a good day! (yes, Poindexter is Really my name :-)

Oops! my editor did a line wrap in the above, there must be only one
space between Location: and http

Please change to:

print 
"Location: http://nettown.com/perl/eg/CGI_Lite.eg.cgi?msg=hello\n\n";

So sorry for the confusion.
--
Eric
<mailto:eric@nettown.com>
[http://nettown.com/perl/]
have a good day! (yes, Poindexter is Really my name :-)


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

Date: Sun, 23 Mar 1997 15:30:29 -0800
From: mwithers@bvox.salk.edu (Mason Withers)
Subject: Problems Installing Perl 5
Message-Id: <mwithers-2303971530290001@lcn15.salk.edu>

I'm trying to install Perl 5, and I can get past the "sh Configure" and
"makedepend" stages. But when it is time to make the application during
the cc phase, I get:

ld:
atan
cos
pow
sin
(and a few other math functions)
***Error code 1 (bu 21)

Does this mean that my math functions are hidden in somehow hidden in a
library where the "make" app doesn't know where to look? I have no idea,
everything else seems to be moving along fine.

Thanks in advance,
Mason Withers
Salk Institute

-- 
--Salk Insititute--


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

Date: Mon, 24 Mar 97 03:44:44 GMT
From: appleo@cybercomm.net (Apple-O)
Subject: q: multikey lists, sort by key#1,key#2, save/load, etc?
Message-Id: <5h4t4k$e65$1@news.nac.net>

in perl i need to sort a list with x number of columns by different keys 
(either key#1, key#2, key#3, etc)

i would like to store the list as a tab-delimited text file. 

i was told perl 5 has provisions for multidimensional arrays, which i 
would use to handle the list. 

how do you implement multidim arrays and sort them by diff keys? 

* please try to keep any sample code to simple elemental commands 
and not the complicated does 1000 things in 1 line kind of stuff, 
it's much easier for me to understand perl scripts written in the 
style of c or pascal


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

Date: Sun, 23 Mar 1997 12:12:08 -0700
From: Andrew Koons <andy@wwdatalink.com>
Subject: Question
Message-Id: <33358088.1B73@wwdatalink.com>

Does anyone know of a way to block specific countries from entering a
page, using either a perl program or the server setup.

Andrew Koons
andy@wwdatalink.com


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

Date: 23 Mar 1997 18:33:15 -0500
From: jlerner@panix.com (Joshua Lerner)
Subject: Re: Question
Message-Id: <5h4ejr$809@panix3.panix.com>

In article <33358088.1B73@wwdatalink.com>,
Andrew Koons  <andy@wwdatalink.com> wrote:
>Does anyone know of a way to block specific countries from entering a
>page, using either a perl program or the server setup.

If you just want to restrict access for a single page, you can make that
page a CGI script.  The script can try to figure out the client's hostname
by looking it up with the IP address that is stored in a particular
environment variable (REMOTE_HOST I think).  If the top-level domain is
one you disapprove of, don't print out the content.  You'd print out an
error message of some kind, I hope. 

You may be better off configuring your Web server to do this, especially
if you want to restrict access to the entire site in this way.

Good luck,

Joshua Lerner


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

Date: Sun, 23 Mar 1997 22:23:06 GMT
From: Can Gokceatam <webmaster@amygrant.org>
Subject: Question: Redirecting to URLs...
Message-Id: <3335AD4A.1E25@amygrant.org>

Hi,

I wrote a webring program for visitors to travel around the
websites/pages
which are included in the ring. However I have a problem. I'm
redirecting
visitors to URLs with the "Location: $location" command.
It works fine for all the sites without frames. But when some site comes
up with frames and that site's visitor tries going to another site,
problems
arise due to frames. In HTML words, how can I use the TARGET="_top" tag
when
I'm redirecting to a new URL ? Is there any trick to do that ?

I'd appreciate if you can e-mail it to: webmaster@amygrant.org
since I can't catch up with the newsgroups much.

Best regards,

Can Gokceatam
-- 
________________________________________

 Can Gokceatam                           
 e-mail: webmaster@amygrant.org
 WWW   : http://www.amygrant.org/home/      
 CSE - The University of Toledo, OH
________________________________________


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

Date: 24 Mar 1997 01:12:11 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: regex for UNIX usernames needed!
Message-Id: <5h4kdb$mt3$2@csnews.cs.colorado.edu>

 [courtesy cc of this posting sent to various people via email]

In comp.lang.perl.misc, Tim Pierce <twpierce+usenet@mail.bsd.uchicago.edu> writes:
:Randal Schwartz  <merlyn@stonehenge.com> wrote:
:>I seriously doubt you'll find *any* UNIX system out there where in
:>response to "login:", someone can type "j.r.hacker".
:
:Solaris permits this, but, well, Solaris.

Doesn't POSIX dot 1 or dot 2 say something about what may go
into a login name?  

--tom
-- 
	Tom Christiansen	tchrist@jhereg.perl.com

    #else /* !STDSTDIO */     /* The big, slow, and stupid way */
        --Larry Wall in str.c from the 4.0 perl source code


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

Date: 24 Mar 1997 01:25:53 GMT
From: Hans Mulder< hansm@icgned.nl>
Subject: Re: Single character representing all regexp metacharacters? wheeere?
Message-Id: <5h4l71$o03@news.euro.net>

x@apocalypse.org wrote:

> Is there a single escaped character which represents all the
> metacharacters recognized by the perl regexp engine?

> I'm trying to program a simple search engine with user input...
> The only solution I've found, which I hate, is, for each metacharater,
> to preprend it with a backslash. It would be much easier to say:
> $user_input = s/(\metagroup)/\\$1/g

The character you're looking for is W:

	$user_input = s/(\W)/\\$1/g;

does the trick.  You can speed it up a bit by using

	$user_input = s/\W/\\$&/g;

instead.  In perl5, you can also do

	$user_input = quotemeta $user_input;

or

	$user_input = "\Q$user_input";

--
Hope this helps,

HansM


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

Date: Sun, 23 Mar 1997 20:41:25 GMT
From: shyde@poboxes.com (Simon Hyde (aka Jeckyll))
Subject: Re: Taking parameters from scrollboxes and then displaying a particular html file
Message-Id: <333594e7.16736109@news.uni-stuttgart.de>

On 22 Mar 1997 08:17:01 -0700, keefner@primenet.com (Craig A. Keefner)
wrote:

>I want to take input parameters from 2 select boxes and then
>if/an pazrameters equal something, then display a certain
>html file.
>
>There are 17 different html files I'd like to display based on whats
>input so I want to avoid having all of them in the actual pl script
>as sub routines to jump to and display.  I'd rather just call up
>the existing file outside the script.
>
>Any ideas?
>
How does this look:

#!/usr/local/bin/perl
use CGI;
$q = new CGI;
if ($q->param()){
	unless(defined($q->param('param1')) &&
defined($q->param('param2'))){
		print $q->header(-status=>'500 Internal Server
Error');
		print $q->start_html('Internal Server Error'),
$q->h1('Internal Server Error');
		print "One of the required fields was not filled out,
please correct the form below and re-submit:";
		print $q->p;
	}else{
		while (<DATA>){
			next if /^\s*$/;
			chomp;
			($param1, $param2, $url) = split(/\t+/);
			if($param1 eq $q->param('param1') && $param2
eq $q->param('param2')){
				print $q->redirect($url);
				exit;
			}
		}
		print $q->header, $q->start_html('Error'),
$q->h1('Error - Field combination not found');
		print "Please fill out the form below and re-submit
with different values:", $q->p;
	}
}else{
	print $q->header, $q->start_html('Submit Boxes');
	print $q->h1('Submit Boxes'), $q->hr, "Please fill out and
submit this form:", $q->p;
}
while (<DATA>){
	next if /^\s*$/;
	($param1, $param2, $url) = split(/\t+/, $_);
	$FIRST{$param1} = 1;
	$SECOND{$param2} = 1;
}
print $q->start_form;
print $q->h3('CPAN Site: ' . $q->popup_menu(-name=>'param1',
-values=>[sort(keys(%FIRST))]));
print $q->h3('CPAN Area: ' . $q->popup_menu(-name=>'param2',
-values=>[sort(keys(%SECOND))]));
print $q->submit(-value=>'Go There'), $q->end_form;
print $q->end_html;
__END__
Multiplexer		Readme	http://www.perl.com/CPAN/readme.html
Multiplexer		Ports	http://www.perl.com/CPAN/ports/
Multiplexer		Modules	http://www.perl.com/CPAN/modules/
Multiplexer		CGI.pm
http://www.perl.com/CPAN/modules/by-module/CGI
Demon Internet Mirror	Readme
ftp://ftp.demon.co.uk/pub/mirrors/perl/CPAN/readme.html
Demon Internet Mirror	CGI.pm
ftp://ftp.demon.co.uk/pub/mirrors/perl/CPAN/modules/by-module/CGI
Demon Internet Mirror	Ports
ftp://ftp.demon.co.uk/pub/mirrors/perl/CPAN/ports/
Demon Internet Mirror	Modules
ftp://ftp.demon.co.uk/pub/mirrors/perl/CPAN/modules/

---
Yours Sincerely,
                                      ,                     
   () o                              /|   |          |      
   /\     _  _  _    __   _  _        |___|        __|   _  
  /  \|  / |/ |/ |  /  \_/ |/ |       |   |\|   | /  |  |/  
 /(__/|_/  |  |  |_/\__/   |  |_/     |   |/ \_/|/\_/|_/|__/
                                               /|           
                                               \|           
(Simon Hyde)
/****************How To Contact Me******************\
|         Internet Email: shyde@POBoxes.com         |
\***************************************************/


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

Date: 24 Mar 1997 03:29:08 GMT
From: bill@sover.net.no.junkmail (Bill)
Subject: Re: Unix 'Cat' equivelent
Message-Id: <slrn5jbt84.5jg.bill@granite.sover.net>

In article <5gjilt$6a4@kodak.rdcs.Kodak.COM>, Bryan Grenn wrote:
>I'm trying to replace a lot of my unix scripts
>with perl.  I'm having problems trying to do
>simple file manipulation..
>
>ie 
>
>
>cat filea.txt fileb.txt filec.txt > newfile.txt
>
>How can I easlily do this in perl ???? 

   Here's a quick and easy cat clone:

#!/usr/bin/perl -w

  while (<>) {
      print;
  }

This should work for you if your shell does wildcard expansion (hint: 
command.com doesn't).  The above simply reads in the data from STDIN 
and/or the files specified on the command line, and prints it out.  If 
you want to grab the data from inside a Perl script (which is what I 
think you meant now that I reread your message) you can use backticks, 
which return the output of commands run in a fashion similar to system():

  @lines_in_all_files = `cat file1.txt file2.txt file3.txt`;

You could then write these lines out to newfile.txt with:

  open(OUTPUT, ">newfile.txt") or die "Couldn't create newfile.txt: $!\n";
  foreach (@lines_in_all_files) {
      print OUTPUT;
  }

Hope this helps...
						Bill
-- 
Sending me unsolicited email through mass emailing about a product or
service your company sells ensures that I will never buy or recommend your
product or service.



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

Date: Sun, 23 Mar 1997 22:03:21 GMT
From: jcongson@mail.cybernex.net (John Congson)
Subject: Re: What's a good Perl book?
Message-Id: <333aa7d8.18546077@news.cybernex.net>

On 17 Mar 1997 05:41:05 GMT, jgoerzen@complete.org (John Goerzen)
wrote:

>On Tue, 11 Mar 1997 19:37:15 -0600, Tad McClellan <tadmc@flash.net> wrote:
>>
>>"Programming Perl" by Larry Wall, Tom Christiansen and Randal Schwartz
>
>Let us not forget that it is important to get the **second edition** of this
>book!
>
>>both available from:
>>
>>http://www.ora.com

O'Reilly & Associates, Inc. has a policy where they will give you 25%
off the newer version if you send them the first page of a previous
edition of a publication with the same title.  Not bad!  As with all
books, be sure to check the ftp-errata section at O'Reilly's site.  I
remember banging my head a few years back after typing in some of
their source code just to find out that there was a typo in the book!

Regards,

John Congson
jcongson@mail.cybernex.net


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

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

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