[12609] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 17 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Jul 2 21:00:04 1999

Date: Fri, 2 Jul 1999 17:57:21 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Fri, 2 Jul 1999     Volume: 9 Number: 17

Today's topics:
    Re: Top 10 responses to the Robot/email idea <gbartels@xli.com>
    Re: Top 10 responses to the Robot/email idea (Tad McClellan)
    Re: Top 10 responses to the Robot/email idea <cassell@mail.cor.epa.gov>
    Re: Top 10 responses to the Robot/email idea <mike@crusaders.no>
    Re: Top 10 responses to the Robot/email idea <gellyfish@gellyfish.com>
    Re: Top 10 responses to the Robot/email idea <gbartels@xli.com>
    Re: Top 10 responses to the Robot/email idea <nolanj00@mh.us.sbphrd.com>
    Re: Try this! (5.00404 - 5.00503 I think) <uri@sysarch.com>
    Re: Try this! (5.00404 - 5.00503 I think) <tchrist@mox.perl.com>
    Re: Trying again (Bart Lateur)
    Re: Trying again (John Borwick)
    Re: Trying again (Bart Lateur)
    Re: Trying again <uri@sysarch.com>
    Re: Trying again (Tad McClellan)
    Re: unix passwd auth in CGI <gellyfish@gellyfish.com>
        use 'refs'; <cmmiller@gsbfac.uchicago.edu>
    Re: use 'refs'; (Greg Bacon)
    Re: use 'refs'; (Bart Lateur)
    Re: use 'refs'; (Greg Bacon)
        use perl to kill processes? Pls help newsmf@bigfoot.com
        Using ssi file in cgi script <hyu1@mipos2.intel.com>
    Re: Using strict (Tad McClellan)
        Using the GETSTORE command </dev/null@davidthornton.com>
    Re: Using the GETSTORE command (Andreas Fehr)
    Re: Using the GETSTORE command <swiftkid@bigfoot.com>
    Re: Using the GETSTORE command <hiller@email.com>
        Web based email designed in PERL <jescobar@intermedios.com>
        what questions was perl designed to solve? <fmd@wam.umd.edu>
    Re: what questions was perl designed to solve? (Bart Lateur)
        Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)

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

Date: Fri, 02 Jul 1999 08:15:35 -0400
From: Greg Bartels <gbartels@xli.com>
Subject: Re: Top 10 responses to the Robot/email idea
Message-Id: <377CAD67.3F69B3A2@xli.com>

newbie: 
> How do I print two variables on the same line? 
> $first and $last?

recently flamed newbie, but knows answer:
> yeah I couldn't figure that out either. its:
> print "$first $last\n"; 
> good luck

moderate experience perl programmer:
> print "$first $last \n";
> print $first .' '. $last ."\n";
> print $first; print ' '; print $last; print "\n";
> btw, you should really read the FAQs.

guru perl programmer:
> RTFM, for the love of god, its right there 
> in the FAQs. You should spend some time
> glancing through at least an introductory
> text on how to program in perl before you
> come in here and waste everyone's time by
> posting such ludicrous questions that have
> already been answered by the standard 
> documentation. I mean, we have better things
> to do then spend our day sifting through
> message after message of inane questions.
> We do have jobs, and a life outside of perl
> and outside of this newsgroup, so no one
> here wants to have wade through a bunch
> of crap questions when there's real work
> to be done, real perl questions to be 
> answered, real stumpers that deserve to be
> addressed in this forum. no one wants to 
> spend most of their time sorting the 
> wheat from the chaf, when we could be 
> doing more important things besides sitting
> here, reading through a bunch of stupid
> questions from lazy morons of the likes 
> of you. if your a programmer by profession,
> do your employer and quit now, rather than
> bringing your entire company down in flames
> when they try to run one of yours scripts.
> Did I mention that I have more important
> things to do than answer stupid questions?
> Anyway, if you must know, and for the sake 
> of ending this thread so that more useful
> questions will get more of the bandwidth,
> one of the more obvious solutions is this:
> $_=join(' ',($first,$last));print;
> Now quit posting such stupid questions and
> wasting the bandwidth of this newsgroup
> and wasting everyone's time who have to
> read through so many dumb questions that
> could be answered by simply reading the FAQ's.
> we have more important things to do.

