[8900] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 2517 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed May 6 14:21:24 1998

Date: Wed, 6 May 98 11:02:23 -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           Wed, 6 May 1998     Volume: 8 Number: 2517

Today's topics:
    Re: IS THIS POSSIBE IN PERL! (Ken Churilla)
    Re: IS THIS POSSIBE IN PERL! (Ken Churilla)
    Re: Localtime--dumb question probably (Jeffrey R. Drumm)
        mirroring sites with a perl script simon@scoutnet.org.uk
    Re: open telnet <aqumsieh@matrox.com>
    Re: perl 5.004 extensions mpeppler@mbay.net
    Re: PERL aware code editor <aqumsieh@matrox.com>
    Re: PERL aware code editor (Mark Maurer)
    Re: Perl on Win95? <perlguy@inlink.com>
        Problem with prune in File::Find <marz@tamu.edu>
    Re: qq method calls (Mark Schmick)
        Query: Replicating a Vi command davidi-at-msn-dot-com@think.about.it.com
    Re: Query: Replicating a Vi command (Douglas Wilson)
    Re: Remove newline (Craig Berry)
        resources for perl-related jobs <arpad@valueweb.net>
    Re: Rounding a number <lr@hpl.hp.com>
    Re: SYBASE ODBS mpeppler@mbay.net
        system ("$progname"); does not work. Why? <aamblard-ladurantie@logica-sa.com>
    Re: system ("$progname"); does not work. Why? (brian d foy)
    Re: unix commands in a perl <aqumsieh@matrox.com>
    Re: user friendly message on die (brian d foy)
    Re: Using executable pathname to define include path <tchrist@mox.perl.com>
    Re: Using executable pathname to define include path <upsetter@shore.net>
        Win32 Perl Capturing Standard Error <ken.chesak@dhs.state.tx.us>
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Wed, 06 May 1998 17:17:49 GMT
From: ken@elsop.com (Ken Churilla)
Subject: Re: IS THIS POSSIBE IN PERL!
Message-Id: <35509b06.264807452@nntp1.ba.best.com>

On Wed, 6 May 1998 11:09:47 GMT, Brent Michalski <perlguy@inlink.com>
wrote:

>Don't blow $750 on a product if you are just looking to do a simple
>task.  That's like saying "Is driving possible?" and getting a reply of
>"Yes, but only if you buy a Ferrari from me"...
>
>If I am not mistaken, there have been articles in WebTechniques and
>there are modules which will allow you to do this fairly easily.
>
>Can some of those more familiar with this task lend a hand?
>
>Ken, it looks like you may have a nice product but I know I couldn't
>justify spending $750 for a product that just checks links when I can
>get something like Web Analyzer for about 1/3 the cost.  Good luck.

Bret,

Electronic Software Publishing Corporation (Elsop) maintains a list 
of over ninety products and services that perform similar 
functions to LinkScan, that is, they check links and/or create site maps.
The listing is available in the company's Elsop Webmaster Resource Center
and it is provided to enable webmasters to shop and compare LinkScan 
with other available solutions. Many of these products are shareware 
or freeware. Some of them are available as free as well as commercial
online services. You are invited to review these products.

    Software & Services for Checking Links & Creating Site Maps

http://www.elsop.com/wrc/comp_ls.htm

Table of Contents

Java Commercial Products 
Java Shareware & Freeware Products
Unix Commercial Products 
Unix Shareware & Freeware 
Windows Commercial Products 
Windows Shareware & Freeware 
Macintosh Commercial Products 
Macintosh Shareware & Freeware 
Commercial Online Services 
Free Online Services 

LinkScan is an industrial strength link checker intended for use on very
large internets and intranets. It is a commercial product with full free
customer support and frequent free upgrades and enhancements. A free
evaluation copy may be downloaded from our website at:

http://www.elsop.com/linkscan/

Ken Churilla
Electronic Software Publishing Corporation
http://www.elsop.com/


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

Date: Wed, 06 May 1998 17:31:20 GMT
From: ken@elsop.com (Ken Churilla)
Subject: Re: IS THIS POSSIBE IN PERL!
Message-Id: <35519de1.265538994@nntp1.ba.best.com>

