[12045] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 5645 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu May 13 03:07:22 1999

Date: Thu, 13 May 99 00:03:04 -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, 13 May 1999     Volume: 8 Number: 5645

Today's topics:
        how do I run perl?? <anaton@ibm.net>
    Re: how do I run perl?? <latsharj@my-dejanews.com>
    Re: how do I run perl?? <bwlang@genome.wi.mit.edu>
    Re: How to CHMOD to 755 using check boxes? <bwlang@genome.wi.mit.edu>
        How to mail html files? jmsinstl@my-dejanews.com
    Re: Installing PERL on NT Server <cassell@mail.cor.epa.gov>
        Killing a Process <toddm@waltz.rahul.net>
    Re: Lists and Arrays (Fuzzy Warm Moogles)
    Re: Matching & substituting escaped characters in a reg (Larry Rosler)
        mod_perl and apache question: How to call initializatio gmei@my-dejanews.com
    Re: mod_perl and apache question: How to call initializ zenin@bawdycaste.org
    Re: need script to debug web server links... <jtjuslin@spam.cc.hut.fi>
        Net::Telnet Module Question jmsinstl@my-dejanews.com
    Re: Net::Telnet Module Question (Larry Rosler)
        newbie ?'s tex2121@my-dejanews.com
    Re: Newbie question on CGI developing (Arjun Ray)
    Re: no street MIME's this time (Greg Bacon)
    Re: no street MIME's this time <gbartels@xli.com>
        novice needs help--static variables <bulldozer_69@hotmail.com>
    Re: novice needs help--static variables (Charles R. Thompson)
    Re: novice needs help--static variables <t-armbruster@ti.com>
        param parsing  <jgough@163.net>
    Re: param parsing <ebohlman@netcom.com>
    Re: parse variables to a sub <jgough@163.net>
    Re: password checking (Larry Rosler)
    Re: password checking (Charles R. Thompson)
    Re: perl debugger acting bizarre (debugger bug?) (Ilya Zakharevich)
    Re: perldoc question (Larry Rosler)
    Re: perldoc question <cassell@mail.cor.epa.gov>
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: Wed, 12 May 1999 22:25:06 +0200
From: david <anaton@ibm.net>
Subject: how do I run perl??
Message-Id: <3739E3A2.64F79719@ibm.net>

I am new to perl and scripts...
I have been reading some perl tutorials..and the instructions set.

I wonder hwo can I run my sample programs?..I understand that I have to
write a perl program using a text editor..and where do I go from
there?...do I have to downlod a program..or an interpreter..in short
what do I have to have and do to run my very first perl codes??

I read that i have to look for perl..using the "where perl"
statment...does this have to be done on DOS?..btw I am a windows 95
user..

I know it sounds silly ..but i simply dont know where to go..

thanks for the help



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

Date: Wed, 12 May 1999 20:39:12 GMT
From: Dick Latshaw <latsharj@my-dejanews.com>
Subject: Re: how do I run perl??
Message-Id: <7hcotg$ok2$1@nnrp1.deja.com>

In article <3739E3A2.64F79719@ibm.net>,
  david <anaton@ibm.net> wrote:

> I wonder hwo can I run my sample programs?
> btw I am a windows 95
> user..

That's too bad.

> I know it sounds silly ..but i simply dont know where to go..

Go to www.activestate.com

> thanks for the help

You're welcome.

--
Regards,
Dick


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


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

Date: Wed, 12 May 1999 16:59:19 -0400
From: "Bradley W. Langhorst" <bwlang@genome.wi.mit.edu>
Subject: Re: how do I run perl??
Message-Id: <3739EBA7.FE03BCDB@genome.wi.mit.edu>



you can get perl from

www.perl.org

good luck

brad




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

Date: Wed, 12 May 1999 16:53:16 -0400
From: "Bradley W. Langhorst" <bwlang@genome.wi.mit.edu>
Subject: Re: How to CHMOD to 755 using check boxes?
Message-Id: <3739EA3C.A163AB96@genome.wi.mit.edu>