robot response:
> you ninny. here I am, with the brain the
> size of a planet, and what do I get?
> "perlbot, how do I print two variables on 
> the same line?" And all my diodes on one
> side are still aching. but do you care?
> very well, if you must ask, ask away.
> its not like I have anything important
> to do.
>
> likely answers may be found via:
>  command line: perldoc -f print
>  web: http://www.cpan.org/faqs/FAQ1.html
>  pod: $PERLDIR/docs/FAQ1.pod
>


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

Date: Thu, 1 Jul 1999 21:15:07 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Top 10 responses to the Robot/email idea
Message-Id: <rq3hl7.294.ln@magna.metronet.com>

revjack (revjack@radix.net) wrote:

: The tough greetings one gets here have shamed me into reading 
: the documentation, using -w and strict, looking up answers in 
: the online FAQs and testing code before posting it here. Notice 
: I don't post many questions here? It's not because I don't have 
: any perl questions - I got a million of 'em. I just know how to 
: find most of the answers now. It works.


   Eureka!

   Another programming "soul" saved.

   All curmudgeons pat yourself on the back for 5 seconds...

   ...

   OK, stop now.

   stop!

   STOP!


   Oh well...


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


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

Date: Fri, 02 Jul 1999 11:10:39 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Top 10 responses to the Robot/email idea
Message-Id: <377D009F.CC0F2C91@mail.cor.epa.gov>

Greg Bartels wrote:
> [snippage]
> robot response:
> > you ninny. here I am, with the brain the
> > size of a planet, and what do I get?
> > "perlbot, how do I print two variables on
> > the same line?" And all my diodes on one
> > side are still aching. but do you care?
> > very well, if you must ask, ask away.
> > its not like I have anything important
> > to do.
> [more snippage]

Reading the last four lines, I have a question.
The Perl bot is part Jewish?

David
-- 
David Cassell, OAO                     cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician


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

Date: Fri, 2 Jul 1999 21:35:30 +0200
From: "Trond Michelsen" <mike@crusaders.no>
Subject: Re: Top 10 responses to the Robot/email idea
Message-Id: <Cx8f3.418$cR6.3809@news1.online.no>


Greg Bartels <gbartels@xli.com> wrote in message
news:377CAD67.3F69B3A2@xli.com...
> guru perl programmer:
[...]
> > of you. if your a programmer by profession,
> > do your employer and quit now, rather than
[...]

Maybe I just have a filthy mind, but I'd rather not "do" my employer, thank
you very much ;-)

--
Trond Michelsen





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

Date: 2 Jul 1999 12:49:18 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Top 10 responses to the Robot/email idea
Message-Id: <7licge$1a1$1@gellyfish.btinternet.com>

On Thu, 01 Jul 1999 22:44:57 GMT nospam@domain.com wrote:
> I still think that there's no such thing as a stupid question.  
> A person who posts a FAQ is not a moron, and does not deserve 
> to be mocked or hounded out because of it. 

I would tend to disagree. A person who posts a FAQ has :

  * Certainly not looked at news.announce.newusers

  * Certainly not bothered to look at the documentation that comes
    with Perl

  * Certainly not bothered to observe the proceedings of the group
    for more than ten minutes.

I might stop short of moron but rude and ignorant certainly fit.

/J\
-- 
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>


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

Date: Fri, 02 Jul 1999 15:02:30 -0400
From: Greg Bartels <gbartels@xli.com>
Subject: Re: Top 10 responses to the Robot/email idea
Message-Id: <377D0CC6.C27AFA01@xli.com>

woops. 
s/employer and/employer a favor and/;

Greg
Dirty Old Man in training...
;)


Trond Michelsen wrote:
> 
> Greg Bartels <gbartels@xli.com> wrote in message
> [...]
> > > if your a programmer by profession,
> > > do your employer and quit now, rather than
> [...]
> 
> Maybe I just have a filthy mind, but I'd rather not "do" my employer, thank
> you very much ;-)
>


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

Date: Fri, 02 Jul 1999 18:37:01 -0400
From: John Nolan <nolanj00@mh.us.sbphrd.com>
Subject: Re: Top 10 responses to the Robot/email idea
Message-Id: <377D3F0D.39743C7@mh.us.sbphrd.com>