On Wed, 6 May 1998 11:17:51 GMT, Brent Michalski <perlguy@inlink.com>
wrote:

>Now that I think about it,
>
>It looks like Ken didn't read the message carefully.  This post is
>regarding checking to see if distant links are still pointing BACK to
>this persons site.  NOT for checking the links that are on their site.

Correct. I misunderstood what the poster is looking for. There is such
a product on the market. It was developed by a pornographic website
promoter which pays for referral links. I learned about it through spam
they sent me and I deleted it. The product sold for around $200.00.

Ken Churilla


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

Date: Wed, 06 May 1998 16:26:05 GMT
From: drummj@mail.mmc.org (Jeffrey R. Drumm)
Subject: Re: Localtime--dumb question probably
Message-Id: <35508968.536188808@news.mmc.org>

[posted and mailed]

On 6 May 1998 13:59:43 GMT, Alexandr Dubovikov <shurik@iron.Te.NeT.UA> wrote:
>print "Content-type: text/html\n\n",
>"<h3>$Msg</h3>\n",
>"<pre>\n"; 
>
>($sec, $min, $hour, $mday, $mon, $year, $wday, $ydat, $isdst) = localtime();
>print("localtime() 19$year-$mon-$mday\n");

Were you attempting to demonstrate something I failed to grasp? Your example
will not provide the correct date. Note the comments in the code below.

#!/usr/bin/perl -w

my ($mday,$mon,$year) = (localtime)[3,4,5];
$mon++; # month offset starts at 0
$year += 1900; # $year represents number of years since 1900. 2000 will be 100!
printf("localtime() %04i-%02i-%02i\n",$year,$mon,$mday);

-- 
                               Jeffrey R. Drumm, Systems Integration Specialist
                       Maine Medical Center - Medical Information Systems Group
                                                            drummj@mail.mmc.org
"Broken? Hell no! Uniquely implemented!" - me


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

Date: Wed, 06 May 1998 12:49:16 -0600
From: simon@scoutnet.org.uk
Subject: mirroring sites with a perl script
Message-Id: <6iq7qr$flh$1@nnrp1.dejanews.com>

I have somewhere a perl script that automates mirring web sites but I can't
find it again. Does anyone know where I can get one?

Cheers

Simon Pearce

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/   Now offering spam-free web-based newsreading


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

Date: Wed, 06 May 1998 12:07:13 -0400
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: open telnet
Message-Id: <35508AB1.65DA0151@matrox.com>

Loren Schooley wrote:

> Hi.
> This group his huge. I wonder if I'll even be seen in here!
> What I am trying to do is open two telnet sessions at once with an
> icon using perl.
> Do I have to put it between brackets like
> #!/usr/local/bin/perl
> {
> exec telnet [address]
> exec telnet [address2]
> }
>
>

Hmmm... I hate to be rude, but a network administrator should know that
exec() executes and terminates the current script that called it!Use fork()
first!

> Than Kou! Loren-new to perl;)
> --
> _________________________________________________________________________
> ||---------------------------------------------------------------------||
> || Loren Schooley                            Page: page_loren@flash.net||
> || Network Administration                       Flashnet Communications||
> ||_____________________________________________________________________||
> |-----------------------------------------------------------------------|
>
> 1Uh,                            22ok,                     43um, 52well#$
>         77ok,um           109nevermind,                    131forgetit
>  140it 141doesn't 142matter 143anyway

Enjoy,

--
Ala Qumsieh             | "How much wood would a woodchuck
ASIC Design Engineer    |  chuck if a woodchuck could
Matrox Graphics Inc.    |  chuck wood?"
Montreal, Quebec        |             - Trivial ... 5!





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

Date: Wed, 06 May 1998 11:39:24 -0600
From: mpeppler@mbay.net
Subject: Re: perl 5.004 extensions
Message-Id: <6iq3ns$94g$1@nnrp1.dejanews.com>

In article <6iaejp$8c2$1@news.ccit.arizona.edu>#1/1,
  barg@nickel.as.arizona.edu (Irene Barg) wrote:
>
> Hello,
>
> Does the perl5.004_04/ext directory show all the extensions that are
> included in Perl v5.004?  I got the impression that modules like
> CGI.pm, libnet, and sybperl were bundled in this latest version of
> Perl?

Sybperl is definitely not bundled with perl...

The ext/ directory holds those perl modules that include an .XS portion, or
that need installing in a specific manner. CGI.pm, for example is included,
but is located in the /lib directory.

Michael

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/   Now offering spam-free web-based newsreading


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

Date: Wed, 06 May 1998 12:14:55 -0400
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: PERL aware code editor
Message-Id: <35508C7F.1E01ABB5@matrox.com>

Glenn Schworak wrote:

> Hi, I am use to using a C editor that has a few nice features. The one I
> like most is the fact that comments and code are given two different
> colors while editing (not saved that way).
>
> I am wondering if there are such editors developed for PERL that will
> run under the Windows 95 environment. Also, are there any UNIX based
> programs that can do this by serving ANSI color codes to a telnet
> session?
>
> I have written a quick and dirty little editor using VB for use right
> now, but if there is something standard already out there it would be
> better to not re-invent the wheel. And if there is a UNIX program that
> can feed out ANSI color codes that would be even better yet as that way
> we wouldn't need to FTP the source codes up and down off the system any
> time we needed to make a change.
>
> Thanks for any guidence that can be offered!

 I looked around for a good PERL editor ... the best I could find is EMACS.

EMACS is available for windows .. it is exactly the same as the UNIX EMACS.

Can't remember where I downloaded it from though .. you have to do your own
search.

Enjoy

--
Ala Qumsieh             | "How much wood would a woodchuck
ASIC Design Engineer    |  chuck if a woodchuck could
Matrox Graphics Inc.    |  chuck wood?"
Montreal, Quebec        |             - Trivial ... 5!





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

Date: 6 May 1998 13:50:07 -0400
From: mwmaurer@mtu.edu (Mark Maurer)
Subject: Re: PERL aware code editor
Message-Id: <6iq7sf$t1r$1@pace1.cts.mtu.edu>

Ala Qumsieh (aqumsieh@matrox.com) wrote:
: Glenn Schworak wrote:
: 
: > Hi, I am use to using a C editor that has a few nice features. The one I
: > like most is the fact that comments and code are given two different
: > colors while editing (not saved that way).
: >
: > I am wondering if there are such editors developed for PERL that will
: > run under the Windows 95 environment. Also, are there any UNIX based
: > programs that can do this by serving ANSI color codes to a telnet
: > session?
: >
: > I have written a quick and dirty little editor using VB for use right
: > now, but if there is something standard already out there it would be
: > better to not re-invent the wheel. And if there is a UNIX program that
: > can feed out ANSI color codes that would be even better yet as that way
: > we wouldn't need to FTP the source codes up and down off the system any
: > time we needed to make a change.
: >
: > Thanks for any guidence that can be offered!
: 
:  I looked around for a good PERL editor ... the best I could find is EMACS.
: 
: EMACS is available for windows .. it is exactly the same as the UNIX EMACS.

Hmm, I use vim 5.1, and it works rather well for a perl editor, and if you
name your files *.pl, it will be perl aware and color-syntax everything for
you.  Rather nice.


-- 
Mark Maurer  markm@dct.com                      mwmaurer@mtu.edu
Programmer,  Digital Magic Interactive          http://www.dminteractive.com
Senior,      Michigan Technological University  Houghton, MI
-- Views do not represent those of my employer or school


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

Date: Wed, 6 May 1998 16:09:09 GMT
From: Brent Michalski <perlguy@inlink.com>
Subject: Re: Perl on Win95?
Message-Id: <35508B25.67BFF3BD@inlink.com>

start at:
www.perl.com

then go to:
www.activestate.com

HTH,

Brent


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

Date: Wed, 6 May 1998 11:20:56 -0500
From: Mike Marziani <marz@tamu.edu>
Subject: Problem with prune in File::Find
Message-Id: <Pine.NXT.3.96.980506110017.3817A-100000@support.tamu.edu>