>
> Owner: 1) Read 2) Write 3) Execute
> Group: 1) Read 2) Write 3) Execute
> Others: 1) Read 2) Write 3) Execute
>
> I am currently have all the nine boxes selected. Although it works, I don't
> think it is correct. Is it?

you probably want to have yourself with read write and execute privelidge
you may want to have your group with all privledge but at least read  and
execute
you probably want to have others with read and execute privledge only.

so check all the reads
check all the executes
check only write for owner and possibly group as well.

brad



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

Date: Wed, 12 May 1999 21:22:28 GMT
From: jmsinstl@my-dejanews.com
Subject: How to mail html files?
Message-Id: <7hcree$qlm$1@nnrp1.deja.com>

I would like to mail an html file that can be viewed as html with my
mailreader (MSOutlook).  I can tell that I need some Mime headers to do
this properly.  It looks like MIME::Lite is too lite, in that I don't
think it sends content-type=text/html.

What modules do I need to do this?  Are there any other good resources?


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


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

Date: Wed, 12 May 1999 17:00:39 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Installing PERL on NT Server
Message-Id: <373A1627.8BEC7E61@mail.cor.epa.gov>

Jason Levine wrote:
> 
> Does anyone know of a good resource for problems with installing PERL on
> NT Server

Are you trying to install Perl on an NT box?  Or are you trying to
get PerlScript programs to run on a Webserver on NT?

If you're using ActiveState Perl, www.activestate.com is perhaps the
best resource if you're having initial installation problems.  Or
the win32-perl-users listserv which is accessible from the above URL.

If you're trying to get Perl working on a webserver, the HTML docs
which come with ActiveState Perl have one of the better discussions
on getting things working for a variety of servers.  Look in the
ActivePerl FAQ under (oddly enough) "Web Server Config".

HTH,
David
-- 
David Cassell, OAO                            cassell@mail.cor.epa.gov
Senior Computing Specialist                      phone: (541) 754-4468
mathematical statistician                          fax: (541) 754-4716


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

Date: 12 May 1999 20:46:14 GMT
From: Todd McLaughlin <toddm@waltz.rahul.net>
Subject: Killing a Process
Message-Id: <7hcpam$ioq$1@samba.rahul.net>

I have Perl get the output from Lynx:

$data = `lynx -dump http://....`

Sometimes Lynx hangs or has problems getting the data so my script
hangs.  Is there anyway to have Perl kill the process if it hasn't
finished after 30 seconds?  Or perhapes a command line option for
Lynx that I don't know about?  Thanks!

Todd


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

Date: Thu, 13 May 1999 06:52:53 GMT
From: tgy@chocobo.org (Fuzzy Warm Moogles)
Subject: Re: Lists and Arrays
Message-Id: <373a737f.1288467@news.oz.net>

On Wed, 12 May 1999 20:02:40 -0400, tadmc@metronet.com (Tad McClellan) wrote:

>   It appears to me that the distinction is not rigourously 
>   maintained in the standard Perl docs, which seems a
>   Bad Thing...

A list is a list.
An array is an array.
wantlist?
wantarray?

-- 
Fuzzy | tgy@chocobo.org | Will hack Perl for a moogle stuffy! =^.^=


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

Date: Wed, 12 May 1999 12:45:01 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Matching & substituting escaped characters in a regexp.
Message-Id: <MPG.11a37a1a13d7298b989a44@nntp.hpl.hp.com>

[Posted and a courtesy copy mailed.]

In article <3739b492.5689747@news1.newscene.com> on 12 May 1999 12:24:08 
-0500, jon ewing <jon@webdev.co.uk> says...
> i recently wrote a script to parse a text file, replacing all escaped
> characters with their HTML equivalent. So, eg the data file contained
> 
> march\351
> 
> which was to be replaced with
> 
> march&#233;
 ...