Jonathan Stowe wrote:
> 
> On Thu, 01 Jul 1999 22:44:57 GMT nospam@domain.com wrote:
> > I still think that there's no such thing as a stupid question.
> > A person who posts a FAQ is not a moron, and does not deserve
> > to be mocked or hounded out because of it.
> 
> I would tend to disagree. A person who posts a FAQ has :
> 
>   * Certainly not looked at news.announce.newusers
> 
>   * Certainly not bothered to look at the documentation that comes
>     with Perl
> 
>   * Certainly not bothered to observe the proceedings of the group
>     for more than ten minutes.
> 
> I might stop short of moron but rude and ignorant certainly fit.


Yes, I see your point.  I agree that it's not considerate
for new users to post FAQ's or post anything before lurking
for a while to see how things work.  It's definitely a 
rather annoying problem.  I don't want to sound like I'm 
defending the practise.  

But I think that the Perl people's solution to this problem
has not been very smart.  If you just make it a point to
follow-up every inappropriate post with a barrage of insults,
then it makes *YOU* look bad.  You just seem like jerks.  
I know this is not your intention, but that's the result. 

I personally find the guru-bile far more annoying than
the newbie questions.  I can ignore the newbie stuff,
but the gurus really should know better.  It makes the
whole set of Perl developers look like bad people.  
IMHO, you guys need to rise above this, and set an example.  

Actually, I don't understand why certain people are still
even reading c.l.p.misc, given that they don't want to 
deal with the majority of the traffic there.  I mean, 
if you don't want to deal with the noise, then just 
read c.l.p.moderated.  That's why it's there, right?  
Wasn't that the whole point?  Let someone else read 
the dumb questions on c.l.p.misc.  No one is forcing you. 

Since the gurus are the ones who created the newsgroups
and set the tone there, I think the ball is in your court
for finding the best solution.  The current solution
is no good at all.  Moreover, this problem is not going to 
get better, it's going to get worse, because the number of 
Internet users and the number of people writing Perl is 
going to get larger.  There are going to be even more 
ill-informed people who want to use Usenet to talk about Perl.
You might as well get used to the idea, and make the
best of it.  It makes no sense to continually 
bang your head against this wall.  

Unless that's what you *want* to do.  :) 

-- 
John Nolan
nolanj00 (at) mh us sbphrd com


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

Date: 02 Jul 1999 01:17:14 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Try this! (5.00404 - 5.00503 I think)
Message-Id: <x7d7yb3a1x.fsf@home.sysarch.com>

>>>>> "c" ==   <cabneySPAM@SPAM.SPAMcyberpass.net> writes:

  c> # if it's on the command line w/no arg it gets a 1
  c> #$opt_D ? $DEBUG = 1 : $DEBUG = 0;

where did you get the idea do use that code? the ?: is meant for use in
assigning one of 2 values based on a boolean condition. so how could you
extrapolate that to doing assignments in the expression clauses?

why not just do this:

$DEBUG = $opt_D ? 1 : 0 ;

it works, it is easy to understand and it is the proper way to use ?:

in fact, why not just assign it dierectly? $opt_D is fine as a boolean
and therefore so would $DEBUG = $opt_D. as long as you only tet it, you
should not get a warning. you are using -w, aren't you?

i almost wish ?: would not allow assignment as a side effect but that is
not possible due to its allowing almost any expression like all good perl
operators do.

  c> Any hints or flames are welcome <g>.

you won't get any flames from me (i have the flaming uri locked up).

BTW as someone else posted, you should rtfm some more. precedence is
important to know.

uri

-- 
Uri Guttman  -----------------  SYStems ARCHitecture and Software Engineering
uri@sysarch.com  ---------------------------  Perl, Internet, UNIX Consulting
Have Perl, Will Travel  -----------------------------  http://www.sysarch.com
The Best Search Engine on the Net -------------  http://www.northernlight.com


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

Date: 2 Jul 1999 04:18:55 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Try this! (5.00404 - 5.00503 I think)
Message-Id: <377c920f@cs.colorado.edu>
Keywords: bug

     [courtesy cc of this posting mailed to cited author]

In comp.lang.perl.misc, cabney@prius.jnj.com writes:
:#$opt_D ? $DEBUG = 1 : $DEBUG = 0;

:Forgive me if this is a faq, but it looks like any assignment operations
:in the x ? y : z thinger aren't evaluated.

That's an RTFM, sir.

