[18344] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 512 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Mar 17 09:05:45 2001

Date: Sat, 17 Mar 2001 06:05:09 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <984837909-v10-i512@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Sat, 17 Mar 2001     Volume: 10 Number: 512

Today's topics:
    Re: Algorithms: Cluster analysis w/ Perl? (Abigail)
    Re: DBI nobull@mail.com
    Re: DBM Q! nobull@mail.com
    Re: DBM Q! <hernux@etherac.com.ar>
    Re: directory and moving files on unix nobull@mail.com
        Easy question <Waarddebon@chello.nl>
    Re: Easy question <uri@sysarch.com>
    Re: Easy question (Gwyn Judd)
    Re: Easy question nobull@mail.com
        help! trying to figure out how to open hash file for te (zorgby)
    Re: HTTP Client Question (Abigail)
    Re: IN dereferencing <ubl@schaffhausen.de>
    Re: many "used only once, possible typo" warnings in CG <webmaster@webdragon.munge.net>
        Parse::RecDescent: Matching rules in arbitrary input ? <scollyer@netspinner.dont-spam.co.uk>
    Re: Print own "die" message (Abigail)
    Re: Status: 403 Forbidden <flavell@mail.cern.ch>
    Re: Status: 403 Forbidden <pbm@NOSPAMiotp.demon.co.uk>
    Re: Status: 403 Forbidden nobull@mail.com
    Re: Status: 403 Forbidden nobull@mail.com
    Re: Status: 403 Forbidden (Martien Verbruggen)
    Re: Status: 403 Forbidden (Abigail)
    Re: Subroutine in separate files <dave@dave.org.uk>
    Re: The printout works, but how do i prevent blank inpu <kalle@tvettsvamp.a.se>
    Re: using variable content as constant name nobull@mail.com
        webmasters <cachureo@vtr.net>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: 17 Mar 2001 13:35:13 GMT
From: abigail@foad.org (Abigail)
Subject: Re: Algorithms: Cluster analysis w/ Perl?
Message-Id: <slrn9b6q0h.lt.abigail@tsathoggua.rlyeh.net>

wall (wall@chop.swmed.edu) wrote on MMDCCLIII September MCMXCIII in
<URL:news:3AB14D16.80CD1759@chop.swmed.edu>:
:) I appeal to your sense of mathmatics.  I have looked far and wide for
:) Perl algorithms to carry out cluster analysis (nearest neighbor,
:) centroid ...).  I must humble myself and admit defeat, but appeal to
:) higher minds.
:) 
:) Are there such routines available?

Not that I know of.

:) Can those with such programming skills give me advice?


I plan to discuss nearest neighbour as part of my tutorial on YAPC::NA.



Abigail
-- 
$_ = "\112\165\163\1648\141\156\157\164\150\145\1628\120\145"
   . "\162\1548\110\141\143\153\145\162\0128\177"  and &japh;
sub japh {print "@_" and return if pop; split /\d/ and &japh}


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

Date: 17 Mar 2001 10:58:05 +0000
From: nobull@mail.com
Subject: Re: DBI
Message-Id: <u9hf0s4q82.fsf@wcl-l.bham.ac.uk>

Ted Fiedler <tfiedler@zen.moldsandwich.com> writes:

> Subject: DBI

Question has nothing to do with DBI.

> why wont this work?

> Can't call method "id" on an undefined value at ./jinsert_DB.pl line 6.

Your code contains the following construct.

my($jbh)->id('auto_increment')

Since you have just created $jbh as a new undefined valaible you
can't call a method on it.

I don't know what you meant to do here as there's not sufficient
information in your code fragment to guess very accurately.

You probably meant something like:

(my $jbh = Some::Class->new)->id('auto_increment')

I'm curious - what class is Some::Class?  Is it one of your own or is
this some standard module I've not seen - it looks kinda intersting.