Ok.. here is the setup:

I am using activestate's win32 (5.003_07 I believe) distribution on my
home computer.
I am using the standard win32 (5.004_02 from CPAN) distribution on my work
computer.

I wrote a script (with some awesome tips from this newsgroup--thanks all)
that takes a directory you give it, builds a list of all sibdirectories
directly beneath it (using prune) and then goes through the list and
calculates the size on each subdir.

The script works fine on my home computer, but was messing up on my work
computer.  After some debugging, I figured out that it was not building
the list properly, and would only have one entry in it.  This was using
the SAME exact script, so I was puzzled.  The only difference was the
distribution that was being used.

I suspected it was something to do with the prune flag, so I copied the
File::Find module from the standard distribution to my home computer
(running activestate) and BAM, the program stopped working correctly.
When I re-instated activestate's version, it worked again.

So I am wondering if anyone has heard of this and if someone who knows a
bit about perl could check out that module and see if they can see if the
prune command is indeed pruning too much.

Thanks!

Mike



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

Date: Wed, 06 May 1998 16:50:38 GMT
From: mark@webz.com (Mark Schmick)
Subject: Re: qq method calls
Message-Id: <35509319.172169726@news.flash.net>

On Wed, 6 May 1998 02:41:49 GMT, tmornini@netcom.com (Tom Mornini)
wrote:

>#!/usr/bin/perl -w
>
>use strict;
>use CGI;
>
>package IMPQ;
>
>$IMPQ::query=new CGI;
>print $IMPQ::query->header;
>print <<EOT;
><HTML>
><H1>Here are some variables</H1>
>$IMPQ::query->param('NAME')<BR>
>$IMPQ::query->param('SIZE')<BR>
>
>It's the scalar->method call that I was hoping for substition on like
>a simple scalar. Is there a better method than removing these items from
>the double-quoted string and printing them on their own? (which works, but
>is extra code and typing!)

Here are two approaches you can use:

Ugly:
	You can use the somewhat-funky embedded string reference like
	so:
	  print "${ \($IMPQ::query->param(NAME)) }<BR>"

Pretty:
	Use CGI.pm's import_names method, which creates (in a separate
	little package) "real" variables named after the field names
	in your web form, wihch you can embed easily in double-quoted
	strings, like so:
	  print "$Q::NAME<BR>"
	For more details, RTM.

Hope that was helpful,
Mark

---------------------------------------------------
Mark Schmick     mark@webz.com      http://webz.com
"Crispy Outside, Light and Crackery Inside"


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

Date: Wed, 6 May 1998 09:20:05 -0700
From: davidi-at-msn-dot-com@think.about.it.com
Subject: Query: Replicating a Vi command
Message-Id: <MPG.fba2d8dea7fea82989680@news.earthlink.net>

This is a question about global search-and-replace in perl.  I'm not a 
programmer.  I don't play one on TV.  The answer to my question may be in 
the manual, which I've read, but I may lack the horsepower to recognize 
it.

For the last 15 years or so I've done large amounts of text conditioning 
with Vi.  When I've had to process massive amounts I've been pretty 
successful with Sed.  Lately I've found I can do most of the text 
filtering much more efficiently, of course, with Perl.  Needless to say, 
as a non-programmer my perl scripts tend to be lists of s/xx/yy/; 
statements.

I can't figure out the Perl equivalent of the Vi/SED g/xx/s/yy/zz/ 
command.  I know it has to be there.

Specifically I'm trying to find all lines with a dollar sign and replace 
all commas with an empty string.  I don't want to replace commas in lines 
that have no dollar sign.  And I want all other lines in the file to be 
sent to the output unmodified.

In Vi/SED you'd do this with the statement

	g/\$/s/,//g

It ought to be possible to do it with one line with Perl too.  How?

Thanks,
		-- David Innes


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

Date: Wed, 06 May 1998 17:23:11 GMT
From: dgwilson@gte.net (Douglas Wilson)
Subject: Re: Query: Replicating a Vi command
Message-Id: <6iq64a$a77$1@gte2.gte.net>