> foreach $char (split \\, @_) {

You mean //, and one splits on a scalar, not on a list.  It's best not 
to post conjectures.

> 	if (unpack('c', $char) < 0) {
> 	$line .= '&#'.(ord $char).';';
> } else {
> 	$line .= $char;				
> }			
> 
> which is pretty slow.

And extraordinarily ugly.  :-)

    s/\\(\d+)/&#${\(oct $1)};/g;

or, for the faint at heart,

    s/\\(\d+)/'&#' . oct $1 . ';'/eg;

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


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

Date: Wed, 12 May 1999 19:55:12 GMT
From: gmei@my-dejanews.com
Subject: mod_perl and apache question: How to call initialization script ?
Message-Id: <7hcmav$m4b$1@nnrp1.deja.com>

Hi:

I have mod_perl-1.19 working with apache_1.3.6 on our Digital Unix
machine. I am also using ApacheDBI-0.81 to connect an oracle database.

I want to have a perl script file which is called at the start of
apache web server application to load some global variables so they can
be accessed by users from web front end.

For example, in the file "apache_init.pl", I can have something like:

# do DB connection
# Select a set of recs from a table
# load column values into perl arrays
#

My questions are:

Questions 1: How to copy these arrays into apach's global variables ,
so that web front end users can access them automatically when they
start up their session?

Questions 2: Where to call a initialization script from apache's
configuration file? ( /usr/local/apache/conf/httpd.conf   or
/usr/local/apache/conf/srm.conf)

and How?


Thanks in advance.

If you reply, please send a copy to  zlmei@hotmail.com

Guang Mei
gmei@3rdmill.com
http://www.3rdmill.com


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


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

Date: 12 May 1999 20:50:30 GMT
From: zenin@bawdycaste.org
Subject: Re: mod_perl and apache question: How to call initialization script ?
Message-Id: <926542368.364786@thrush.omix.com>

[posted & mailed]

gmei@my-dejanews.com wrote:
: I want to have a perl script file which is called at the start of
: apache web server application to load some global variables so they can
: be accessed by users from web front end.
: For example, in the file "apache_init.pl", I can have something like:

	<Perl>
	    require "apache_init.pl";
	</Perl>

: Questions 1: How to copy these arrays into apach's global variables , so
: that web front end users can access them automatically when they start up
: their session?

	<Perl>
	    $FooGlobal = "foo value";
	</Perl>

: Questions 2: Where to call a initialization script from apache's
: configuration file? ( /usr/local/apache/conf/httpd.conf or
: /usr/local/apache/conf/srm.conf)

	Apache 1.3.6 puts everything in httpd.conf, so unless you're still
	using the older style that's probably where you want it.  If you are
	using the older config style, use srm.conf.

: and How?

	See above.  You can drop any Perl code into a <Perl></Perl> segment.

-- 
-Zenin (zenin@archive.rhps.org)

        My code is filled with comments!  It's just that my comments are
        written in Perl.


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

Date: Wed, 12 May 1999 22:05:15 +0300
From: Jukka Juslin <jtjuslin@spam.cc.hut.fi>
Subject: Re: need script to debug web server links...
Message-Id: <3739D0EB.879475F2@spam.cc.hut.fi>

jb wrote:
> 
> Please let me know if this needs to be posted to another group...
> 
> I need some sort of script that I can verify all of the html links on my web
> server function correctly.  Where would I find such an animal, and what
> would you call it?
> 
> I have root access to the web server, so there aren't any accessability
> problems...

In some FAQ was a script by Tom Christiansen, which checks dead links:

#!/usr/bin/perl -w

use HTML::LinkExtor;
use LWP::Simple qw(get head);

$base_url = shift
	or die "usage: $0 <start_url>\n;