% man perlop
 ...

       Because this operator produces an assignable result, using
       assignments without parentheses will get you in trouble.
       For example, this:

           $a % 2 ? $a += 10 : $a += 2

       Really means this:

           (($a % 2) ? ($a += 10) : $a) += 2

       Rather than this:

           ($a % 2) ? ($a += 10) : ($a += 2)

And of course, that should really be

   $a += ($a % 2) ? 10 : 2;

--tom
-- 
    Paginae libri mei electronici neque scinduntur neque 
    madescunt neque vento flantur.


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

Date: Fri, 02 Jul 1999 08:17:03 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Trying again
Message-Id: <378174d1.5163773@news.skynet.be>

Joan Richards wrote:

>So, I have my find call -> find(\&wanted, '/directory');
>
>Then my wanted routine ->
>
>sub wanted {
>        my $tmp;
>        my $tmp2;
>        open(FOO, ">/directory/dump") || die "Couldn't open $!";
>                print FOO "######$File::Find::name\n" if ! -d; # I do
>this so I can know which file I"m looking at
>                $tmp2 = "$File::Find::name";
>        open(TEMP, "$tmp2") || die "Coudln't open $!";
>                print FOO while (<TEMP>);

Ooh. this changes $_. Very much a no-no in File::Find.
>        close(TEMP);
>        close(FOO);
>}


Try localizing $_ first.

	local($_);

And you may try checking if the file actually IS a real file. Some
non-files creep through.

That's two things that I personally consider bugs of the module.

	Bart.


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

Date: Fri, 2 Jul 1999 12:11:28 GMT
From: John.Borwick@sas.com (John Borwick)
Subject: Re: Trying again
Message-Id: <3780ac36.86214419@newshost.unx.sas.com>

On Fri, 02 Jul 1999 08:17:03 GMT, bart.lateur@skynet.be (Bart Lateur)
wrote:

>And you may try checking if the file actually IS a real file. Some
>non-files creep through.

I'm just curious about File::Find ... what "non-files" are returned?

Thanks,

__ 
John Borwick


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

Date: Fri, 02 Jul 1999 13:21:43 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Trying again
Message-Id: <377dbaa3.8226556@news.skynet.be>

John Borwick wrote:

>>And you may try checking if the file actually IS a real file. Some
>>non-files creep through.
>
>I'm just curious about File::Find ... what "non-files" are returned?