-- 
     \\   ( )
  .  _\\__[oo
 .__/  \\ /\@
 .  l___\\
  # ll  l\\
 ###LL  LL\\


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

Date: 17 Mar 2001 11:15:09 +0000
From: nobull@mail.com
Subject: Re: DBM Q!
Message-Id: <u9bsr04pfm.fsf@wcl-l.bham.ac.uk>

"Hernux" <hernux@etherac.com.ar> writes:

> Subject: DBM Q!
> Newsgroups: comp.lang.perl.misc

> is there a way to control a file lifetime in a dbm?

You really need to work on your ability to partition problems. 

Once the program has finished the database file is just a file.  You
can limit its lifetime by simply having a scheduled task that deletes
files over a certain age.  This has nothing to do with Perl or DBM.

-- 
     \\   ( )
  .  _\\__[oo
 .__/  \\ /\@
 .  l___\\
  # ll  l\\
 ###LL  LL\\


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

Date: Sat, 17 Mar 2001 09:44:10 -0300
From: "Hernux" <hernux@etherac.com.ar>
Subject: Re: DBM Q!
Message-Id: <98vmcr$8sv$1@taliesin.netcom.net.uk>

ok
thanx

<nobull@mail.com> escribió en el mensaje
news:u9bsr04pfm.fsf@wcl-l.bham.ac.uk...
> "Hernux" <hernux@etherac.com.ar> writes:
>
> > Subject: DBM Q!
> > Newsgroups: comp.lang.perl.misc
>
> > is there a way to control a file lifetime in a dbm?
>
> You really need to work on your ability to partition problems.
>
> Once the program has finished the database file is just a file.  You
> can limit its lifetime by simply having a scheduled task that deletes
> files over a certain age.  This has nothing to do with Perl or DBM.
>
> --
>      \\   ( )
>   .  _\\__[oo
>  .__/  \\ /\@
>  .  l___\\
>   # ll  l\\
>  ###LL  LL\\




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

Date: 17 Mar 2001 12:14:47 +0000
From: nobull@mail.com
Subject: Re: directory and moving files on unix
Message-Id: <u966h84mo8.fsf@wcl-l.bham.ac.uk>

"Milliwave" <milliwave@rfengineering.freeserve.co.uk> writes:

> I would like to know how to direct files by creating a directory in the
> current working directory, and
> moving the "files" into that directory?
> 
> open(File Handle1 "original.txt")
> open(File handle2 ">text.txt")
> 
> 1) Now how do I make a directory and move text.txt and original.txt into
> that directory

The mkdir() and rename() operating system calls are made avilable via
Perl built-in functions of the same name.  The syntax of this
functions is described in the relevant section of the perlfunc manual.

You can only use rename() to move files within a file system.  Since
you say you want to create the new directory within the CWD then this
is not going to be an issue.  To move between filesystems you would
have needed the File::Copy module.

> 2)Then I would like to delete the original.txt from the current working
> directory.

Since you said in (1) you wanted to _move_ not _copy_ the file to its
new location you can't delete it from its old location because it is
no longer there.

-- 
     \\   ( )
  .  _\\__[oo
 .__/  \\ /\@
 .  l___\\
  # ll  l\\
 ###LL  LL\\


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

Date: Sat, 17 Mar 2001 12:00:34 GMT
From: "Waarddebon" <Waarddebon@chello.nl>
Subject: Easy question
Message-Id: <ClIs6.2066734$%C1.27222524@Flipper>

Let's say I've got a variable which contains the value 15;
$x=15;

Now I want to display a sentence x time (x =the number in the variable $x)

Which lines do I need for this ?




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

Date: Sat, 17 Mar 2001 12:19:09 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Easy question
Message-Id: <x7itl8611e.fsf@home.sysarch.com>

>>>>> "W" == Waarddebon  <Waarddebon@chello.nl> writes:

  W> Let's say I've got a variable which contains the value 15;
  W> $x=15;

  W> Now I want to display a sentence x time (x =the number in the
  W> variable $x)

wow, another question which has its own answer. we have seen this often
with length and occasionally with a few other ops. but this one takes
the cake. please look up the exact operator you inadvertantly mentioned
in the above statement. it is what you want.

larry shows his genius with the names he picked for perl's ops.

uri

-- 
Uri Guttman  ---------  uri@sysarch.com  ----------  http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page  -----------  http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net  ----------  http://www.northernlight.com


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

Date: Sat, 17 Mar 2001 12:32:09 GMT
From: tjla@guvfybir.qlaqaf.bet (Gwyn Judd)
Subject: Re: Easy question
Message-Id: <slrn9b6ma8.nj2.tjla@thislove.dyndns.org>

I was shocked! How could Waarddebon <Waarddebon@chello.nl>
say such a terrible thing:
>Let's say I've got a variable which contains the value 15;
>$x=15;
>
>Now I want to display a sentence x time (x =the number in the variable $x)
>
>Which lines do I need for this ?

I'm not really sure what you are asking here. Do you mean, I want to
print the value of the variable $x? In that case you would do:

print "The value of \$x is $x";

Or do you want to print a string repeated $x times? In that case you
would use the 'x' operator.

print "Someone set up us the bomb" x $x; # multiple inanities

-- 
Gwyn Judd (print `echo 'tjla@guvfybir.qlaqaf.bet' | rot13`)
Be consistent.
             -- Larry Wall in the perl man page


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

Date: 17 Mar 2001 12:21:48 +0000
From: nobull@mail.com
Subject: Re: Easy question
Message-Id: <u93dcc4mcj.fsf@wcl-l.bham.ac.uk>

"Waarddebon" <Waarddebon@chello.nl> writes:

> Subject: Easy question

Lazy, sloppy subject line.

> Let's say I've got a variable which contains the value 15;
> $x=15;
> 
> Now I want to display a sentence x time (x =the number in the variable $x)

Your question is rather vague but you are probably looking for the
"for" loop-control construct or the "x" operator.

-- 
     \\   ( )
  .  _\\__[oo
 .__/  \\ /\@
 .  l___\\
  # ll  l\\
 ###LL  LL\\


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

Date: Sat, 17 Mar 2001 14:00:37 GMT
From: iwantnospam@please.com (zorgby)
Subject: help! trying to figure out how to open hash file for testing
Message-Id: <96Ks6.20170$DY.7082521@news1.mntp1.il.home.com>

I have a db_file that has gotten corrupted.

I'm trying to write a script to recover as much data as possible.  The main 
program uses a class file with $self and returns some of the data.  I'm trying 
to simply open the file and list what is in it, but I keep getting 
uninitialized errors on everything.

If I look at the file with a text editor, there -is- data.

What am I doing wrong?  And is there a way to see all values in a hash without 
using the key?

#!/usr/bin/perl -w
use strict;
use DB_File;

my $filename = "temp.db";
my %ports;

tie %ports, "DB_File", $filename
or die "Couldn't tie DB.\n"; # Scary complex hash contains the whole DB.

foreach (keys %ports) {
        my $sector = $_;
        #print "found sector $sector\t";        
        print "sector $sector = [" . $ports{$sector} . "]\t";   
}

print "\n" . %ports;


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

Date: 17 Mar 2001 13:31:36 GMT
From: abigail@foad.org (Abigail)
Subject: Re: HTTP Client Question
Message-Id: <slrn9b6ppo.lt.abigail@tsathoggua.rlyeh.net>

Albert Spohn (spohn@bigfoot.com) wrote on MMDCCLV September MCMXCIII in
<URL:news:MPG.151c93bc5401d2989681@news.chartermi.com>:
`` In article <Pine.LNX.4.30.0103170122440.14900-100000@lxplus003.cern.ch>, 
`` flavell@mail.cern.ch says...
`` > On Fri, 16 Mar 2001, Tad McClellan wrote:
`` ...
`` > 
`` > > Silently killfiling them for all time is *easier* than announcing it.
`` > 
`` > Right: I got sick of trying to protect them from their own ignorance,
`` > because of all the flak it caused.  Usenet has far too many posts to
`` > be able to read them all - one has to apply some kind of criteria or
`` > one would never get time for real life (tm).
`` > 
`` This is the best rationale for killfiling I've heard yet.  If you're no 
`` longer, or never were, in baby-sitting mode, then make the kill quietly 
`` and move on.  But there's no need for the public humiliation piece.


Not is there a need to waste post after post whining about it. On what
rationale is your public whine ok, and a public *plonk* not?

But I'm an equal opportunity plonker. I plonk Jeopardists, and whiners.

*plonk*


Abigail
-- 
$"=$,;*{;qq{@{[(A..Z)[qq[0020191411140003]=~m[..]g]]}}}=*_;
sub   _   {push         @_ => /::(.*)/s and goto &{ shift}}
sub shift {print shift; @_              and goto &{+shift}}
Hack ("Just", "Perl ", " ano", "er\n", "ther "); # 20010317


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

Date: Sat, 17 Mar 2001 13:38:03 +0100
From: Malte Ubl <ubl@schaffhausen.de>
Subject: Re: IN dereferencing
Message-Id: <3AB35AAB.257DD45B@schaffhausen.de>

nobull@mail.com schrieb:
> 
> Malte Ubl <ubl@schaffhausen.de> writes:
> 
> > I was wondering how bad the time panelty...
> 
> perldoc Benchmark

I know I can do benchmarking, but I was thinking about a rather
theoretical perspective like:

you do one more string comparisson that decreases execution speed by
factor x
and then you do an extra array copying which for large array will take
this much
longer than the direct dereferencing. I'm sorry if my question wasnt phrased
good enough.

bye...malte


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

Date: 17 Mar 2001 11:57:58 GMT
From: "Scott R. Godin" <webmaster@webdragon.munge.net>
Subject: Re: many "used only once, possible typo" warnings in CGI.pm using import_names("UT");
Message-Id: <98vjg6$57r$0@216.155.32.48>

In article <u9k85o4r4a.fsf@wcl-l.bham.ac.uk>, nobull@mail.com wrote:

 | A completely different approach is simply to declare the variables.
 | 
 | { 
 |   package UT;
 |   use vars qw( $mod_type $mod_description ); # And so on...
 | }

Hmm.. overall I'd have to say that other than ditching the import_names 
sub, this would probably be the best approach. 

I already have a use vars in the script with these exact same variables 
(plus a few more), so copying it under the UT package should be a snap.

-- 
unmunge e-mail here:
#!perl -w
print map {chr(ord($_)-3)} split //, "zhepdvwhuCzhegudjrq1qhw"; 
# ( damn spammers. *shakes fist* take a hint. =:P )


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

Date: Sat, 17 Mar 2001 13:15:22 -0000
From: "Stephen Collyer" <scollyer@netspinner.dont-spam.co.uk>
Subject: Parse::RecDescent: Matching rules in arbitrary input ?
Message-Id: <984835160.6629.0.nnrp-13.9e98901a@news.demon.co.uk>

I'm trying to write a grammar that will match a set of rules in
arbitrary data (which I want to ignore). For example, the following
grammar does this for the literals 'Fred' and 'Bill' :

my $dontcare = q{

    StuffInNoise: (DontCare Word)(s)

    Word: 'Fred' |
          'Bill'

    DontCare: /.*?(?=Fred|Bill)/

};

This matches 'dkksdeioeoiekFredlddldldldlBill' for example.

However, it has the problem that I have to duplicate 'Fred' and 'Bill'
in the DontCare rule. It also doesn't seem to extend to the case where
Word is an arbitrary rule that depends on other subrules.

I have tried to generalise the idea like this:

my $dontcare = q{

    StuffInNoise: (DontCare Word)(s)

    Word: 'Fred' |
          'Bill'

    DontCare: /.*?/ ...Word

};

but this doesn't work, as the lookahead ...Word does not interact with
the preceding regex in the same way that the lookahead (?=Fred|Bill)
does when it's all rolled up in a single regex, handled purely by
Perl's regex engine.

Does anyone have any ideas on how this can be done with Parse::RecDescent ?

Steve Collyer
Netspinner Ltd






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

Date: 17 Mar 2001 12:02:10 GMT
From: abigail@foad.org (Abigail)
Subject: Re: Print own "die" message
Message-Id: <slrn9b6ki2.hp.abigail@tsathoggua.rlyeh.net>

Chris Stith (mischief@velma.motion.net) wrote on MMDCCLIV September
MCMXCIII in <URL:news:tb4votcvurv68c@corp.supernews.com>:
\\ 
\\ I still think any actual syntax error should be fatal -- not
\\ immediately fatal in that the parser stopos parsing and finding
\\ other errors, but in that it shouldn't try to execute code that
\\ has syntax errors.


But that's not happening. If there are syntax errors that causes warnings,
at the end of the compile an exception is thrown anyway; it's the
"Execution of foo aborted due to compilation errors." message at the end.
That causes $SIG{__DIE__} to be called.


Abigail
-- 
perl  -e '$_ = q *4a75737420616e6f74686572205065726c204861636b65720a*;
          for ($*=******;$**=******;$**=******) {$**=*******s*..*qq}
          print chr 0x$& and q
          qq}*excess********}'


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

Date: Sat, 17 Mar 2001 12:09:45 +0100
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: Status: 403 Forbidden
Message-Id: <Pine.LNX.4.30.0103171201200.10551-100000@lxplus003.cern.ch>

On Sat, 17 Mar 2001, In off the Post wrote:

> I need to send a 403 HTTP header,

Could it be that you desire to send a 403 response from a CGI
script, i.e a CGI header?

This would be a proper question for comp.infosystems.www.authoring.cgi,
as a little perusal of c.l.p.misc would surely reveal.

> which will then be handled by an
> Apache ErrorDocument (which works) which will re-direct the user to a
> specified page.

So it won't be a 403 HTTP header.  Or will it?  Perhaps we'd get
further if you'd tell us.

> Why doesn't this perl script work?
>
> print "Status: 403 Forbidden\n\n";

The script works just fine - there's nothing wring with the Perl.
As a parsed-headers CGI script, I don't see a problem with it either.

So the problem lies elsewhere.  If it isn't a problem with your use of
the CGI interface, then maybe there's something wrong with your server
configuration.  Neither of which are Perl language questions.

Do you realise just how maddening it is to read 'doesn't work' as a
problem description?  "Doctor, I'm not well.  What medicine do you
recommend?".

Check the related FAQs about debugging techniques for CGI scripts.
Follow them until you get stuck.  Then describe what  you did and what
the symptoms were.  This way, we'll all make faster progress.

ttfn



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

Date: Sat, 17 Mar 2001 11:38:22 +0000
From: In off the Post <pbm@NOSPAMiotp.demon.co.uk>
Subject: Re: Status: 403 Forbidden
Message-Id: <fApVEZAuy0s6EwyI@iotp.demon.co.uk>

In article <Pine.LNX.4.30.0103171201200.10551-100000@lxplus003.cern.ch>,
Alan J. Flavell <flavell@mail.cern.ch> writes
>On Sat, 17 Mar 2001, In off the Post wrote:
>
>> I need to send a 403 HTTP header,
>
>Could it be that you desire to send a 403 response from a CGI
>script, i.e a CGI header?
>
>This would be a proper question for comp.infosystems.www.authoring.cgi,
>as a little perusal of c.l.p.misc would surely reveal.
>
>> which will then be handled by an
>> Apache ErrorDocument (which works) which will re-direct the user to a
>> specified page.
>
>So it won't be a 403 HTTP header.  Or will it?  Perhaps we'd get
>further if you'd tell us.
>
>> Why doesn't this perl script work?
>>
>> print "Status: 403 Forbidden\n\n";
>
>The script works just fine - there's nothing wring with the Perl.
>As a parsed-headers CGI script, I don't see a problem with it either.
>
>So the problem lies elsewhere.  If it isn't a problem with your use of
>the CGI interface, then maybe there's something wrong with your server
>configuration.  Neither of which are Perl language questions.
>
>Do you realise just how maddening it is to read 'doesn't work' as a
>problem description?  "Doctor, I'm not well.  What medicine do you
>recommend?".
>
>Check the related FAQs about debugging techniques for CGI scripts.
>Follow them until you get stuck.  Then describe what  you did and what
>the symptoms were.  This way, we'll all make faster progress.
>
>ttfn
>

Alan,
        You pedantic fool! If you took as much time answering a question
as you did on technical nit-picking then you may be of some help. People
like you make me sick! It's a one-line PERL program which is supposed to
give a 403 response, which should then return the specified
ErrorDocument, it doesn't, it's as simply as that! The ErrorDocument
works so it's not that, the web browser is simply blank. Does you get a
403 Forbidden page when you test it?

I'm more than capable to debug a CGI script! If you're still feeling
unwell I suggest you return to your doctor as the medicine definitely
isn't working. You surely need some help, as you have absolutely no
social skills. I've posted to the newsgroup you suggest and no doubt
I'll receive another similarly inane geek-like response.

I would have posted to a specific newsgroup concerning Perl CGI scripts
running on an Apache server attempting to send a 403 HTTP server
response code but unfortunately one doesn't exist.

Thanks for nothing,
Peter
-- 
 In off the Post, PO Box 442, NOTTINGHAM, NG1 1PE. ENGLAND
 Phone: +44 (0) 115 941 5132     Fax: +44 (0) 115 941 1634
 e-mail: pbm@iotp.co.uk              http://www.iotp.co.uk


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

Date: 17 Mar 2001 12:06:09 +0000
From: nobull@mail.com
Subject: Re: Status: 403 Forbidden
Message-Id: <u98zm44n2m.fsf@wcl-l.bham.ac.uk>

In off the Post <pbm@NOSPAMiotp.demon.co.uk> writes:

> I need to send a 403 HTTP header, which will then be handled by an
> Apache ErrorDocument (which works) which will re-direct the user to a
> specified page.
> 
> Why doesn't this perl script work?
> 
> print "Status: 403 Forbidden\n\n";

For exactly the same reason that the same script implemented in C,
Java, Pascal, FORTRAN, Basic, Bourne-shell or whatever would not work.

Your question has nothing to do with Perl. Your question is a
CGI/Apache question.

I am inclined to regard the fact that it doesn't work as a misfeature
of Apache.  The CGI spec does not say so explicitly but if a CGI
script returns a 4xx status and no Content-type or body then IMNSHO
the HTTP server should provide a standard message body or invoke the
specified error document for that status.

But like I said this has nothing whatever to do with Perl.

Have you considered making the guts of the ErrorDocument handler into
a module that you can use from both the ErrorDocument script and this
script?

If you want Perl programs that hook into earlier stages of the HTTP
request processing chain in Apache then I suggest you look into
mod_perl.

-- 
     \\   ( )
  .  _\\__[oo
 .__/  \\ /\@
 .  l___\\
  # ll  l\\
 ###LL  LL\\


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

Date: 17 Mar 2001 12:33:28 +0000
From: nobull@mail.com
Subject: Re: Status: 403 Forbidden
Message-Id: <u9zoek378n.fsf@wcl-l.bham.ac.uk>

In off the Post <pbm@NOSPAMiotp.demon.co.uk> writes:

> I would have posted to a specific newsgroup concerning Perl CGI scripts
> running on an Apache server attempting to send a 403 HTTP server
> response code but unfortunately one doesn't exist.

The point is you should, therefore, apply some thought to which
elements are relevant to the essense of your questions and which are
incidental.  CGI and Apache are relevant to the essense of your
question, Perl is incidental.

Frankly, if your problem-partitioning (aka analysis) skills are so poor
that you can't understand that even when it has been pointed out to
you then you probably just do not have the right sort of mind for
programming.  You certainly don't have the right sort of mind to get
along in comp.lang.*.

-- 
     \\   ( )
  .  _\\__[oo
 .__/  \\ /\@
 .  l___\\
  # ll  l\\
 ###LL  LL\\


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

Date: Sat, 17 Mar 2001 23:45:27 +1100
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: Status: 403 Forbidden
Message-Id: <slrn9b6n37.i70.mgjv@martien.heliotrope.home>

On Sat, 17 Mar 2001 11:38:22 +0000,
	In off the Post <pbm@NOSPAMiotp.demon.co.uk> wrote:
> In article <Pine.LNX.4.30.0103171201200.10551-100000@lxplus003.cern.ch>,
> Alan J. Flavell <flavell@mail.cern.ch> writes
>>On Sat, 17 Mar 2001, In off the Post wrote:
>>
>>> I need to send a 403 HTTP header,
>>
[snip lengthy post from Alan]

> Alan,
>         You pedantic fool! If you took as much time answering a question

You're right. Alan should have just told you to go to the right group
(which he did) and left it at that.

You, however, with this attitude, should just FOAD.

*plonk*

> Thanks for nothing,

I suspect that you'll find that next time you really have a question
about Perl, that you might not get the quality of answer you would get
if you hadn't done this.

Martien
-- 
Martien Verbruggen              | 
Interactive Media Division      | Freudian slip: when you say one thing
Commercial Dynamics Pty. Ltd.   | but mean your mother.
NSW, Australia                  | 


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

Date: 17 Mar 2001 13:33:35 GMT
From: abigail@foad.org (Abigail)
Subject: Re: Status: 403 Forbidden
Message-Id: <slrn9b6ptf.lt.abigail@tsathoggua.rlyeh.net>

In off the Post (pbm@NOSPAMiotp.demon.co.uk) wrote on MMDCCLV September
MCMXCIII in <URL:news:fApVEZAuy0s6EwyI@iotp.demon.co.uk>:
%% 
%% Alan,
%%         You pedantic fool!


*plonk*



Abigail


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

Date: Sat, 17 Mar 2001 13:49:20 +0000
From: Dave Cross <dave@dave.org.uk>
Subject: Re: Subroutine in separate files
Message-Id: <9fq6bt444380n09fukkbm72l74qhe52dk8@4ax.com>

On Fri, 16 Mar 2001 15:52:57 -0700, "Dave Stang"
<mustang@astekcorp.com> wrote:

>I have a rather large perl script that I have broken into several
>subroutines.  For manageability, I would like to keep the subroutines in
>separate files.
>
>Is there a way to do this without re-making perl?  Are there any example to
>copy from?

The _best_ way would be to make a module that you can use in your
scripts with a 'use MyModule;' line. This would be made even easier if
you used the Exporter module to export the subroutine names into your
script's namespace. This is all explained (with examples) in the
perlmod manual page.

A simpler (tho' less flexible) would be to simply 'require' the files
containing the subroutines into your script files.

Note that any advice regarding the use of LWP as a solution to your
problem is so completely off-track that anyone giving that advice
should be laughed out of the newsgroup.

hth,

Dave...

-- 
<http://www.dave.org.uk>  SMS: sms@dave.org.uk
<http://www.manning.com/cross/>


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

Date: Sat, 17 Mar 2001 12:22:02 GMT
From: "Kalle Anka" <kalle@tvettsvamp.a.se>
Subject: Re: The printout works, but how do i prevent blank inputs?
Message-Id: <KFIs6.242$sk3.84975@newsb.telia.net>

No more blank inputs.
Thank you!

I changed the string:
$line = $_, last if /^\Q$email/o;

to

$line = $_, last if /^\Q$email$/ ;

but now the answer is allways "NO"




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

Date: 17 Mar 2001 11:08:02 +0000
From: nobull@mail.com
Subject: Re: using variable content as constant name
Message-Id: <u9elvw4prh.fsf@wcl-l.bham.ac.uk>

Ralf Heydenreich <rheydenr@htwm.de> writes:

> use constant FOO => 2;
> @data=qw/abc def efg hij/;
> $bar="FOO";
> print "The value is: ", $data[ $$bar ];
> 
> This should result to "The value is efg", but it don't do this! How can
> I fix this problem?

$$bar is the syntax for dereferencing a scalar reference.  But FOO is a
function not a scalar.  The syntax for dereferencing a function
reference is &$bar (or $bar->()).

Of course $bar in the the above examle is a _symbolic_ reference and
symbolic references are evil.  You should probably use some other
mechanism.  Without knowing more about your application it's hard to
know what to recommend but the usual choice is a between hard
reference or a hash.

-- 
     \\   ( )
  .  _\\__[oo
 .__/  \\ /\@
 .  l___\\
  # ll  l\\
 ###LL  LL\\


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

Date: Sat, 17 Mar 2001 09:43:13 -0600
From: "ro" <cachureo@vtr.net>
Subject: webmasters
Message-Id: <30Ks6.7355$S31.4838@clnews00.chello.cl>

This is a multi-part message in MIME format.

------=_NextPart_000_039E_01C0AEC6.AF226B40
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Untitled Document=20
       =20


------=_NextPart_000_039E_01C0AEC6.AF226B40
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>Untitled Document</TITLE>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 5.50.4134.600" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#000000>
<DIV align=3Dcenter>
<TABLE cellSpacing=3D0 width=3D"90%" border=3D0>
  <TBODY>
  <TR bgColor=3D#000000>
    <TD>
      <DIV align=3Dleft>
      <OBJECT id=3Dnews=20
      =
codeBase=3Dhttp://active.macromedia.com/flash2/cabs/swflash.cab#version=3D=
4,0,0,0=20
      classid=3Dclsid:D27CDB6E-AE6D-11cf-96B8-444553540000 width=3D200 =
height=3D50><PARAM NAME=3D"_cx" VALUE=3D"5292"><PARAM NAME=3D"_cy" =
VALUE=3D"1323"><PARAM NAME=3D"Movie" =
VALUE=3D"http://ignaciodiseno.cl/news3.swf"><PARAM NAME=3D"Src" =
VALUE=3D"http://ignaciodiseno.cl/news3.swf"><PARAM NAME=3D"WMode" =
VALUE=3D"Window"><PARAM NAME=3D"Play" VALUE=3D"-1"><PARAM NAME=3D"Loop" =
VALUE=3D"-1"><PARAM NAME=3D"Quality" VALUE=3D"High"><PARAM =
NAME=3D"SAlign" VALUE=3D""><PARAM NAME=3D"Menu" VALUE=3D"-1"><PARAM =
NAME=3D"Base" VALUE=3D""><PARAM NAME=3D"Scale" VALUE=3D"ShowAll"><PARAM =
NAME=3D"DeviceFont" VALUE=3D"0"><PARAM NAME=3D"EmbedMovie" =
VALUE=3D"0"><PARAM NAME=3D"BGColor" VALUE=3D"FFFBF0"><PARAM =
NAME=3D"SWRemote" VALUE=3D""><PARAM NAME=3D"Stacking" VALUE=3D"below">
                                                      <embed=20
      src=3D"http://ignaciodiseno.cl/news3.swf" quality=3Dhigh =
bgcolor=3D#FFFBF0
      		width=3D200 height=3D50 type=3D"application/x-shockwave-flash"
      		=
pluginspage=3D"http://www.macromedia.com/shockwave/download/index.cgi?P1_=
Prod_Version=3DShockwaveFlash">=20
                 </embed>           </OBJECT></DIV></TD></TR>
  <TR>
    <TD>&nbsp;</TD></TR></TBODY></TABLE></DIV></BODY></HTML>

------=_NextPart_000_039E_01C0AEC6.AF226B40--



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

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

| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.

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.

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 V10 Issue 512
**************************************


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