$parser = HTML::LinkExtor->new(undef, $base_url);
$parser->parse(get($base_url));
$links = $parser->links;
print "$base_url; \n";
foreach $linkarray (@links) {
	my @element = @linkarray;
	my @elt_type = shift @element;
	while (@element) {
		my ($attr_name, $attr_value) = splice(@element,0,2);
		if ($attr_value->scheme =~/\b(ftp|https?|file)\b/) {
			print " $attr_value: ". head($attr_value) ? 
				"OK" : "BAD", "\n";
		}
	}
}

++Jukka Juslin


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

Date: Wed, 12 May 1999 18:53:16 GMT
From: jmsinstl@my-dejanews.com
Subject: Net::Telnet Module Question
Message-Id: <7hcimo$j4b$1@nnrp1.deja.com>

One of the servers that I telnet to does some processing after logging
in.  It presents this message:
Attempting to get answerback.  If terminal hangs here, press return.

Well, my terminal hangs so I want the script to submit a carriage
return.  After it submits a return, then I'll have my normal foo>>
prompt from which I can work.

How do I get the script to submit a return?

Thanks in advance.


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


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

Date: Wed, 12 May 1999 13:29:36 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Net::Telnet Module Question
Message-Id: <MPG.11a38489dd5eb67989a4a@nntp.hpl.hp.com>

[Posted and a courtesy copy mailed.]

In article <7hcimo$j4b$1@nnrp1.deja.com> on Wed, 12 May 1999 18:53:16 
GMT, jmsinstl@my-dejanews.com <jmsinstl@my-dejanews.com> says...
> One of the servers that I telnet to does some processing after logging
> in.  It presents this message:
> Attempting to get answerback.  If terminal hangs here, press return.
> 
> Well, my terminal hangs so I want the script to submit a carriage
> return.  After it submits a return, then I'll have my normal foo>>
> prompt from which I can work.
> 
> How do I get the script to submit a return?

print "\r";

???  That is 'carriage return'.  If you actually mean 'line feed' or 
'newline', that is something else, but the idea is the same.  :-)

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


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

Date: Thu, 13 May 1999 05:38:56 GMT
From: tex2121@my-dejanews.com
Subject: newbie ?'s
Message-Id: <7hdohg$jvd$1@nnrp1.deja.com>

I am looking to write a probram that displays the most frequent m word
sequences in an arbitrary number of input files. n, m and the input
file names are specified on the command line.

I under stand that the command line will look something like this.

myprog n m file.dat file2.dat ....

I think I have the whole argv command line array down, but I am not
sure where to go from there. I think I am stuck on how to think of the
problem.  Any ideas would be greatly appreciated.  Thanks

ty


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


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

Date: 13 May 1999 01:28:21 -0500
From: aray@nmds.com (Arjun Ray)
Subject: Re: Newbie question on CGI developing
Message-Id: <37be688d.2263317578@news1.newscene.com>

In <MPG.11a41eb0c12c24bc9896b5@news>, design@raincloud-studios.com
(Charles R. Thompson) wrote:
| In article <373a28b8.11976741@nntp1.ba.best.com>, Ken Bass says...

| > One thing I was wondering was if there was a way to use a file
| > that has something like an html template that my program could
| > use. The graphics guy could generate it and modify it as needed,
| > without having to worry about affecting the program.
| 
| If you can become familiar with using s// and hashes in Perl, you
| could easily have him include an agreed-upon 'tag system' where 
| you will pull in a page and replace the tag with your information
| in the script.

While scripting substitutions in Perl like this certainly seems to get
the job done, I've always wondered why people would go for "solutions"
like this. One of the problems that concerns me is precisely the 'tag
system' needed to make this work: everyone manages to come up with
their own ad hoc 'tag system', the overall consequence of which is
that source files are neither fish nor fowl: not HTML documents, not
Perl scripts, just, well, some kinda sorta 'tag system' files.