On Wed, 6 May 1998 09:20:05 -0700,
davidi-at-msn-dot-com@think.about.it.com wrote:


>In Vi/SED you'd do this with the statement
>
>	g/\$/s/,//g


perl -pi -e 'if (/\$/) {s/,//g}' filename(s)

will edit the file(s).

look at 'perldoc perlrun' for an explanation
of the command line options.

Hope that helps,
Douglas Wilson


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

Date: 6 May 1998 16:57:57 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Remove newline
Message-Id: <6iq4ql$o71$1@marina.cinenet.net>

Ala Qumsieh (aqumsieh@matrox.com) wrote:
: What about chop()???

The poster wanted to remove newlines only when the character preceding 
the newline was '|'.  Conditionalizing chop strikes me as being more 
cognitive work than s/\|\n/|/.  YMMV.

---------------------------------------------------------------------
   |   Craig Berry - cberry@cinenet.net
 --*--    Home Page: http://www.cinenet.net/users/cberry/home.html
   |      Member of The HTML Writers Guild: http://www.hwg.org/   
       "Every man and every woman is a star."


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

Date: Wed, 06 May 1998 11:58:23 -0400
From: "David A. Geller" <arpad@valueweb.net>
Subject: resources for perl-related jobs
Message-Id: <3550889F.8A4773EF@valueweb.net>

We are having a tough time finding qualified people to work in our
development department.

Is there a unix/perl-centric location for posting job opportunities?

Please mail any responses.

Thank you,
David A. Geller
geller@gate.net


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

Date: Wed, 6 May 1998 10:15:41 -0700
From: "Larry Rosler" <lr@hpl.hp.com>
Subject: Re: Rounding a number
Message-Id: <6iq5ru$htr@hplntx.hpl.hp.com>

[posted and mailed]

Any more mini-dilemmas I should know about? wrote in message ...
>>I looked in the perlfunc man page and did not see a function for
>>rounding a number. Is there such a beast or could someone tell me a
good
>>way to round a number with Perl?
>
>my favorite:
>$rounded = int ($num + .5);


This may be your favorite, but that doesn't make it correct.  Try it
with $num = -0.7, for example.

It could be corrected by something like:

$rounded = int ($num + ($num < 0) * 0.5);

but why bother?  Use sprintf '%.0f', $num;

See perlfaq4: Does perl have a round function? ...

--
Larry Rosler
Hewlett-Packard Laboratories
lr@hpl.hp.com





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

Date: Wed, 06 May 1998 11:44:56 -0600
From: mpeppler@mbay.net
Subject: Re: SYBASE ODBS
Message-Id: <6iq428$9g7$1@nnrp1.dejanews.com>

In article <6iouhr$lve@examiner.concentric.net>#1/1,
  "Becerra" <sixtoeb@pop3.cris.com> wrote:
>
> I am looking for a way to access sybase database using Perl for Win32.
> Anybody heard or knows about a DBI?

There's DBD::Sybase (still in alpha, but the basic functionality is there).
And there's Sybperl (which implements the native Sybase API).

Both work under Win32, and are available from CPAN in /authors/Michael_Peppler
or from http://www.mbay.net/~mpeppler.

Michael

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/   Now offering spam-free web-based newsreading


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

Date: Wed, 06 May 1998 18:55:33 +0100
From: amaury <aamblard-ladurantie@logica-sa.com>
Subject: system ("$progname"); does not work. Why?
Message-Id: <3550A415.AA9DFF62@logica-sa.com>

I need to program a cgi which changes users' password, using htpasswd.
The htpasswd syntax is:
/Path/to/htpasswd /path/to/.htpasswd username
then it prompts for password1 and password2 (confirmation).

The problem is that

system ('/usr/sbin/htpasswd /home/my_dir/.htpasswd foobar', "mypwd", "mypwd") 
or die "Pb with Htpasswd";
#works fine, but I need to "abstract" the values.
#This is why I use "$progname" and so on.

#I checked 10000 times: the patchs are correct
	$progname = '/usr/bin/htpasswd';
