[6915] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 540 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu May 29 16:28:02 1997

Date: Thu, 29 May 97 13:00:26 -0700
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, 29 May 1997     Volume: 8 Number: 540

Today's topics:
     $ENV{PWD} versus `pwd' <dorman@s3i.com>
     Re: $ENV{PWD} versus `pwd' (Even Holen)
     Re: ---: Basic Perl question! Please HELP :------------ (Hank C. Lee)
     Re: ---: Basic Perl question! Please HELP :------------ <hulk@byu.edu>
     Re: Arg. This isn't a CGI question, really it isn't. (Tung-chiang Yang)
     Re: Arg. This isn't a CGI question, really it isn't. (Even Holen)
     Bored?  Want to evaluate my first (usefull) perl script (Mark Bainter)
     Re: getopt examples (Hope this helps!)
     Re: How to directly interact with a cgi-script somewher (Hope this helps!)
     Re: Idiom for list summation? <merlyn@stonehenge.com>
     Re: Inheritance help (Jim Miner)
     Re: Just a long shot ... (Even Holen)
     Re: MACPERL - is it (Chris Nandor)
     Re: ODBC.pm and Parameter Queries <a@b.c>
     OS/2 : Backticks causing runtime crash <craig@indelible-blue.com>
     Re: PERL SCRIPT FOR PASSOWRD <LBrugman@acromag.com>
     Re: Question: Pattern Matching and Counter Variables (Chipmunk)
     Segmentation fault in lib/odbm.t with 5.004 under Solar (Harry Edmon)
     Re: Segmentation fault in lib/odbm.t with 5.004 under S (Mike Heins)
     Re: Standalone web database for Perl? <a@b.c>
     Re: String comparsion <dorman@s3i.com>
     Re: Tatum O'Neil <merlyn@stonehenge.com>
     Re: track user (Tung-chiang Yang)
     troff processing package anywhere? (Logan Ratner)
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: 29 May 1997 13:38:24 -0400
From: Clark Dorman <dorman@s3i.com>
Subject: $ENV{PWD} versus `pwd'
Message-Id: <div02w54f.fsf@s3i.com>


Greetings,
	I admit that I'm very confused.  In my application, I need to change
the working directory fairly frequently, creating subdirs, removing them,
etc.  I was under the impression that the ENV hash gives me the current
environment.  Therefore, if I change the environment within the perl script
that the ENV hash will change.  From perlvar:

     $ENV{expr}
             The hash %ENV contains your current environment.
             Setting a value in ENV changes the environment for
             child processes.


See the following code is name write_test.pl :
----------------------------------------------------------------------
#!/home/dorman/bin/perl -w

$save_pwd  = $ENV{PWD};				  # save present location
print STDERR "The saved pwd is ($save_pwd)\n";

$newlocation = "/home/dorman/";

chdir "$newlocation" or die "cannot chdir into ($newlocation)";

$new_pwd = $ENV{PWD};
print STDERR "The new pwd is   ($new_pwd)\n";

$alt_pwd = `pwd` ;
chomp( $alt_pwd );
print STDERR "The alt pwd is   ($alt_pwd)\n";
----------------------------------------------------------------------

This produces:

grant:testdir (1:28pm) 147% write_test.pl 
The saved pwd is (/home/dorman/SBIR/learn_perl/testdir)
The new pwd is   (/home/dorman/SBIR/learn_perl/testdir)
The alt pwd is   (/home/dorman)
grant:testdir (1:29pm) 148% 

Grrr....this would seem to be "wrong" to me.  If I change the
directory that we are "in" using chdir, the environment has changed,
and when I look at the ENV hash, it should change as well.

This brings up the next question:  how do I determine which directory
I'm working in _without_ doing system calls?  

-- 
Clark Dorman				"Evolution is cleverer than you are."
http://cns-web.bu.edu/pub/dorman/D.html                -Francis Crick


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

Date: 29 May 1997 18:46:38 GMT
From: evenh@bigblue.pvv.ntnu.no (Even Holen)
Subject: Re: $ENV{PWD} versus `pwd'
Message-Id: <slrn5orjoe.tds.evenh@bigblue.pvv.ntnu.no>

