[11105] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4705 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Jan 20 22:05:50 1999

Date: Wed, 20 Jan 99 19:01:28 -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           Wed, 20 Jan 1999     Volume: 8 Number: 4705

Today's topics:
    Re: Newbie Perl CGIer needs fast help!  Posting to URL ((//trxby))
    Re: Newbie Perl CGIer needs fast help!  Posting to URL (Tad McClellan)
    Re: Newbie Perl CGIer needs fast help!  Posting to URL <jwarner@tivoli.com>
    Re: Perl Criticism <jwarner@tivoli.com>
    Re: Perl problem :(Offline mode... <bradw@kannews.newbridge.com>
    Re: Perl uses in NT <erik.jessen@home.com>
        Perl Y2K compliance <thajduk@starnetinc.com>
    Re: Perl Y2K compliance (Alastair)
    Re: Perl Y2K compliance (Matthew Bafford)
        Q: conditional operator and variable assignment (Eric Pement)
    Re: Q: conditional operator and variable assignment (Larry Rosler)
    Re: subroutine return values (Greg Ward)
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: Wed, 20 Jan 1999 18:06:04 GMT
From: ttxyxexr@airxmail.net ((//trxby))
Subject: Re: Newbie Perl CGIer needs fast help!  Posting to URL
Message-Id: <AA368C7E8B2EF9A1.72EF6A6D9BADAC56.0F8C2271CC0C7122@library-proxy.airnews.net>

I am a programmer Abigail.
I'm just not that experienced with Perl using these functions.

All I am asking is to be pointed to some specific functions.  I'm not
asking someone to do the programming for me.  The client has had four
months to get this ready. I prodded for two months until they told me
to leave it alone.  Now they want it up in three days and I don't have
a whole lot of time to study up, find someone else AND get rid of my
other clients at the same time.

Does anyone have any expertise in this area who could help me out?

Thanks,
Mike


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

Date: Wed, 20 Jan 1999 19:03:52 -0600
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Newbie Perl CGIer needs fast help!  Posting to URL
Message-Id: <odu587.jsn.ln@magna.metronet.com>

(//trxby) (ttxyxexr@airxmail.net) wrote:

: I am a programmer Abigail.


   What a coincidence!

   There is a another programmer Abigail that posts here too  ;-)


   (I think you left out a comma, which changed the semantics of
    your statement considerably...
   )



: I'm just not that experienced with Perl using these functions.

: All I am asking is to be pointed to some specific functions. 


   You have two followups mentioning the functions in the LWP module.

   One of them was even from the aforementioned other programmer Abigail.
   ( a double coincidence!? )

   Are those not "specific functions", or do you just want some
   more in the spirit of TMTOWTDI?

   

: Does anyone have any expertise in this area who could help me out?


   I'm sure there are several.

   Your job offer is rather stealthy though.

   I think you will have better luck if you just come out and
   say that you are offering Perl work.


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


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

Date: Wed, 20 Jan 1999 12:59:55 -0600
From: John Warner <jwarner@tivoli.com>
Subject: Re: Newbie Perl CGIer needs fast help!  Posting to URL
Message-Id: <36A627AB.ADFAC0C6@tivoli.com>

Here is a list of URLs I have found handy.

Resource Name
        URL
==========================================
Official Guide to Programming with CGI.pm    (I heartily recommend this
book.)
        http://www.wiley.com/compbooks/stein/source.html
CGI.pm - a Perl5 CGI Library
        http://stein.cshl.org/WWW/software/CGI/
CGI Programming MetaFAQ
        http://www.smithrenaud.com/public/CGI_MetaFAQ.html

This should be enough to get you on your way with CGI programming in Perl.

HTH,

John Warner

"(//trxby)" wrote:

> I am a programmer Abigail.
> I'm just not that experienced with Perl using these functions.
>
> All I am asking is to be pointed to some specific functions.  I'm not
> asking someone to do the programming for me.  The client has had four
> months to get this ready. I prodded for two months until they told me
> to leave it alone.  Now they want it up in three days and I don't have
> a whole lot of time to study up, find someone else AND get rid of my
> other clients at the same time.
>
> Does anyone have any expertise in this area who could help me out?
>
> Thanks,
> Mike



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

Date: Wed, 20 Jan 1999 11:07:16 -0600
From: John Warner <jwarner@tivoli.com>
Subject: Re: Perl Criticism
Message-Id: <36A60D43.F4190687@tivoli.com>

Win 3.1 was a quasi-OS.  Win31 did most of the things a normal OS does with the
exception of disk I/O.  However, its fundamental flaw was that it attempted to provide
a multithreaded environment while it ran in a singly threaded environment (DOS).  The
closest analogy I can think of is attempting to balance a set of blocks arranged in an
upside down pyramid on a toothpick--sooner or later the blocks _will_ fall.


John Warner

Richard Clamp wrote:

> On Wed, 20 Jan 1999 13:57:55 GMT, bart.lateur@skynet.be (Bart Lateur)
> wrote:
>
> >Richard Clamp wrote:
> >
> >>3.1 an OS?  Okay, I won't go there, I'd lose you too easily.
> >
> >It may be a toy OS, but it's an OS nevertheless.
>
> My understanding was that Windows 3.1 was a graphical shell for DOS.
> DOS/Windows is more analogous to Unix/X-Windows but only in terms of
> the layered structure, but then we'll end up at the difference in
> personalities from the kernel to the shell if we go further down this
> road.
>
>         Richard
> --
> Richard Clamp         richardc@tw2.com
> Frisbeetarianism, n.:
>         The belief that when you die, your soul goes up on the roof and gets stuck



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

Date: 20 Jan 1999 10:50:33 -0500
From: Brad Warkentin <bradw@kannews.newbridge.com>
Subject: Re: Perl problem :(Offline mode...
Message-Id: <op1pv8aaqpi.fsf@kannews.newbridge.com>

Andrew Fry <andrewf@beausys.demon.co.uk> writes:

> In article <slrn7aa7ke.mma.sholden@pgrad.cs.usyd.edu.au>, Sam Holden
> >Just not bothering to read the manual!

> I am well aware of manuals, on-line docs, etc ... but I dont have
> time to plough through lots of manuals/docs (do you ???), and I
> know by experience that one doesnt always find what one is looking for
> in documentation.

Potentially true, though the most current online doc are more up
to date than the traditionally published manuals, in Perl. In fact
with perldoc & perlindex you can let Perl do the ploughing for you.

> The fact is that I run a small comms/networking consultancy & software
> house ... and we work to very tight deadlines. Having the time to read
> and learn is something of a luxury.

So you are getting paid as a consultant for the work you are asking
questions about, but you don't have the time to research & learn, and
you expect other people to solve the problems you are getting paid to
solve? 

This seems incredibly hypocritical to me....

> I appreciate the helpful replies, but frankly, I dont see the point in
> these discussion groups if the reply is just going to be 'read the
> manual'!

Ah, this was the part that I missed... reading between the lines, I
get the sense that your problems _are_ more important than everyone
else's and hence these discussion groups should exist to solve them. 

A passing clue: Knowing how to use the available reference material to
solve your problems yourself will reduce your dependancy on others,
and make you more productive... probably a good thing for a
consultant.

bj


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

Date: Thu, 21 Jan 1999 02:42:03 GMT
From: Erik Jessen <erik.jessen@home.com>
Subject: Re: Perl uses in NT
Message-Id: <36A6925E.FA6A5897@home.com>

I use it for:
- remote procedure calls for distributing batch jobs
	- find the least-busy machine on the net
	- give it something to chew on
- monitoring the state of the machines (there's no cmd-line
	NT tool that'll tell you how busy your CPU is, at least
	that I could find)
- running simulation scripts & maintaining an ASIC design environment


J. Haglund wrote:
> 
> Mike wrote in message <773m45$dt0$1@nnrp03.primenet.com>...
> >Hi, I'm new to the Perl world. My boss, a unix administrator, suggested I
> >learn some Perl and apply it to my NT administration. Could anyone show me
> >where I could find some good examples or situations where I could use Perl
> >in NT?
> >
> 
> I found TieRegistry.pm very useful, see documentation in the
> latest Activestate release. Here's how to set up
> some file properties for '.pl'-files:
> 
> use Win32::TieRegistry( Delimiter=>"#", ArrayValues=>0 );
> 
>   # Don't change existing
>   $Registry->{"HKEY_CLASSES_ROOT/.pl/"} and return;
> 
>   $Registry->{"HKEY_CLASSES_ROOT/.pl/"} = { "/" => "plfile"};
>   $Registry->{"HKEY_CLASSES_ROOT/plfile/"} =
>     {
>      "/"     => "Perl Program",
>      "DefaultIcon/" => {"/" => "$Perl"},
>     };
>   $Registry->{"HKEY_CLASSES_ROOT/abifile/Shell"} =
>     {
>      "Open/" => {"command/" => {"/" => "$Perl \"%1\""}},
>     };
> }
> 
>     /J. Haglund


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

Date: Wed, 20 Jan 1999 20:08:29 -0600
From: Ted Hajduk <thajduk@starnetinc.com>
Subject: Perl Y2K compliance
Message-Id: <36A68C1D.B10B0D90@starnetinc.com>

Hi,

Excuse me if this has already been discussed elsewhere, but can anyone
point me to information on Perl Y2K compliance - interpreter, modules,
etc?

I was asked this by the Y2K coordinators at our company and I have been
unable to find any information in the usual places.

Thanks in advance.

Ted



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

Date: Thu, 21 Jan 1999 02:17:20 GMT
From: alastair@calliope.demon.co.uk (Alastair)
Subject: Re: Perl Y2K compliance
Message-Id: <slrn7ad3is.6a.alastair@calliope.demon.co.uk>

Ted Hajduk <thajduk@starnetinc.com> wrote:
>Hi,
>
>Excuse me if this has already been discussed elsewhere, but can anyone
>point me to information on Perl Y2K compliance - interpreter, modules,
>etc?

http://www.dejanews.com/home_ps.shtml

Ad nauseam.

-- 

Alastair
work  : alastair@psoft.co.uk
home  : alastair@calliope.demon.co.uk


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

Date: Thu, 21 Jan 1999 02:56:44 GMT
From: dragons@Server.Network (Matthew Bafford)
Subject: Re: Perl Y2K compliance
Message-Id: <slrn7ad5l4.nn.dragons@Server.Network>

On Wed, 20 Jan 1999 20:08:29 -0600,
Ted Hajduk <thajduk@starnetinc.com> wrote:
=> Hi,
=> 
=> Excuse me if this has already been discussed elsewhere, but can anyone

Not elsewhere, but it has been discussed quite a lot here.

=> point me to information on Perl Y2K compliance - interpreter, modules,
=> etc?

http://www.perl.com/
http://www.perl.com/pace/pub/Does_Perl_Have_a_Y2K_Problem/

=> I was asked this by the Y2K coordinators at our company and I have been
=> unable to find any information in the usual places.

Eh?  Where's that?

A quick search at DejaNews with a group of comp.lang.perl* and a subject
of Y2K found me 591 matches.  One of those is bound to be what you need.
 
=> Thanks in advance.

HTH!

=> Ted

--Matthew


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

Date: Wed, 20 Jan 1999 22:39:05 GMT
From: epement@jpusa.chi.il.us (Eric Pement)
Subject: Q: conditional operator and variable assignment
Message-Id: <36a654f3.347163633@news.jpusa.net>

   Why can't I assign to a variable when using a conditional operator?
I.e, the syntax "if-test ? if-true : if-false" doesn't permit me to
perform a scalar assignment if the test returns true.  Example:

   #!/usr/bin/perl
   $a = $b = "";
   5 == 2 + 3 ? print "true\n"  : print "false\n";
   5 == 2 + 3 ? $a = "true"     : $a = "false";
   print "the value of \$a is $a\n";
 
   if ( 5 == 2 + 3) { $b = "true" } else { $b = "false" };
   print "the value of \$b is $b\n";
   #---end-of-script---

This script produces the following output:

   true
   the value of $a is false
   the value of $b is true

   Why isn't the value of $a set to "true"? What do I have to do to
alter the conditional test to fix it (or is it unfixable)?

   I would also like to do a substitution that looks something like this
-- greatly simplified for readability:

       s/^(.)bc/($1 eq "a" ? "A" : "z")ef/ge;
       #
       # if given "abc", print "Aef"
       # if given "bbc", print "zef", and so on for any regex "[^a]bc"

Even if the preceding question about the s/ubsti/tution/ is answered, I
would still like to know why the conditional test failed to assign the
variables as I expected. Thanks in advance!


--
Eric Pement <epement@jpusa.chi.il.us>
senior editor, Cornerstone magazine
http://www.cornerstonemag.com
939 W. Wilson Ave., Chicago, IL 60640-5706
tel: 773/561-2450, 1-(ext.)2084   fax: 773/989-2076


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

Date: Wed, 20 Jan 1999 16:56:11 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Q: conditional operator and variable assignment
Message-Id: <MPG.11101b0637af064d9899b0@nntp.hpl.hp.com>

[Posted and a courtesy copy mailed.]

In article <36a654f3.347163633@news.jpusa.net> on Wed, 20 Jan 1999 
22:39:05 GMT, Eric Pement <epement@jpusa.chi.il.us> says...
>    Why can't I assign to a variable when using a conditional operator?
> I.e, the syntax "if-test ? if-true : if-false" doesn't permit me to
> perform a scalar assignment if the test returns true.  Example:
 ... 
>    5 == 2 + 3 ? $a = "true" : $a = "false";
 ...

>    Why isn't the value of $a set to "true"? What do I have to do to
> alter the conditional test to fix it (or is it unfixable)?

You have to correct the precedences!  The above statement is parsed as:

     (5 == 2 + 3 ? ($a = "true") : $a) = "false";

So "false" is assigned to $a.  You need to parenthesize the second 
assignment:

     5 == 2 + 3 ? $a = "true" : ($a = "false");

The reason you don't have to parenthesize the first assignment also is 
that the parser knows to gobble up and evaluate all of the expression 
between the '?' and the ':'.  I believe this to be a foolish innovation 
introduced in C++, and prefer to be explicit about both bindings, 
because of their apparent (to me) symmetry:

     5 == 2 + 3 ? ($a = "true") : ($a = "false");

Of course, if this is all you wanted, you could simpler write:

     $a = 5 == 2 + 3 ? "true" : "false";

but you are after deeper things, I know.

>    I would also like to do a substitution that looks something like this
> -- greatly simplified for readability:
> 
>        s/^(.)bc/($1 eq "a" ? "A" : "z")ef/ge;
>        #
>        # if given "abc", print "Aef"
>        # if given "bbc", print "zef", and so on for any regex "[^a]bc"

The expression you evaluate must be valid Perl, not a combination of an 
expression stuck next to a bareword.  It is not a string.

         s/^(.)bc/($1 eq "a" ? "A" : "z") . 'ef'/ge;

By the way, in all this you use double-quotes when there is no 
interpolation.  Better style, IMO, would be to use single-quotes, which 
adds 'visual semantics' to your code.

-- 
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: 20 Jan 1999 17:58:36 GMT
From: gward@thrak.cnri.reston.va.us (Greg Ward)
Subject: Re: subroutine return values
Message-Id: <7855gc$kdt$3@news0-alterdial.uu.net>

Rob S <rob.slattery@amaonline.com> wrote:
> I have a subroutine which prints a line before it finishes
> and control goes back to the main program. How can I use
> the return value, 1 or 0 from a "successful subroutine print" back in
> the main body of the program?

Put it in a variable.  Test the variable.  Carry on.

Example:

  sub foo
  {
     # ... compute $success ...

     return $success;
  }

  $foo_ok = &foo ();
  if ($foo_ok)
  {
     # do one thing
  }
  else
  {
     # do another
  }

Could it be any simpler?  Actually, it could be a lot shorter, but I'll
leave that as an exercise for the reader.  Perhaps you should get the
fine book *Learning Perl* by Randal Schwartz and Tom Christiansen.  It
will give you a firm grounding in these very, very, basic elements of
the language (and also the very basic and just-plain-basic things too).

        Greg
-- 
Greg Ward - software developer                    gward@cnri.reston.va.us
Corporation for National Research Initiatives    
1895 Preston White Drive                      voice: +1-703-620-8990 x287
Reston, Virginia, USA  20191-5434               fax: +1-703-620-0913


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

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


Administrivia:

Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing. 

]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body.  Majordomo will then send you instructions on how to confirm your
]subscription.  This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.

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

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