For lookup-based substitutions, I've usually found it simpler just to
take advantage of the SGML entity reference mechanism. Instead of
having to invent a 'tag system', one can use a syntax which has been
an international standard since 1986, and thus get to maintain files
in a format that without change will be processable by any SGML
parser/environment. If needed, one could use Perl to generate the
appropriate entity declarations and feed them, along with the source
"template" (which is still a valid SGML document!) to a normaliser
like 'sgmlnorm'.

IMHO, any serious templating work starts with things that go beyond
lookup-based substitutions, as when actually having to generate the
HTML for some or all of the final result (example: running a query and
then displaying a client-selectable number of results at a time.) This
is where the homegrown 'tag systems' begin to buckle, because the
*syntactic* requirements of defining semantics - some sort of 'tag'
which the Perl script as a post-processor will have to recognize and
act upon - become non-trivial. All the more reason, therefore, to
leverage a pre-existing standard syntax.

If you can stand the learning curve (not too onerous, IMHO), I'd
suggest seriously considering the use of the SP distribution and the
SGMLS.pm package from CPAN. 


:ar


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

Date: 12 May 1999 19:57:56 GMT
From: gbacon@itsc.uah.edu (Greg Bacon)
Subject: Re: no street MIME's this time
Message-Id: <7hcmg4$o7u$1@info2.uah.edu>

In article <3739A9DE.3EAC5F85@xli.com>,
	Greg Bartels <gbartels@xli.com> writes:
:   sub magic_tie
:       {tie $_[0], 'magic_pkg', @_[1..$#_];}
: 
:   sub broken_magic_tie
:       {my ($temp) = @_;
:       tie $temp, 'magic_pkg', @_;}
: }
: 
: my $my_scalar;
: magic_pkg::magic_tie($my_scalar);
: $my_scalar = "failed to tie\n";
: print "$my_scalar\n";
: 
: ###############################
: 
: ok, so this works when i use the magic_tie sub,
: but not when I use the broken_magic_tie subroutine.
: 
: there is something fundamental about the @_  variable
: that I do not understand. I always thought of the 
: @_ variable as a stack that parameters get copied into
: for a procedure to be called.

No.  The values in @_ are actually references to the values in the
parameter list.  Observe:

    [14:00] ettsn% cat try
    #!/usr/bin/perl -w

    use strict;

    sub overwrite {
        my @ring = qw( foo bar baz );

        for (@_) {
            $_ = shift @ring;
            push @ring, $_;
        }
    }

    my @fruit = qw( apples oranges bananas pears pineapples );

    $" = "][";  # borrow a cool mjd-ism

    print "[@fruit]\n";
    overwrite @fruit;
    print "[@fruit]\n";
    [14:00] ettsn% ./try
    [apples][oranges][bananas][pears][pineapples]
    [foo][bar][baz][foo][bar]

: why does this work:
:       {tie $_[0], 'magic_pkg', @_[1..$#_];}
: 
: and this doesn't???
:       {my ($temp) = @_;
:       tie $temp, 'magic_pkg', @_;}

Be sure to read <URL:http://www.plover.com/~mjd/perl/Questions4.html>.

The heart of your problem is that the lexical in the latter goes out of
scope, so you're tie()ing a scalar that you immediately can't get to.
By modifying $_[0], you're changing the value of the scalar in your
caller, thus preserving the tie().

: does $_[0] somehow still point to the original variable,
: rather than a copy of it?

It's a reference (in the sense of CS-ish pass-by-reference--not a Perl
reference), not a pointer.  Assigning to @_ changes values in the caller
without having to dereference @_'s values.

: if it was a copy, then using
: my $temp = shift; would be exactly the same as $_[0];

Sort of.  There doesn't seem to be a way to pass tied scalars around
by value (I'd be interested in seeing a way to do it, though), so Perl's
pass-by-reference turns out to be quite useful.  This makes assigning to
@_ a necessity.  Learn to be happy with magic_tie. :-)

Exercise: how do you return a tied scalar from a subroutine?

Greg
-- 
I used to be sad because I had no woman.  Then I met a man who had no hands. 
    -- Rick Riebs


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

Date: Wed, 12 May 1999 15:21:01 -0400
From: Greg Bartels <gbartels@xli.com>
Subject: Re: no street MIME's this time
Message-Id: <3739D49D.BDE4197E@xli.com>

Greg Bacon wrote:
> 
> In article <3739A9DE.3EAC5F85@xli.com>,
>         Greg Bartels <gbartels@xli.com> writes:
> :   sub magic_tie
> :       {tie $_[0], 'magic_pkg', @_[1..$#_];}
> :

> @_ a necessity.  Learn to be happy with magic_tie. :-)
> 
> Exercise: how do you return a tied scalar from a subroutine?
> 

actually, that's what I originally was trying to do. the best I
could get was this approach. I'd prefer saying:

my $tied_scalar = magic_tie('initial_value');

rather than:

my $tied_scalar; magic_tie($tied_scalar, 'initial_value');

hm, I just realized that I never try this yet:

magic_tie(my $tied_scalar, 'initial_value');

that would be a little less typing anyways...
having it as a return value would be ideal.
is this possible? 

I'll check out the web page and try to figure out @_  
Many Thanks
Greg


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

Date: Wed, 12 May 1999 14:02:11 -0500
From: qq <bulldozer_69@hotmail.com>
Subject: novice needs help--static variables
Message-Id: <3739D033.72DFCD7E@hotmail.com>

hi ,
i'm a starting perl user.
I'm trying to generate a unique identification number for a web based
reporting system.
Each report sent must have a unique id number.
The syntax  of the id number will be as follows:
1. It will have the last 2 digits of the year
2. Then a period
3. and then the number returned by a counter .

This is incremented by 1 every time a new user sends the form in.
and the counter is reset to 0 at the beginning of every year.
In C you would use a static variable to generate the second part.
and each time the report is sent the variable is incremented.

eg. 99.1234
the next would be
    99.1235
Is there something similar to the static type in perl ?

any ideas on how to implement this?

also would it be a good idea to have a file that stores the value
and have this file read from it every time?and rewrite the value
every time its changed ..



thank you for your time.
sincerely
qq




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

Date: Wed, 12 May 1999 20:19:12 GMT
From: design@raincloud-studios.com (Charles R. Thompson)
Subject: Re: novice needs help--static variables
Message-Id: <MPG.11a3ad9acb96aea79896ac@news>

[This followup was posted to comp.lang.perl.misc and a copy was sent to 
the cited author.]

In article <3739D033.72DFCD7E@hotmail.com>, qq says...

> eg. 99.1234

As Larry just gave me a good once over with and it's on my mind... 

what happens when 2000 rolls around? :)

-- 
CT


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

Date: Wed, 12 May 1999 16:53:15 -0500
From: "Tim Armbruster" <t-armbruster@ti.com>
Subject: Re: novice needs help--static variables
Message-Id: <iPm_2.22$401.2313@dfw-service1.ext.raytheon.com>


qq wrote in message <3739D033.72DFCD7E@hotmail.com>...
>hi ,
>i'm a starting perl user.
>I'm trying to generate a unique identification number for a web based
>reporting system.


If you are just looking for a unique identifier, why not go with a timestamp
and a process ID?





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

Date: Thu, 13 May 1999 01:51:09 -0700
From: "james gough" <jgough@163.net>
Subject: param parsing 
Message-Id: <373a681e@nemo.idirect.com>

HI, all,
I always see people define subs like these:
sub MySub($) {
sub MySub($$$) {
sub MySub($@)  {

how do these $ and @ affect the parameter parsing?
thanks a lot.
--
_____
Regards,
James Gough




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

Date: Thu, 13 May 1999 06:23:09 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: param parsing
Message-Id: <ebohlmanFBnr2L.JwD@netcom.com>

james gough <jgough@163.net> wrote:
: HI, all,
: I always see people define subs like these:
: sub MySub($) {
: sub MySub($$$) {
: sub MySub($@)  {

: how do these $ and @ affect the parameter parsing?
: thanks a lot.

Read the section in perlsub entitled "prototypes."  Perl prototypes don't 
work the way lots of people (particularly C programmers) expect them to, 
so pay close attention to that section.



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

Date: Thu, 13 May 1999 01:52:34 -0700
From: "james gough" <jgough@163.net>
Subject: Re: parse variables to a sub
Message-Id: <373a6874@nemo.idirect.com>

Thank you both for the quick reply, I'll try that later. JG

Charles R. Thompson <design@raincloud-studios.com> wrote in message
news:MPG.11a236e53e4e65cf989691@news...
| [This followup was posted to comp.lang.perl.misc and a copy was sent to
| the cited author.]
|
| In article <37381419.353286810@news.inet.it>, Andrea L. Spinelli says...
|
| > ># ADD THIS - will keep you in line. :)
| > ># when you get errors, look in your log files!
| > >use strict;
| > >$q=new CGI;
| >  ^^^^^^^^^^^---- use strict did not keep _you_ in line!
| > Did you test what you posted? I did, and got
| > Do you realise you
| > are further confusing an already confused mind?
|
| Didn't have to test it... I knew it would bomb. Further, I don't think I
| was a jerk for it. I gave him a 'first step' lesson in debugging right
| off the bat.
|
| > ># when you get errors, look in your log files!
|      ^^^^
|
| Nothing is more illustrative than an example. He would either look in the
| logs for the error in my example, or come back and ask what was wrong
| when he started modifying it with 'prebuilt perfect code'. Either way,
| he's got to learn where the error logs are, what use strict does and how
| to debug his code.
|
| Maybe my approach was the wrong one, I'll step up to that, but even
| handing over a perfectly coded script telling him what use strict does
| would result in the this question being asked one to two days from now
| when he starts to work with the param() values from his form in
| variables.
|
| Which is the lesser of two evils? I just picked a pitchfork in the road
| and walked. Ultimately I was curious if he would come back just saying
| the script didn't work, or citing the error from the log.
|
| > >http://language.perl.com/newdocs/pod/perlfaq9.html
| > I agree. However, the poster has already the concept
| > that he must use CGI.pm, and has probably already
| > had a look at its documentation.
|
| By the look of the original code, I didn't get that feeling.
|
| > Sorry, Charles, nothing personal...
|
| No, not at all, just different pov's. I can see how I might could have
| illustrated that the script would generate an error and included the
| answer. Next time, I'll probably be less elusive.
|
| CT




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

Date: Wed, 12 May 1999 13:20:25 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: password checking
Message-Id: <MPG.11a38268638803c3989a48@nntp.hpl.hp.com>

[Posted and a courtesy copy mailed.]

In article <MPG.11a394d9cd1e68aa9896a8@news> on Wed, 12 May 1999 
18:33:37 GMT, Charles R. Thompson <design@raincloud-studios.com> says...
> In article <3739c50f.19246010@news1.channel1.com>, pontz@channel1.com 
> says...
 ...
> > Please respond by email
> 
> Only when I'm not asked to, that way it's a pleasant suprise.

God, that is perverse!  It may deserve an award.  Who can top it?

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


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

Date: Wed, 12 May 1999 20:39:56 GMT
From: design@raincloud-studios.com (Charles R. Thompson)
Subject: Re: password checking
Message-Id: <MPG.11a3b27b58b25f79896ad@news>

[This followup was posted to comp.lang.perl.misc and a copy was sent to 
the cited author.]

In article <MPG.11a38268638803c3989a48@nntp.hpl.hp.com>, Larry Rosler 
says...
> > > Please respond by email
> > Only when I'm not asked to, that way it's a pleasant suprise.
> God, that is perverse!  It may deserve an award.  Who can top it?

Eh. I'm not sure which angle that's coming from. Either you think it was 
funny, or you think I'm a lamo jerk. 

The intention was 'you dropped this here, you need to come back to pick 
it up... things like CC's are usually a curtosey and often a nice suprise 
to get when they are the useful ones... I don't mind getting them, but I 
don't expect them either. Emails alone don't benefit the group...

ahh.. forget it. I don't know how to present what I meant. I wasn't 
trying to offend a soul. I swear. If I did, I apoligize. That's all I can 
say.

-- 
CT
"Perl.. there, I said it"


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

Date: 13 May 1999 06:44:25 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: perl debugger acting bizarre (debugger bug?)
Message-Id: <7hdsc9$qf5$1@mathserv.mps.ohio-state.edu>

[A complimentary Cc of this posting was sent to Erik Johnson 
<ejohnso9@earthlink.net>],
who wrote in article <373A6CA3.971573D8@earthlink.net>:
>      1  #! /usr/local/bin/perl
>      2
>      3  $DEBUG = 1;
>      4  $infile_name = $ARGV[0];
>      5  open INFILE, $infile_name;
>      6  @text = <INFILE>;
>      7  close INFILE;
>      8
>      9  $line_no = 0;
>     10  while ($line_no <= $#text) {
>     11    $line_no++;
>     12    $line = $text[$line_no - 1];
>     13
>     14    # find first line of flight plan proper
>     15    if ($line !~ m|foo| )
>     16    {
>     17      next;
>     18    }
>     19    else {
>     20      last;
>     21    }
>     22  }
>     23  $foo = 1;
>     24  # line 18
>     25  $foo = 1;

There is no line 25 in this script.  The last line is line 23 (as it
is easy to see by giving the command

   w 23

to the debugger).  You may be also interested by the result of

   w 18

and 

    perldoc perlsyn

Ilya


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

Date: Wed, 12 May 1999 12:51:44 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: perldoc question
Message-Id: <MPG.11a37ba6f68964cc989a45@nntp.hpl.hp.com>

[Posted and a courtesy copy mailed.]

In article <7hcelo$fmh$1@nnrp1.deja.com> on Wed, 12 May 1999 17:44:25 
GMT, tbsmith@deltacom.net <tbsmith@deltacom.net> says...
> My answer may be in the doc itself, but I wouldn't know where to start
> looking. I'm wondering what the number means in the parens after a named
> function in it's man page, like in this excerpt of 'fork':
 ...
> It's the 'fork(2)' I'm talking about.

Welcome to Unixland.  That refers to "Section 2: System Calls" in the 
venerable Unix manual.

Section 1 is User Commands, such as cat(1).

Section 3 is Library Functions, such as printf(3).

The rest, you don't want to hear about.  Take my word for it!

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


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

Date: Wed, 12 May 1999 16:55:53 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: perldoc question
Message-Id: <373A1509.3567554E@mail.cor.epa.gov>

Larry Rosler wrote:
> 
> [Posted and a courtesy copy mailed.]
> 
> In article <7hcelo$fmh$1@nnrp1.deja.com> on Wed, 12 May 1999 17:44:25
> GMT, tbsmith@deltacom.net <tbsmith@deltacom.net> says...
> > My answer may be in the doc itself, but I wouldn't know where to start
> > looking. I'm wondering what the number means in the parens after a named
> > function in it's man page, like in this excerpt of 'fork':
> ...
> > It's the 'fork(2)' I'm talking about.
> 
> Welcome to Unixland.  That refers to "Section 2: System Calls" in the
> venerable Unix manual.
> 
> Section 1 is User Commands, such as cat(1).
> 
> Section 3 is Library Functions, such as printf(3).
> 
> The rest, you don't want to hear about.  Take my word for it!

What about section 6 ??  Don't forget the games!  :-)

David, who many consider to *be* deserving of a section 8...
-- 
David Cassell, OAO                            cassell@mail.cor.epa.gov
Senior Computing Specialist                      phone: (541) 754-4468
mathematical statistician                          fax: (541) 754-4716


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

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

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