In article <div02w54f.fsf@s3i.com>, Clark Dorman wrote:
>	I admit that I'm very confused.  In my application, I need to change
>the working directory fairly frequently, creating subdirs, removing them,
>etc.  I was under the impression that the ENV hash gives me the current
>environment.  Therefore, if I change the environment within the perl script
>that the ENV hash will change.  From perlvar:
>
>     $ENV{expr}
>             The hash %ENV contains your current environment.
>             Setting a value in ENV changes the environment for
>             child processes.

This is indeed correct, but you've stumbled across a special case.
Because the $ENV{PWD}, or the $PWD in you current environment is ment to
reflect whatever working directory you are in at the time being. That is
you don't change it to change directory, but each time you change the
directory it changes...

In this context it's quite natural that you get the given output.

>Grrr....this would seem to be "wrong" to me.  If I change the
>directory that we are "in" using chdir, the environment has changed,
>and when I look at the ENV hash, it should change as well.

No, it's correct behaviour albeit not what you wanted.

>This brings up the next question:  how do I determine which directory
>I'm working in _without_ doing system calls?  

You don't?

In my experience you do need to a least one system call to get your
starting point. But after you've done this once it should be relatively
easy to keep track on where you are. Or that from time to time you
changes the current directory to a given location (say your starting
point, which you've got from pwd or similar.

Hope this helps.

Regards,
Even Holen
-- 
<><   Even Holen, evenh@pvv.ntnu.no, http://www.pvv.ntnu.no/~evenh/   :-)


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

Date: 29 May 1997 17:04:36 GMT
From: raistlin@mictlan.sfsu.edu (Hank C. Lee)
Subject: Re: ---: Basic Perl question! Please HELP :-----------------
Message-Id: <5mkcv4$bnb@news.csus.edu>

Farshad Abasi (fabasi@unixg.ubc.ca) wrote:
: <frame src="test.cgi" name=body>

: My script runs OK from the shell (ie if I type "perl test.cgi" it generates the 
: page OK, but if I go to the web browser and try the script off my server (ie 
: http://myurl.com/test.cgi) then nothing works.

: This test.cgi is a VERY basic script just sptiing a sample html page using 
: several print calls. So what I want it to do is to set up HTM in one of my frames...

Check your file permissions. Most HTTP servers are running as 'nobody', 
therefore your scripts must be other-readable and other-executable.

--

+-------------------------------------------------------------------------+
| Hank Lee                         raistlin@mictlan.sfsu.edu              |
+-------------------------------------------------------------------------+


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

Date: Thu, 29 May 1997 10:09:59 -0600
From: Dave Banner <hulk@byu.edu>
To: Farshad Abasi <fabasi@unixg.ubc.ca>
Subject: Re: ---: Basic Perl question! Please HELP :-----------------
Message-Id: <338DAA56.7B0@byu.edu>

Farshad Abasi wrote:
> 
> Hello,
> 
> Is this a valid call to a PERL script? I am not having any luck with it :-(
> 
> <frame src="test.cgi" name=body>
> 
> My script runs OK from the shell (ie if I type "perl test.cgi" it generates the
> page OK, but if I go to the web browser and try the script off my server (ie
> http://myurl.com/test.cgi) then nothing works.

This is probably a question for the CGI newsgroups, but since you're
here...

Check these three things:
1. permissions. If the web runs as a certain user, execute permissions
need to be set for that user.

2. #!/usr/local/bin/perl (or whatever the path to perl is on your
machine) needs to be the first line of your script. 

3. http header. Your first print statement should have a valid header
followed by two newlines, i.e. "Content-type: text/html\n\n".

Hope this helps.

-Dave
-hulk@byu.edu


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

Date: Thu, 29 May 1997 18:45:52 GMT
From: tcyang@netcom.com (Tung-chiang Yang)
Subject: Re: Arg. This isn't a CGI question, really it isn't.
Message-Id: <tcyangEAyHGG.12D@netcom.com>

Ans. This isn't a Perl question, really it isn't.

==========================
Andy Shaw (a.j.shaw@shef.ac.uk) wrote:
: I would like to be able to test my cgi programs on my stand-alone pc at
: home, without having to set up the ENV{"QUERY_STRING"} and similar each
: time I do it. I would really like to have a program which would act like
: httpd, but I don't have the network services to use one. Any Ideas on
: programs/scripts/daemons I can use to make my PC pretend to be networked
: to itself?

--
Tung-chiang Yang                       tcyang@netcom.com

soc.culture.taiwan, soc.culture.china (by SCC FAQ Team) FAQ's:
   http://www.iglou.com/tcyang/Taiwan_faq.shtml, China_faq.shtml


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

Date: 29 May 1997 18:51:37 GMT
From: evenh@bigblue.pvv.ntnu.no (Even Holen)
Subject: Re: Arg. This isn't a CGI question, really it isn't.
Message-Id: <slrn5ork1p.tds.evenh@bigblue.pvv.ntnu.no>

In article <338D5839.167E@shef.ac.uk>, Andy Shaw wrote:
>I would like to be able to test my cgi programs on my stand-alone pc at
>home, without having to set up the ENV{"QUERY_STRING"} and similar each
>time I do it. I would really like to have a program which would act like
>httpd, but I don't have the network services to use one. Any Ideas on
>programs/scripts/daemons I can use to make my PC pretend to be networked
>to itself?

I haven't studied the last modules concerning how to debug CGI-script
offline. But I do know the following: The $ENV{...} is just a reflection
of your current environment. Which leads to the following suggestion:
   Create a little script which sets the environment to whatever you
want it to be set to. (Customize this script according to OS and shell)

(
 If using DOS:
     Create a file, say myenv.bat, which contains lines like:
          set QUERY_STRING=myName=myValue
          set SOMETHING=somevalue
     And then just run this file before testing your script
)

Regards,
Even Holen
-- 
<><   Even Holen, evenh@pvv.ntnu.no, http://www.pvv.ntnu.no/~evenh/   :-)


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

Date: Thu, 29 May 1997 17:25:12 GMT
From: mark@michiana.net (Mark Bainter)
Subject: Bored?  Want to evaluate my first (usefull) perl script?
Message-Id: <338dba08.1305172669@news.michiana.net>

Thanks for the help Tim, I appreciate it.  

I have attached the (mostly) completed script.  It has been tested and
is in use at this point, however, it is not perfect I know.  There are
at least two modifications I want to make but I'm not really concerned
about them.  I am however interested in any feedback you (as a group)
might feel like giving me.  The problem with learning a language this
way is that bad habits get started easily and you don't know it till
they are ingrained in your style.  So, if you have some free time
(LOL)  and feel like reviewing a learning perl programmers first
script I would be interested in hearing your suggestions.  In style,
manner and so on.  I know that I stretched out some of it that could
have been done with less, but I'm still learning, and it makes it
easier to read and modify for me at this point.   



#!/usr/local/bin/perl5 -T	#w removed for release
#
# dialup -r <username>    Remove User from alias
# dialup -a <username>    Add user to alias
# dialup -v               View Alias Listing
# dialup -c <username>    Check if a username exists
#
#	Version 1.5
#	Created 5/28/97 by Mark Bainter 
#	for Turner Group, IN
#
#	Requires: Perl5, File, and Getopt modules.
#
#	Planned Improvements:
#		Enable processing list of names, on cmdline or from file.
#		Remove the capability of using RegExps with the -r option.
#
#
#

#use strict;		# Used for debugging.
use File::Copy;		# Used to make a backup.
use Getopt::Std;
use vars qw($opt_r $opt_a $opt_h $opt_v $opt_c @alias @time $mod $tmp $rm
		$login $ALIASFILE $NEWFILE); 

getopts('r:a:hvc:');

unless ( ($opt_h) || ($opt_r) || ($opt_a) ||
	($opt_v) || ($opt_c) )
  {
	$opt_h = 1;
  }

if ($opt_h == 1)
{
	print "\nSyntax for dialup:\n";
	print "\tdialup -r <username>\tRemove user from alias list.\n";
	print "\tdialup -a <username>\tAdd user to alias list.\n";
	print "\tdialup -v           \tView alias list.\n";
	print "\tdialup -c <username>\tCheck if a username is in the list\n";
	print "\n";
	exit;
}
if ($opt_r ne "")
{
	&Fill_Array;
	&Parse_Array($opt_r,1);
	&Write_Array;
}
if ($opt_a ne "")
{
	&Fill_Array;
	&Append_Array($opt_a);
	&Write_Array;
}
if ($opt_c ne "")
{
	&Fill_Array;
	&Parse_Array($opt_c,0);
}	
if ($opt_v == 1)
{
	&Fill_Array;
	&Display_Array;
}



sub Fill_Array
{
        $ALIASFILE = "/usr/lib/mail/dialup.list";
	open(ALIASFILE) or die "Cannot open data";
	while ( $tmp = <ALIASFILE> ) 
	{
		chop($alias[scalar(@alias)]=$tmp);
	}
	close ALIASFILE;
}

sub Display_Array
{
	foreach (@alias)
	{
		print "$_\n";
	}
}

sub Parse_Array
{
	my($rmalias,$rm) = @_;
	my(@newlist) = ();
	if ($rm)
	{
		foreach(@alias)
		{
			if($_ !~ /^$rmalias$/)
			{
				$newlist[scalar(@newlist)] = $_;
			}
		}
		@alias = @newlist;
	}
	else
	{
		foreach(@alias)
		{
			if ($_ =~ /$rmalias/)
			{
				print "$_ Found!\n";
			}
		}
	}
}

sub Append_Array
{
	my($newalias) = @_;
	$alias[scalar(@alias)] = $newalias;
}

sub Write_Array
{
   #Make a backup copy of the file first!
   $login = getlogin;
   copy("/usr/acct/mark/smw/dialup.list","/usr/acct/mark/smw/dialup.${login}");

	$NEWFILE = ">/usr/lib/mail/dialup.list";
	open(NEWFILE) or die("Unable to create file");
	select NEWFILE;

	foreach(@alias)
	{
		if ($_ ne "")
		{
			print $_,"\n";	
		}
	}
	
	select STDOUT;
	close STDOUT;
}
		
---
mailto:mark@turnergroup.com          
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GB/CS/CM/G/IT/P/O d++(+) s+(++):(-) a-- C++(+++)$ ULSC++++(on+++)$ P+>+++ L+ E--- W+$ N++$ !o !K w(++++)$ !O- M--(-) V-- PS--(---) PE++(+++) Y++ PGP++(+++)>++++ t+(++) 5++++(+++) X(-) R tv+ b+++(++++) DI++(+++)>++++ !D-- G>+++ e>+ h---(--) r+++ y+++(++++) 
------END GEEK CODE BLOCK------ 


--------------------------------------------------------------------------------------
 ex abusu non arguitur in usum                                      
 (the abuse of a thing is no argument against its use)  
--------------------------------------------------------------------------------------



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

Date: 29 May 1997 12:24:45 -0500
From: scribble@wwa.com (Hope this helps!)
Subject: Re: getopt examples
Message-Id: <5mke4t$nlv@shoga.wwa.com>

In article <3389CED4.2897@synnet.com>, Tom Lynch  <toml@synnet.com> wrote:
>	I am looking for an example of getopt () which will 
>	should how to error out if a switch which was not 
>	defined is on the command line. I have checked
>	perldoc and Deja news but no examples. What I am 
>	trying to do is if the user types -v and I have:
>
>	getopt ('p:');
>
>	I would like to error out saying "-v" unknown switch.

Use getopts(), which is also in Getopt::Std. It gives a ready-made
error, plus its return value tells you if unknown switches were passed.



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

Date: 29 May 1997 12:35:06 -0500
From: scribble@wwa.com (Hope this helps!)
Subject: Re: How to directly interact with a cgi-script somewhere on a server?
Message-Id: <5mkeob$ph1@shoga.wwa.com>

In article <01bc6beb$e780dd40$78ec2aca@walter.swiftech.com.sg>,
Walter Klomp <walter@swiftech.com.sg> wrote:
[...]
>if I telnet into the machine and I type
>
>GET xxx.cgi?type=yyy&var1=zzz&var2=aaa
>
>apparently the var1 and var2 never come over, neither does it work when I
>do a POST xxx.cgi ...

POSTed data goes in the body of the http message, not in the URL.
One good web client which will do what you want is LWP::UserAgent.
Specifically, the utility lwp-request which comes with the LWP
distribution will do the post request you want; reading its man
page is the best way to know how.



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

Date: 29 May 1997 10:19:19 -0700
From: Randal Schwartz <merlyn@stonehenge.com>
To: Olivier Dehon <dehon_olivier@jpmorgan.com>
Subject: Re: Idiom for list summation?
Message-Id: <8cenaq6vs8.fsf@gadget.cscaper.com>

>>>>> "Olivier" == Olivier Dehon <dehon_olivier@jpmorgan.com> writes:

Olivier> You almost had it. It's fairly easy to translate the foreach construct
Olivier> into a map construct :

Olivier> map {$sum += $_} @nums;

Olivier> Check out the perlfunc manpage for more details about the map function.

Ouch. Please don't do this.  It's considered bad form to use map or
grep in a void context.  Use the equivalent foreach instead:

	$sum = 0;
	for (@nums) { $sum += $_ }

At least until we get "inject:into:" from smalltalk. :-)

On the other hand, you *could* do this:

	$sum = eval join "+", @nums;

(In case the joke is missed, NO this is not a serious recommendation. :-)

print "Just another Perl hacker," # but not what the media calls "hacker!" :-)
## legal fund: $20,495.69 collected, $182,159.85 spent; just 459 more days
## before I go to *prison* for 90 days; email fund@stonehenge.com for details

-- 
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@ora.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me


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

Date: Thu, 29 May 1997 13:10:28 -0500
From: jfm@winternet.com (Jim Miner)
Subject: Re: Inheritance help
Message-Id: <jfm-2905971310280001@ppp-66-65.dialup.winternet.com>

In article <umgroner.864851882@bova>, Tim Groner
<umgroner@cc.umanitoba.ca> wrote:
 ...
> The beginning of MY_CGI.pm has:
> package MY_CGI;

and is missing:

  use CGI;

> @ISA = qw(CGI);
> <some new methods and an overridden method>
 ...

-- 
Jim Miner      jfm@winternet.com        +1 612 729 1667


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

Date: 29 May 1997 19:20:49 GMT
From: evenh@bigblue.pvv.ntnu.no (Even Holen)
Subject: Re: Just a long shot ...
Message-Id: <slrn5orloh.tds.evenh@bigblue.pvv.ntnu.no>

In article <3384D377.529@cris.com>, Jerry L. Gubka wrote:
>
>I've developed a Perl script that recursively scans through a directory,
>and all subdirectories, to find file names/sizes/4dos-4nt descriptions/
>PKZIP comments. It then writes a report of all files/comments found. The
>report is to be included w/ a project summary to a client. In the final
>lines of the report, I'm trying to sum all the file sizes and report
>total bytes in the client's subdirectory. The problem I'm having is that
>the total byte count is off (compared to a DOS "dir" listing),
>apparently because the report file is part of the directory and it is
>still open and being written to at time file sizes are acquired.

Please do remember that the file size reported by variuos dir listings
is not the same as the place occupied on the disk by the same file...
So it's possible to have a file whose size is 5 bytes, but it still
occupies 2k on the disk...

If this is your problem then what you need to do is to compensate for
whatever block-size your disk is using. It's typical either 255, 512,
1024, 2048, (4096). Lets say $blocksize=1024  (1k). One way to get the 
space occupied on disk by a file of size, $size, is like in the
following script:

#!/usr/bin/perl -w

$blocksize = 1024;

$size = 1025;
$diskSize =  (int($size / $blocksize) +
             ($size % $blocksize ? 1 : 0))*$blocksize;
print "$size : $disksize\n";


Do note that you need to find what is your block size. But that should
be easy. Just check amount free space on disk before and after the
creation of a file whose size is say 5 bytes!

Do remember that this correction need to done on a file to file basis.
It's not correct to do so on the total afterwards... :)

(Do also remember that you might still have a smaller problem regarding
 the file size of your report file as Tom Phoenix suggest)

Regards,
Even Holen
-- 
<><   Even Holen, evenh@pvv.ntnu.no, http://www.pvv.ntnu.no/~evenh/   :-)


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

Date: Thu, 29 May 1997 14:34:51 -0400
From: pudge@pobox.com (Chris Nandor)
Subject: Re: MACPERL - is it
Message-Id: <pudge-ya02408000R2905971434510001@news.idt.net>

In article <FAQ-NOT-FOR-EMAIL-2905970655000001@bohdan.dialup.access.net>,
FAQ-NOT-FOR-EMAIL@Tryzub.com (Bohdan Peter Rekshynskyj) wrote:

#still alive?
#
#I see the last updates (perl.com) around July of last year...
#
#Is there a MacPerl email list?
#
#Thanks!
#
#              Bohdan
#
#PS - please email me at Bohdan@TRYZUB.com - I do not have
#       daily access here.  Thanks!  8-)

Send mail with body "subscribe" to mac-perl-request@iis.ee.ethz.ch

More links at http://pudge.net/macperl/

The most recent release of MacPerl is 5.1.3.  I have no idea what you mean
by "July of last year" ... if you go to any CPAN site, or the software page
on per.com amd click on ports and then go to mac, you see 5.1.3 last
updated in January of this year.

A MacPerl based on 5.004 is forthcoming, according to Matthias Neeracher,
MacPerl's author/porter, who said earlier this year that he would port
5.004 when p5p got done with it.  So chances are he is working on it, or he
will be working on it soon.

--
Chris Nandor                 pudge@pobox.com                 http://pudge.net/
%PGPKey=('B76E72AD',[1024,'08 24 09 0B CE 73 CA 10  1F F7 7F 13 81 80 B6 B6'])
#=============================================================================
The other day, I was walking my dog around my building...  on the ledge. 
Some people are afraid of heights.  Not me, I'm afraid of widths.
                --Steven Wright
#=============================================================================


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

Date: Thu, 29 May 1997 14:06:48 -0400
From: Alan Gutierrez <a@b.c>
Subject: Re: ODBC.pm and Parameter Queries
Message-Id: <338DC5B8.D628495E@b.c>

Dean Kier wrote:
> 
> I just started using Perl for Win32 and ODBC.pm.  I know SQL and don't
> mind using it, but some of my databases(MSAccess) parameter queries and I
> would like to be able to use them.  Is there a way to do this?  Thanks.
> 
> Dean
> Dean.H.Kier@mro01.usace.army.mil

I have tried to do this before and gave up quickly. The path of least
resistance with ODBC was to express myself in SQL.

-- 
(A)lan (J)ames Gutierrez 
alan at cybernet dot com


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

Date: Thu, 29 May 1997 12:29:37 -0400
From: Craig <craig@indelible-blue.com>
Subject: OS/2 : Backticks causing runtime crash
Message-Id: <338DAEF1.3782@indelible-blue.com>

I am running OS/2 V4 w/fixpack.  I am having problems using the
backticks under Perl 5.03.05.  When I run the following code:

   #!/usr/bin/perl
   print "Hey";
   `dir`;

Hey is returned to STDOUT, then I get a popup window with system error
SYS3135.  I have tried several other commands within the backticks, but
I get the same response each time.

If anyone has used the ``s successfully under OS/2, what config changes
did you have to make first?

Craig


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

Date: 29 May 97 16:59:48 GMT
From: "Louis A. Brugman" <LBrugman@acromag.com>
Subject: Re: PERL SCRIPT FOR PASSOWRD
Message-Id: <01bc6c51$c00783c0$7eef1fce@brugman.acromag.com>

Check out Selena's Scripts at the following address.

http://selena.mcp.com/Scripts/

She has a great Perl script for authentication.



Magnus Bodin <Magnus.Bodin@tychonides.se> wrote in article
<33872d47.176061342@news1.telenordia.se>...
> Michael Lammon <Michael.C.Lammon@mci.com> wrote:
> 
> >All,
> >
> >	Does anyone have a PERL program which will call the User Name:
> >Password:
> >feature for a Netscape Browser or IE? and upon correct password that
> >will allow
> >a user to go to the html file??
> >
> >Thanks
> >
> >Mike
> 
> Much simpler would be to put the html-file in a password-protected
> library on the webserver.
> 


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

Date: 29 May 1997 15:05:07 GMT
From: Ronald.J.Kimball@dartmouth.edu (Chipmunk)
Subject: Re: Question: Pattern Matching and Counter Variables
Message-Id: <5mk5v3$rjp$1@dartvax.dartmouth.edu>

In article <338C1A5A.41C67EA6@oup.co.uk>
Bal Grewal <sheptonp@oup.co.uk> writes:

> I'm trying to write a script to mark-up a bibliographic section into
> SGML.
> 
> The individual references consist of:
> 
> <bb>Author name, blah, blah, blah ...</bb>
> 
> What I want to do is - where I find an instance of <bb>, I want to
> replace it with <bb ID="$counter">, where $counter is the ID number of
> the bibliographic reference in relation to other references already
> matched, counted and number ID inserted. 
> $counter is incremented after each match and substitution is made

s/<bb>/'<bb ID="'.$counter++.'">'/eg;

That replaces every occurence of <bb> with the value of the expression,
which happens to include incrementing $counter.

Chipmunk


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

Date: 29 May 1997 18:00:46 GMT
From: harry@damp.atmos.washington.edu (Harry Edmon)
Subject: Segmentation fault in lib/odbm.t with 5.004 under Solaris 2.5.1
Message-Id: <HARRY.97May29110046@damp.atmos.washington.edu>

When I run the odbm.t test for perl 5.004 under Solaris 2.5.1 I get:

1..12
ok 1
ok 2
ok 3
ok 4
Segmentation fault

Anyone else seen this?
--
Dr. Harry Edmon			E-MAIL: harry@atmos.washington.edu
(206) 543-0547			FAX:	(206) 543-0308
Dept of Atmospheric Sciences
University of Washington, Box 351640, Seattle, WA 98195-1640


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

Date: 29 May 1997 19:51:23 GMT
From: mheins@prairienet.org (Mike Heins)
Subject: Re: Segmentation fault in lib/odbm.t with 5.004 under Solaris 2.5.1
Message-Id: <5mkmnr$3qe@vixen.cso.uiuc.edu>

Harry Edmon (harry@damp.atmos.washington.edu) wrote:
: When I run the odbm.t test for perl 5.004 under Solaris 2.5.1 I get:
: 
: 1..12
: ok 1
: ok 2
: ok 3
: ok 4
: Segmentation fault
: 
: Anyone else seen this?

No, but if I were you I would remove ODBM_File from the list of
extensions and rebuild. There is not a module in the distribution
of less useful likelihood.

-- 
Regards,
Mike Heins

This post reflects the
opinion of my employer.


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

Date: Thu, 29 May 1997 14:43:40 -0400
From: Alan Gutierrez <a@b.c>
Subject: Re: Standalone web database for Perl?
Message-Id: <338DCE5C.5058C948@b.c>

Gary Weinfurther wrote:
> 
> A client wants a "simple" database application developed in Perl for a
> corporate intranet.  According to the client, the web server does not
> currently have a DBMS.  He wants a small, low-budget database for this
> application and it does not need to interact with any other application
> on the intranet.  Is there a Perl library that manages database records,
> similarly to a data management library for C or other languages?  Or do
> we have to purchase a large C/S RDBMS and install it on the server?
> 
> Thanks in advance!
> --
> 
>    ...Gary (gary@mich.com)

Simple on UNIX is Mini SQL. I would consider using perl and a plain 
text file first.

I doubt that you have to install a commercial RDBMS. 

http://hughes.com.au/           MiniSQL

Another free one.

http://www.postgresql.org/      Postgress95

Using NT?

http://www.roth.net/odbc/       ODBC.pm

-- 
(A)lan (J)ames Gutierrez 
alan at cybernet dot com


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

Date: 29 May 1997 15:18:41 -0400
From: Clark Dorman <dorman@s3i.com>
Subject: Re: String comparsion
Message-Id: <dg1v6w0ha.fsf@s3i.com>


"Alexander K. M. Leung" <kmleung@fg702-6.abct.polyu.edu.hk> writes:
> 	I want to use Perl to develop a small utility in my SGI workstaiton. Such
> utility will have a menu with 3 options (A, B, C). How can I use a if
> statement to detect which option is chosen.
> 
> 	I have try the following script, but it is not work.
> 
> $option=<STDIN>
> if ($option="a") {
>      :
> } elsif ($option="b") {
>      :
> } elsif ($option="c") {
>      :
> }

Personally, I worry about the user doing something unusual, so I'd recommend
something like:

$option=<STDIN>;
if ($option =~ /^\s*[aA]/) {
     :
} 
etc.

that is, if it's whitespace (space, tab, etc.) followed by either an "a"
(used in your program) or an "A" (used in your description above), do the "a"
thing.  

Don't forget the ";" at the end of your <STDIN> line though.  

-- 
Clark Dorman				"Evolution is cleverer than you are."
http://cns-web.bu.edu/pub/dorman/D.html                -Francis Crick


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

Date: 29 May 1997 10:38:29 -0700
From: Randal Schwartz <merlyn@stonehenge.com>
To: chris@ixlabs.com
Subject: Re: Tatum O'Neil
Message-Id: <8c910y6uwa.fsf@gadget.cscaper.com>

>>>>> "Chris" == Chris Schoenfeld <chris@ixlabs.com> writes:

Chris> Here is a perl script which will extract Tatum's birthday from the
Chris> Internet Movie Database, strip the HTML tags, and print it to the
Chris> screen:

[37 line program deleted]

    use LWP::Simple;
    my $base = "http://us.imdb.com";
    my ($bio_url) = (get "$base/M/person-exact?+O'Neal,+Tatum") =~
	    m#(/cache/person-biography/\w+)#;
    ($_) = (get "$base/$bio_url") =~ /(.*on-this-day.*)/;
    print />([^<]+)</g, "\n";

print "Just another Perl hacker," # but not what the media calls "hacker!" :-)
## legal fund: $20,495.69 collected, $182,159.85 spent; just 459 more days
## before I go to *prison* for 90 days; email fund@stonehenge.com for details

-- 
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@ora.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me


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

Date: Thu, 29 May 1997 18:45:54 GMT
From: tcyang@netcom.com (Tung-chiang Yang)
Subject: Re: track user
Message-Id: <tcyangEAyHGJ.131@netcom.com>

There is a way, not a Perl way.  Try CGI groups.

========================
richard ferry (102646.1641@CompuServe.COM) wrote:
: we are instituting a chargeback feature on our intranet server.
: is there a way to track a user coming in from an ip address and
: find out how long he has been on our server until he signs off ?

--
Tung-chiang Yang                       tcyang@netcom.com

soc.culture.taiwan, soc.culture.china (by SCC FAQ Team) FAQ's:
   http://www.iglou.com/tcyang/Taiwan_faq.shtml, China_faq.shtml


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

Date: 29 May 1997 17:01:37 GMT
From: ratner@dawn.cs.rice.edu (Logan Ratner)
Subject: troff processing package anywhere?
Message-Id: <5mkcph$m5a$1@joe.rice.edu>


I've got a text-processing problem involving troff formatted files.
The usual tools are failing me, so naturally I thought of perl.

Also naturally, I started by checking CPAN, but found nothing
that seems to grok troff.

Before I go invent this wheel, has anybody out there already done so?
-- 
Logan Ratner (ratner@rice.edu)   *  CRPC, Rice University, Houston
http://www.cs.rice.edu/~ratner/  *  http://softlib.rice.edu/CRPC/
Big Brother is clumsy and obvious,  Its Little Cousins that worry me.
         I am not Ms. Ratner despite what the NSA may think. 


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

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

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