"."(!!!), directories, probably links/symlinks too, although I can't
test that (DOS doesn't support that).

	use File::Find;
	find sub { print "$File::Find::name : $_\n" unless -f },
	    '/some/dir';

	Bart.


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

Date: 02 Jul 1999 10:15:00 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Trying again
Message-Id: <x7vhc316l7.fsf@home.sysarch.com>

>>>>> "BL" == Bart Lateur <bart.lateur@skynet.be> writes:

  BL> John Borwick wrote:
  >>> And you may try checking if the file actually IS a real file. Some
  >>> non-files creep through.
  >> 
  >> I'm just curious about File::Find ... what "non-files" are returned?

  BL> "."(!!!), directories, probably links/symlinks too, although I can't
  BL> test that (DOS doesn't support that).

while File::Find is not perfect, it is not meant to filter dirs for
you. that has to be under your control. it will descend into the dirs
but it has to return all dir entries regardless of what they are. you
might want the dirs only and not the files or vice versa. 

uri

-- 
Uri Guttman  -----------------  SYStems ARCHitecture and Software Engineering
uri@sysarch.com  ---------------------------  Perl, Internet, UNIX Consulting
Have Perl, Will Travel  -----------------------------  http://www.sysarch.com
The Best Search Engine on the Net -------------  http://www.northernlight.com


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

Date: Fri, 2 Jul 1999 10:58:52 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Trying again
Message-Id: <c3kil7.8i3.ln@magna.metronet.com>

John Borwick (John.Borwick@sas.com) wrote:
: On Fri, 02 Jul 1999 08:17:03 GMT, bart.lateur@skynet.be (Bart Lateur)
: wrote:

: >And you may try checking if the file actually IS a real file. Some
: >non-files creep through.

: I'm just curious about File::Find ... 


   It is not about File::Find, it is a filesystem issue.


: what "non-files" are returned?


   directories, symbolic links, etc...


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


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

Date: 2 Jul 1999 17:36:59 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: unix passwd auth in CGI
Message-Id: <7litbr$1dd$1@gellyfish.btinternet.com>

On Fri, 02 Jul 1999 03:42:27 GMT Jordan Hiller wrote:
> Ameet Chaubal wrote:
>> 
>> I am trying to write a form in CGI which would allow the user to change his
>> unix passwd.
>> If I run the "passwd" command; it asks the user to enter the passwd again in
>> order to confirm it.
>> Is there any other way to get the passwd twice on a form and match it
>> against the encrypted passwd in
>> /etc/shadow?
>> 
> I have a very easy-to use script that should work, but I'm not very fluent with
> Unix. Is the /etc/shadow in the format of:
> 
> username:cryptedpassword
> username2:cryptedpassword2
> etc.
> 
> If not what format is it? I'd be happy to send you the script but I'm not sure
> if it'll work with your format...
> 

No a show passwd file will look like :

doris:8vJUNl4IK82xo:10698:10000:99999:7:0::0

Where the format of this file is described in the shadow(5) manpage ...

/J\
-- 
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>


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

Date: Fri, 2 Jul 1999 13:11:42 GMT
From: mark miller <cmmiller@gsbfac.uchicago.edu>
Subject: use 'refs';
Message-Id: <Pine.GSO.3.96.990701161158.4162U-100000@gsbfac.uchicago.edu>



When one uses the 'strict' module, one can counter its effect by
declaring certain variables and subroutines using the 'vars' and 'subs'
modules.  Why isn't there an equivalent 'refs'?  (Or am I missing it on
CPAN?)  Is it just that no one's written the module yet, or is there
something intrinsic to references which makes it difficult/ impossible/
unproductive to write a package which facilitates predeclaring them. 


  mark



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

Date: 2 Jul 1999 14:34:18 GMT
From: gbacon@itsc.uah.edu (Greg Bacon)
Subject: Re: use 'refs';
Message-Id: <7liila$9f6$4@info2.uah.edu>

In article <Pine.GSO.3.96.990701161158.4162U-100000@gsbfac.uchicago.edu>,
	mark miller <cmmiller@gsbfac.uchicago.edu> writes:
: When one uses the 'strict' module, one can counter its effect by
: declaring certain variables and subroutines using the 'vars' and 'subs'
: modules.  Why isn't there an equivalent 'refs'?  (Or am I missing it on
: CPAN?)  Is it just that no one's written the module yet, or is there
: something intrinsic to references which makes it difficult/ impossible/
: unproductive to write a package which facilitates predeclaring them. 

References are scalars too.  Declare your scalars that will hold
references with C<use vars ...>.

Greg
-- 
I guess I just prefer to see the dark side of things. The glass is always
half-empty. And cracked. And I just cut my lip on it. And chipped a tooth. 
    -- Janeane Garofalo


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

Date: Fri, 02 Jul 1999 17:38:39 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: use 'refs';
Message-Id: <377df79e.3522834@news.skynet.be>

Greg Bacon wrote:

>References are scalars too.  Declare your scalars that will hold
>references with C<use vars ...>.

Urm... I think he means to predeclare "subone", "subtwo" so that

	$subref = "subone";
	&{$subref}(1..3);

works without complaints.

I think this is a whole different mindset. Pretty much impossible to
implement in perl as it is now.

This would be my idea:

	%sub = ( subone => \&subone, subtwo => \&subtwo );

	$call = 'subone';
	($subs{$call} || 
	  sub { die "Error: calling undeclared sub $call"}
	)->(1..3);

	Bart.


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

Date: 2 Jul 1999 18:29:38 GMT
From: gbacon@itsc.uah.edu (Greg Bacon)
Subject: Re: use 'refs';
Message-Id: <7lj0ei$c4n$1@info2.uah.edu>

In article <377df79e.3522834@news.skynet.be>,
	bart.lateur@skynet.be (Bart Lateur) writes:
: Greg Bacon wrote:
: >References are scalars too.  Declare your scalars that will hold
: >references with C<use vars ...>.
: 
: Urm... I think he means to predeclare "subone", "subtwo" so that
: 
: 	$subref = "subone";
: 	&{$subref}(1..3);
: 
: works without complaints.

Oh.  That's a circumfix operator: :-)

    {
        no strict 'refs';
        $subref = "subone";
        &{$subref}(1..3);
    }

Greg
-- 
 ...ccoommiitteess (aside: don't you think committee looks cooler and is easier
to write if we just double every letter and be done with it?). 
    -- Alex Lopez-Ortiz


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