#.htpasswd exists end is 666
	$filename = '/home/mydir/.htpasswd';
	$username = "foobar";
	$pass1 = "mypwd";
	$pass2 = "mypwd";

	system("$progname $filename $username", "$pass1", "pass2") or die "yuck!";
# does not work, but no "compilation" error: the program seems to run well
# and does not complain. But, not new user is added to .htpasswd. Damned!

#so I tried something else
	@args =("$progname $filename $user", "$pass1", "$pass2");
	system ("@args") or die "Once again, it doe not work";
#but this does not seem to work either.

I spent a whole night trying to get those two dumb lines to work.
I am pretty sure I am confusing with quotes, but I can't see why
it does not work. I must have tried  a hundred combinations of
"@args", $progname, "$progname", '$progname' and so on.

Does anybody knows what is the EXACT syntax I have to use? I don't feel like
spending another night on this ***** commmand! :-)

Thanks, all.

Amaury, who is going to install Win95 on his Linux partition, if he can't figure
out what happens.
Ah! Visual Basic, here I come! ;-) "Huho, what's that blue screen? What's GPF?"

PS: I would appreciate a copy of your answer by e-mail, if possible. Thanks,
again.


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

Date: Wed, 06 May 1998 13:40:54 -0400
From: comdog@computerdog.com (brian d foy)
Subject: Re: system ("$progname"); does not work. Why?
Message-Id: <comdog-ya02408000R0605981340540001@news.panix.com>
Keywords: from just another new york perl hacker

In article <3550A415.AA9DFF62@logica-sa.com>, amaury <aamblard-ladurantie@logica-sa.com> posted:

>I need to program a cgi which changes users' password, using htpasswd.
>The htpasswd syntax is:
>/Path/to/htpasswd /path/to/.htpasswd username
>then it prompts for password1 and password2 (confirmation).

you can't use system to interact with this command.  it's the
same problem as interacting with passwd.

perhaps you want to use the HTTPD::UserAdmin module?

good luck :)

-- 
brian d foy                                  <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
Comprehensive Perl Archive Network (CPAN) <URL:http://www.perl.com>
Perl Mongers <URL:http://www.pm.org>


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

Date: Wed, 06 May 1998 12:32:45 -0400
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: unix commands in a perl
Message-Id: <355090AD.A75368BD@matrox.com>

Grinch wrote:

> Inge Soetens wrote in message <35360897.506F@se.bel.alcatel.be>...
>
> >The code is executed until it arrives the "exec" statement.
> >There it stops.
>
> That's what exec is _supposed_ to do...
>
> Exec launches a child process that replaces the parent. If you want to start
> a child process without killing off the parent, use system().
>
> HTH!
>
> -grinch
>
> --
> -----
> "Yes, I'm paranoid, but that doesn't mean
> no one's out to get me." - me
>
> Sherm Pendley
> grinch@whoville.com
> http://www.whoville.com

 This is the FOURTH entry I read today asking about why the code after exec()
never gets executed!
I wonder how the people that write these programs think. If you get an error,
or notice something suspicious at a certain command, then read more about the
command itself! The problem HAS to be there ... borrowing some of Tom Phoenix's
attitude:
- The cat didn't eat the rest of your code.
- The code did not just disappear into thin air.
- The currents running through your CPU did not mysteriously deflect due to an
unknown reason.
- Larry Wall did not change Perl and forgot to tell you.