Date: Fri, 02 Jul 1999 14:00:32 GMT
From: newsmf@bigfoot.com
Subject: use perl to kill processes? Pls help
Message-Id: <7liglp$cc5$1@nnrp1.deja.com>

How can I use perl to kill all processes that have been running for
more than x minutes?

Thanks a bunch for helping.

Cheers from Miami,

Marc.



Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: Fri, 02 Jul 1999 08:13:32 -0700
From: Harry Yu <hyu1@mipos2.intel.com>
Subject: Using ssi file in cgi script
Message-Id: <377CD71C.DE297AD9@mipos2.intel.com>

Hi,
I'm having trouble using a .ssi file in my cgi perl script.  I did this
LWP::Simple;
print <HTML>
:
:
:
print </HTML>
print get("http://whatever/file.ssi");

It worked for a bit then all of a sudden it didn't work.  Does anyone
know why?
Please reply to this message or e-mail me at hyu1@mipos2.intel.com

Thanks
Harry




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

Date: Thu, 1 Jul 1999 17:21:21 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Using strict
Message-Id: <h4mgl7.c44.ln@magna.metronet.com>

Socket0 (socket0@hotmail.com) wrote:
: A client has asked me to use strict on a Perl application I wrote for 
: them. Up to now, my programming has been pretty slapdash, 


   Since you haven't been using 'use strict' everybody can already
   infer a slapdash programming style.

   Real Programmers pay attention to scoping issues.

   :-)


: with variables 
: grabbed out of the air and used all over the place. Apart from what it 
: basically is, I know nothing about strict. Are there any good tutorials 
: or resources regarding strict available on the Net, or any books that 
: specifically cover good programming practice in Perl? Anything covering 
: the subject in more depth than the Perl documentation or FAQ.


   "scoping" (or "variable visibility") are the terms relevant
   to your query.

   It is a common Computer Science topic, not specific to Perl.

   Try those terms in your favorite search engine.


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


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

Date: Fri, 2 Jul 1999 07:33:44 +0100
From: David Thornton </dev/null@davidthornton.com>
Subject: Using the GETSTORE command
Message-Id: <ZziD0AAI1Ff3EwtD@davidthornton.com>

I am new to Perl but have managed to write a small script that is doing
basically want I want it to do. Deja.com was a great help for this.

The script is designed to download files via http to the server. My
script is very basic and I would like to add some modifications to it.

This is it:

useLWP::Simple;
getstore('http://www.domainname/whatever/thefile0.zip','thefile0.zip');
getstore('http://www.domainname/whatever/thefile1.zip','thefile1.zip');
[etc, listing all the files I want to get]

I am running the script by typing:

perl thescript.pl

in the directory I have located the script and want to store the files
download in, via Telnet

The script works. It is all located on a remote server that I am
telneting into.

1. How can I get the script to function fully *without* needing to be
constantly connected to the server via telnet? Currently I am connected
by telnet and running the script. I have to stay connected by telnet
until the script has executed in order for it to work. I would like to
be able to run the script and disconnect from the server, reconnected
later when the script has completed. I have a fully functional web
server with full custom cgi-bin and Perl 5.

2. Later, once point 1 has been achieved, I would like to get the script
to time how long things have taken to download and also have it email me
when the script has completed. Any pointers for this?

If someone could modify what I have above, indicating what the
modifications do, I would be most interested. This is all new to me and
I would like to learn.

Thanks.

-- 
David Thornton


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

Date: Fri, 02 Jul 1999 07:01:04 GMT
From: backwards.saerdna@srm.hc (Andreas Fehr)
Subject: Re: Using the GETSTORE command
Message-Id: <1105_930898864@chstaw0439>

On Fri, 2 Jul 1999 07:33:44 +0100, David Thornton </dev/null@davidthornton.com> wrote:
>
> 1. How can I get the script to function fully *without* needing to be
> constantly connected to the server via telnet? Currently I am connected
> by telnet and running the script. I have to stay connected by telnet
> until the script has executed in order for it to work. I would like to
> be able to run the script and disconnect from the server, reconnected
> later when the script has completed. I have a fully functional web
> server with full custom cgi-bin and Perl 5.

What about using a script the calls another script? I'm not sure if this works
on unix with the rights (logoff and keep running a script...)