(Sorry Tom, couldn't resist :-)

--
Ala Qumsieh             | "How much wood would a woodchuck
ASIC Design Engineer    |  chuck if a woodchuck could
Matrox Graphics Inc.    |  chuck wood?"
Montreal, Quebec        |             - Trivial ... 5!





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

Date: Wed, 06 May 1998 13:15:44 -0400
From: comdog@computerdog.com (brian d foy)
Subject: Re: user friendly message on die
Message-Id: <comdog-ya02408000R0605981315440001@news.panix.com>
Keywords: from just another new york perl hacker

In article <hg33wdqd.fsf@mailhost.panix.com>, Jonathan Feinberg <jdf@pobox.com> posted:

>Matt McKenzie <jasmatt@es.co.nz> writes:
>
>> but I was wondering how to display to the user a nice friendly message
>> i.e. 'Sorry that user already exists...please try another Username'.
>> The way it is now, the script will just die without letting the user
>> know what happened.
>
>>    sysopen(OUTFILE, "$prefdir/$username.txt", O_WRONLY|O_EXCL|O_CREAT,
>>    0644) or die "can't open $prefdir/$username.txt: $!";
>
>Is this a trick question?  If you don't want to die(), then don't
>die().  Print out an error message and get new input and do whatever.

well, one could also change what die() does by fiddling with 
$SIG{__DIE__}.  if the script already uses die() frequently, it
may be easy to change what die() does rather than finding every
occurance and changing it :)

but, in this case, it seems a well chosen argument to die() would
suffice.

good luck :)

-- 
brian d foy                                  <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
Comprehensive Perl Archive Network (CPAN) <URL:http://www.perl.com>
Perl Mongers <URL:http://www.pm.org>


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

Date: 6 May 1998 16:32:19 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Using executable pathname to define include path
Message-Id: <6iq3aj$eor$1@csnews.cs.colorado.edu>

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

In comp.lang.perl.misc, Art Cohen <upsetter@shore.net> writes:
:It seems kind of ironic, though, considering that Perl is touted as being
:the text-handling language to end all text-handling languages. Isn't there
:some way to automatically update the web site when the docs change (or at
:some regular interval)?

You didn't look closely enough.  Converting manpage is trivial.  That's
not the issue.  Please reread.  The current documentation set on the
web was put together entirely by hand iwth a few makeshift scripts that
were lost in crash.  It took me a *lot* of time.  The intersection of
people with the skill to do this and the motivation is extremely small.
In fact, it may even be limited to one.  And I don't have that time now.

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

    A formal parsing algorithm should not always be used.
		    --D. Gries


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

Date: 6 May 1998 17:19:19 GMT
From: Art Cohen <upsetter@shore.net>
Subject: Re: Using executable pathname to define include path
Message-Id: <6iq62n$qsq@fridge.shore.net>

In comp.lang.perl.misc Tom Christiansen <tchrist@mox.perl.com> wrote:

: You didn't look closely enough.  Converting manpage is trivial.  That's
: not the issue.  Please reread.  The current documentation set on the
: web was put together entirely by hand iwth a few makeshift scripts that
: were lost in crash.  It took me a *lot* of time.  The intersection of
: people with the skill to do this and the motivation is extremely small.
: In fact, it may even be limited to one.  And I don't have that time now.

Actually, I guessed that a lot of the current site was done by hand ...
and I wasn't claiming that you've been remiss... I was just pointing out
the irony. 

But there is a serious question here: Is it *possible* to design an
automation system for posting the Perl FAQ to the web? In other words, did
you do it by hand the first time because it was faster and more pragmatic,
or did you do it by hand because you *had* to, and there was no good way
to do it in Perl. 

If the latter were true, that would be *extremely* ironic.

If, however, the former would true, I'm not casting any aspersions (I've
done the same myself many times) but if you're looking for volunteers to
help automate the FAQ posting, I'm willing to donate some of my (limited) 
time. Insuring that there's always a current version of the FAQ and docs
(at least the "core" Perl documentation) available on the web would be
worth the trouble, IMO. 

--Art

National Ska/Reggae Calendar: www.ziplink.net/~upsetter/ska/calendar.html
        Boston Ska Home Page: www.ziplink.net/~upsetter/ska/index.html




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

Date: Wed, 06 May 1998 12:05:41 -0500
From: Ken Chesak <ken.chesak@dhs.state.tx.us>
Subject: Win32 Perl Capturing Standard Error
Message-Id: <35509865.D14D93DC@dhs.state.tx.us>

How do I capture standard error when running a perl script. The Perl
errors just scoll by,  I have piped to more and to a file with no
results.   I have set up the following:
assoc .pl
ftype Perlscript
I can execute the perl script by typing: perl script.pl or simply
script.pl






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

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

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