> 2. Later, once point 1 has been achieved, I would like to get the script
> to time how long things have taken to download and also have it email me
> when the script has completed. Any pointers for this?

Get the time at the first line of the script and at the last line of the script.
Subtract the two times. Is that what you need?

Then, at the very last line send an email (don't know how to do that with
any package, but ther is one like Mail::xxxx).

Andreas


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

Date: Fri, 2 Jul 1999 15:46:12 +0500
From: "Faisal Nasim" <swiftkid@bigfoot.com>
Subject: Re: Using the GETSTORE command
Message-Id: <7lj8ji$7p63@news.cyber.net.pk>

> What about using a script the calls another script? I'm not sure if this
works
> on unix with the rights (logoff and keep running a script...)

Set a cron job


> Get the time at the first line of the script and at the last line of the
script.
> Subtract the two times. Is that what you need?

better idea:


# $^T is initialized when the script is started
my $sec = time - $^T;

$approx = sprintf (
  "%02d:%02d:%02d" ,
  int ( $sec / 3600 ) ,
  int ( $sec / 60 ) % 60 ,
  $sec % 60 ,
);


>
> Then, at the very last line send an email (don't know how to do that with
> any package, but ther is one like Mail::xxxx).

open mail , '|/path/to/sendmail';
print mail <<EOT:
To: you\@host.com
Subject: script completed

The script is completed and took $approx time to run.

Have a nice day.

Perl is Great!
EOT
close mail;




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

Date: Fri, 02 Jul 1999 19:58:48 GMT
From: Jordan Hiller <hiller@email.com>
Subject: Re: Using the GETSTORE command
Message-Id: <377D1A43.33AC8DD7@email.com>

I must say I don't understand that bit of code. What does it do and how does it
work?

TIA,
Jordan

Faisal Nasim wrote:
> 
> > Get the time at the first line of the script and at the last line of the
> script.
> > Subtract the two times. Is that what you need?
> 
> better idea:
> 
> # $^T is initialized when the script is started
> my $sec = time - $^T;
> 
> $approx = sprintf (
>   "%02d:%02d:%02d" ,
>   int ( $sec / 3600 ) ,
>   int ( $sec / 60 ) % 60 ,
>   $sec % 60 ,
> );
> 

-- 
Jordan Hiller (hiller@email.com)

JavaScript and Perl programs for
 making online tests and quizzes:
http://web-shack.hypermart.net/quiz.html


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

Date: Fri, 02 Jul 1999 22:34:36 GMT
From: "Jorge Escobar" <jescobar@intermedios.com>
Subject: Web based email designed in PERL
Message-Id: <08bf3.191$dV1.23974@typhoon1.gnilink.net>

Hi!

I am a webmaster for a Web Portal, and I am looking any resources out there
that help me visualize or offers some tips to design my own Web Based Email
System.

I know there is an O'Reilly book coming in October about this, but I thought
I could find some resources on the web, but haven't had any luck.

Any ideas? (Please reply to my email also: jescobar@interlatin.net)

Thanxs!

Jorge Escobar
interLatin




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

Date: Fri, 2 Jul 1999 14:29:42 -0400
From: Fernando Morais Dasilva <fmd@wam.umd.edu>
Subject: what questions was perl designed to solve?
Message-Id: <Pine.GSO.4.10.9907021422340.6966-100000@sun17epsl.wam.umd.edu>


i'm not familiar with perl at all.  i'm writing a short paper on perl and
i have a few questions about the language.  the first is what problems was
perl designed to solve, another way to ask this question would be, why not
choose some other language to respond to the problem in question?

thanks a lot
fernando



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

Date: Fri, 02 Jul 1999 21:12:28 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: what questions was perl designed to solve?
Message-Id: <37812a84.3740831@news.skynet.be>

Fernando Morais Dasilva wrote:

>i'm not familiar with perl at all.  i'm writing a short paper on perl and
>i have a few questions about the language.  the first is what problems was
>perl designed to solve, another way to ask this question would be, why not
>choose some other language to respond to the problem in question?

It was designed to find the answer to the Ultimate Question of life, the
universe and everything. BTW if you're interested, the answer is "42".

Now, on a more serious note, check out

	http://language.perl.com/info/synopsis.html

	Bart.


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

Date: 1 Jul 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 1 Jul 99)
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 V9 Issue 17
************************************


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