[18342] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 510 Volume: 10

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

Date: Fri, 16 Mar 2001 21: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: <984805509-v10-i510@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Fri, 16 Mar 2001     Volume: 10 Number: 510

Today's topics:
    Re: -w and use strict; (Tad McClellan)
    Re: Data Dumper modules come standard?? <webmaster@webdragon.munge.net>
    Re: Didn't work. <bmb@ginger.libs.uga.edu>
    Re: Distributive -> and indirect slices <david@freemm.org>
        Firewall in Perl <jdb@wcoil.com>
    Re: Firewall in Perl (Logan Shaw)
    Re: how can I restart a regex within a substitution wit <rick.delaney@home.com>
    Re: HTTP Client Question <spohn@bigfoot.com>
    Re: HTTP Client Question <spohn@bigfoot.com>
    Re: HTTP Client Question <godzilla@stomp.stomp.tokyo>
    Re: HTTP Client Question (Tad McClellan)
    Re: need a sub print_with_newline(), but what to do wit <ben.sugars@home.com>
    Re: OT <godzilla@stomp.stomp.tokyo>
    Re: Print own "die" message <rick.delaney@home.com>
    Re: problem installing DBD::mysql <mathias@koerber.org>
    Re: Subroutine in separate files <uri@sysarch.com>
    Re: Subroutine in separate files <godzilla@stomp.stomp.tokyo>
    Re: Subroutine in separate files <ben.sugars@home.com>
    Re: Subroutine in separate files <tanstaafly@yahoo.com>
    Re: Subroutine in separate files <godzilla@stomp.stomp.tokyo>
    Re: Subroutine in separate files <uri@sysarch.com>
    Re: Subroutine in separate files <tanstaafly@yahoo.com>
    Re: Subroutine in separate files <godzilla@stomp.stomp.tokyo>
    Re: ZPT, a next-generation template technology (Martien Verbruggen)
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Fri, 16 Mar 2001 21:37:02 -0500
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: -w and use strict;
Message-Id: <slrn9b5jee.abb.tadmc@tadmc26.august.net>

Brad Baxter <bmb@ginger.libs.uga.edu> wrote:
>On Fri, 16 Mar 2001, Tad McClellan wrote:
>> 
>> Me, quoting "me", as portrayed by Bernard:
>> 
>>    "Don't forget to enable warnings and strictures even when 
>>     you're not writing in Perl. It's *that* important."
>
>LOL.  When your not writing in Perl, that's known as diplomacy.


When _I'm_ not writing in Perl it's known as "sleeping" or "eating".

Both of which, I'm ashamed to admit, I like even better than 
programming in Perl  :-(


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: 17 Mar 2001 03:01:56 GMT
From: "Scott R. Godin" <webmaster@webdragon.munge.net>
Subject: Re: Data Dumper modules come standard??
Message-Id: <98uk34$6p7$0@216.155.32.136>

In article <tb0hkqi3oq3g5e@corp.supernews.com>, "kellyboy" 
<kellyboy@nospanner> wrote:

 | Since I've not fully achieved the status of "Perl Guru" yet, I have 
 | this question...
 | 
 | I was reading the README about DataDumper.pm for any compile notes. 
 | It says "Data-Dumper comes standard with perl from version 
 | 5.004_71."
 | 
 | I'm using Perl 5.6.0.
 | 
 | So that mean I dont have to compile the Data-Dumper module??


Data::Dumper should be standard. you can test with this

    #!perl -w
    use Data::Dumper;

or from the command line

    > perl -MData::Dumper -e1

and if it tosses an error, the result is obvious.

you can also check version info and possibly update to newer versions in 
the future (in addition to installing modules that you don't have 
around)  with the CPAN shell 

    > perl -MCPAN -e shell 
or

    #!perl -w
    use CPAN;
    shell();

where you can then do:

    cpan> i Data::Dumper

and get 

CPAN: Storable loaded ok
Going to read Primus 8.5GB:Applications:MacPerl Ÿ:.cpan:Metadata
Module id = Data::Dumper
    DESCRIPTION  Convert data structure into perl code
    CPAN_USERID  GSAR (Gurusamy Sarathy <gsar@ActiveState.com>)
    CPAN_VERSION 2.101
    CPAN_FILE    G/GS/GSAR/Data-Dumper-2.101.tar.gz
    DSLI_STATUS  RdpO (released,developer,perl,object-oriented)
    MANPAGE      Data::Dumper - stringified perl data structures, 
suitable for both printing and C<eval>
    INST_FILE    Primus 8.5GB:Applications:MacPerl 
Ÿ:site_perl:Data:Dumper.pm
    INST_VERSION 2.101

though you should be up to date.

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


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

Date: Fri, 16 Mar 2001 21:06:07 -0500
From: Brad Baxter <bmb@ginger.libs.uga.edu>
Subject: Re: Didn't work.
Message-Id: <Pine.A41.4.21.0103162042060.9068-100000@ginger.libs.uga.edu>

On Fri, 16 Mar 2001, Jim Kroger wrote:
> I changed 
> 
> chomp(@subjects = `cat subNames`);
> foreach (@subjects) {
>    chomp($_);
>    }
> 
> to 
> 
> chomp(@subjects = `cat subNames`);
> foreach (@subjects) {
>    s/^\s+//;
>    s/\s+$//;
>    }
> 
> But the tab character at the end of each subject item is still there.
> Sorry if I'm misunderstanding. 

Your code works fine for me:

     1  #!/usr/local/bin/perl
     2  use warnings;
     3  use strict;
     4
     5  open OUT, ">subNames" or die $!;
     6  foreach ( 1..10 ) { print OUT "\t$_\t\n" }
     7  close OUT;
     8
     9  my @subjects;
    10
    11  chomp(@subjects = `cat subNames`);
    12  foreach (@subjects) {
    13     s/^\s+//;
    14     s/\s+$//;
    15     }
    16
    17  print @subjects;

Output: 12345678910

No tabs.  However \s matches \n, so in this case you don't need chomp:

     1  #!/usr/local/bin/perl
     2  use warnings;
     3  use strict;
     4
     5  my @subjects = `cat subNames`;
     6  foreach (@subjects) {
     7     s/^\s+//;
     8     s/\s+$//;
     9     }
    10
    11  print @subjects;

Output: 12345678910

Brad



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

Date: Sat, 17 Mar 2001 04:07:16 GMT
From: "David M. Lloyd" <david@freemm.org>
Subject: Re: Distributive -> and indirect slices
Message-Id: <Pine.LNX.4.21.0103162157480.888-100000@homebody.freemm.org>

On Fri, 16 Mar 2001, Dan Sugalski wrote:

> > I have an idea that I'm going to try to put into my Perl, but I want some
> > 'professional' opinions on it first.
> 
> The changes to the parser and tokenizer for this will probably
> be non-trivial, especially when you have to take all the cases
> into consideration. (What do you do when the list on the left
> has some hash references and some objects and some array
> references and some sub references, for example?)

I have actually given a great deal of thought to it, and I think I have a
pretty solid idea of the rules and restrictions I would put on it... a lot
of it would be common sense; for instance, in the current implementation
the -> 'knows' what the left side should be based on whether the right
side is a {hash-deref}, an [array-deref], or a (function-deref), or just a
word indicating a method.  Therefore based on the same information one
should be able to enforce that on a list.

There are actually a few more issues, and I'm going over them even now,
but the more I look at it, the more I think that it is very doable, and
I think I'll take a crack at it just to see if I can do it. :-)

> > Is this worth investigating?  Is there any chance that such behaviour
> > would ever be integrated into Perl 5?  What about Perl 6?
> 
> No, and yes if Larry's OK with it, respectively.

No and yes to which two of the three questions? ;-)

> Try it, and if you get it working on perl 5, do please come on
> over to the perl 6 internals list--I could use those skills.

OK, I've never poked into someone *else's* parser before but I'll let you
know how it goes. :-)

- D

<david@freemm.org>



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

Date: 17 Mar 2001 02:34:34 GMT
From: "Josiah Bryan" <jdb@wcoil.com>
Subject: Firewall in Perl
Message-Id: <98uifq$jl0$0@206.230.71.63>

greeets perlfolk,

im curious - does anyone have any good pointers at writing firewalls in
perl? or even how to do a software implementation of a firewall? ive looked
up "firewall theory" as wall as many variations in various search engines,
and none seem to have any help. Can anyone point me to a resource or give me
a general clue as to how i might write a firewall in perl? why would i want
to? because i can!!!! :-) because perl is so good at everything else, and
because i LOVE perl - i want to try to do my firewalls in perl as well! any
help on this would be greatly appreciated! thanks all!

~ Josiah




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

Date: 16 Mar 2001 21:05:46 -0600
From: logan@cs.utexas.edu (Logan Shaw)
Subject: Re: Firewall in Perl
Message-Id: <98ukaa$1le$1@boomer.cs.utexas.edu>

In article <98uifq$jl0$0@206.230.71.63>, Josiah Bryan <jdb@wcoil.com> wrote:
>im curious - does anyone have any good pointers at writing firewalls in
>perl? or even how to do a software implementation of a firewall? ive looked
>up "firewall theory" as wall as many variations in various search engines,
>and none seem to have any help.

Firewall software normally runs as part of the OS's kernel.  This is
because it must deal with the network traffic at a very low level.

Most kernels do not have a provision for running Perl code.

Also, firewalls need to be fast, and while Perl isn't terribly slow, it
isn't that fast either.

If you really want to write a firewall in Perl, I'd say the best
approach would be to use a microkernel-based system, so that you
can make the firewall a service that runs in user space instead of
kernel space.  Then, it might be feasible to write it in Perl.

  - Logan
-- 
whose?  my  your   his  her   our   their   _its_
who's?  I'm you're he's she's we're they're _it's_


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

Date: Sat, 17 Mar 2001 02:05:39 GMT
From: Rick Delaney <rick.delaney@home.com>
Subject: Re: how can I restart a regex within a substitution without leaving the  /g loop?
Message-Id: <3AB2C9B4.69EABF12@home.com>

[posted & mailed]

info@java.seite.net wrote:
> 
> i want to change the starting regex of a looped substition within the
> substitution. here's a code snippet which shows what i mean...
> 
> $x="aa..b..a..b...a..a...a.#..b..a..b..b..b..a..a..b.";
> $c="a|#";
> 
> $x=~ s/($c)/if($1 eq "#") { $c="b|#"; } else { "*"
> }/ge;
> 
> ..which "should" change $x in...
> 
> **..b..*..b...*..*...*.#..*..a..*..*..*..a..a..*.
> 
> ..but of course & unfortunately doesn't work, because the variable $c is
> only
> checked once at the beginning.
> 
> is there a command which tells the regex to "recompile" the regex?

Yes, look for "postponed" regular expression in perlre.

  $x=~ s/((??{"$c"}))/$1 eq "#" ? ($c="b|#", "#") : "*"/ge;

Note that you want the replacement to be "#" when you assign $c="b|#",
so you can't just return the assignment as you have above.

Also, you need the quotes around $c in (??{"$c"}) or you will still only
get "a"s replaced.  I'm not sure why but I guess it is probably similar
to why

    $x = 1;
    @a = ($x, $x = 2);
    print "@a";

prints "2 2" but

    $x = 1;
    @a = ("$x", $x = 2);
    print "@a";

prints "1 2".

-- 
Rick Delaney
rick.delaney@home.com


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

Date: Fri, 16 Mar 2001 21:16:17 -0600
From: Albert Spohn <spohn@bigfoot.com>
Subject: Re: HTTP Client Question
Message-Id: <MPG.151c92fd25b415e7989680@news.chartermi.com>

In article <slrn9b55s8.9k1.tadmc@tadmc26.august.net>, 
tadmc@augustmail.com says...
> Al Spohn <spohn@bigfoot.com> wrote:
> >In article <98tkfi$g66$1@mamenchi.zrz.TU-Berlin.DE>, 
> >anno4000@lublin.zrz.tu-berlin.de says...
> >> According to Bob Dilworth <avast@hortonsbay.com>:
> >> > On 15 Mar 2001 15:38:51 GMT, anno4000@lublin.zrz.tu-berlin.de (Anno
> ><stuff snipped)
> >> > Publicly "plonking" them for "jeopardy" posting serves no purpose
> >> > other than, in my view, arrogance.
> 
> 
> Whether you like it or not, people DO get plonked for Jeopardy quoting.
> 
> Silently killfiling them for all time is *easier* than announcing it.
> 
> Way over half of my killfilings are silent.
> 
> Announcing it is letting folks know that it happens, so that they
> can _decide_ if they want to risk being ignored or not.
Why not give them the scoop, e.g., refer them to an FAQ, whatever if the 
point is to change their behavior? How many more characters would that 
really involve if you're going to bother with the reply button to 
administer your *plonk* anyway?  And if you don't feel obliged to do this 
(understandable enough) then the silent axe is always an option.  I just 
don't buy that if you're going to bother with corrective action that 
it has to be humiliating.
> 
> >> > intolerant.  Why waste all that energy on public humiliation when you
> >> > can simply ignore the posting?
> 
> 
> Some people say something when they see you walking around with
> toilet paper stuck to your shoe, some do not say anything.
> 
> Which is nicer?
> 
Great analogy :-). For me a public *plonk* is more like walking up to the 
person and wrapping him/her in a big plastic garbage bag and walking away 
holding your nose as opposed to pulling them aside and talking to them... 
bearing in mind that a realistic analogy in this case might involve 
something like "Listen, see that stuff?  It's called toilet paper... 
etc."
> 
> >> Because it damages the thread it appears in.  Posting style is
> >> *not* a matter of personal preference.
> >
> >In my case it was admittedly a case of carelessness that resulted in my 
> >jeopardy posting, i.e., I was using a client at the moment for which that 
> >was the default, and I didn't happen to notice in time.  But I have to 
> >confess to having believed that it *was* merely a preference thing 
> >(certainly from a readability standpoint the argument could be made 
> >either way, but I'm happy to comply with whatever standard...).  
> 
> 
> From a purely pragmatic point of view, folks that expect to have lots
> of Perl questions should probably do what it takes to avoid 
> "going invisible", so as to not hurt their chances of getting
> help forevermore.
> 
True enough, and I believe the desire to be a good citizen should extend 
even beyond the pragmatic rationale.  But my concern is for the unitiated 
stumbling into the group and not knowing what happened when they face a 
public zero tolerance policy.  I get the feeling the old timers tend to 
believe that the impulse to read an FAQ is somehow genetic and that one 
can't possibly make it as far as the newsgroup or Perl, for that matter, 
without having been heavily cautioned as to group etiquette along the 
way.  I maintain that coming in absolutely cold is a very real 
possibility, thus leaving the hapless perpetrator genuinely and 
justifiably perplexed when he/she gets the cold shoulder based on nothing 
more than the fact that MS Outlook happens to be their newsreader (built 
in jeopardy compliance.)

For those folks burnt out on trying to take newbies by the hand, I see 
nothing wrong with a silent killing since that's their perrogative and 
they shouldn't be expected to spend 2/3 of their time babysitting.  But 
for people who really want to effect change as opposed to doing a little 
usenet muscle flexing for a cheap thrill, I don't believe the public 
*plonk* is a justifiable option.


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

Date: Fri, 16 Mar 2001 21:19:28 -0600
From: Albert Spohn <spohn@bigfoot.com>
Subject: Re: HTTP Client Question
Message-Id: <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.


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

Date: Fri, 16 Mar 2001 19:31:27 -0800
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: HTTP Client Question
Message-Id: <3AB2DA8F.FC5F21FB@stomp.stomp.tokyo>


Various boys ranted and raved like blithering idiots:

(obviously snipped)

Ya know, if you anal retentive boys keep whipping
this long dead horse, it is likely to jump up and
win a Triple Crown.

Godzilla!


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

Date: Fri, 16 Mar 2001 21:45:37 -0500
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: HTTP Client Question
Message-Id: <slrn9b5juh.abb.tadmc@tadmc26.august.net>

Alan J. Flavell <flavell@mail.cern.ch> wrote:

>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).
                              ^^^^^^^^^

I already know I gotta get one of those. I've heard a lot about them.

No need to emphasize it with my initials like that.

:-)


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: Sat, 17 Mar 2001 04:19:03 GMT
From: Benjamin Sugars <ben.sugars@home.com>
Subject: Re: need a sub print_with_newline(), but what to do with print_with_newline STDERR "blabla"; ???????
Message-Id: <Pine.LNX.4.21.0103162316200.30778-100000@localhost.localdomain>

On Fri, 16 Mar 2001, Murat Uenalan wrote:

> I simply want to write a print function which automatically prints an
> appending \n character, and should be a alternativ to normal print ! It
> seems very simple, but it is not !

Take a look in the perlvar manpage for the documentation on the $\
variable.

Cheers,
-Ben

-- 
Benjamin Sugars <ben.sugars@home.com>



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

Date: Fri, 16 Mar 2001 19:48:56 -0800
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: OT
Message-Id: <3AB2DEA8.243742B4@stomp.stomp.tokyo>

Petri Oksanen, undoubtedly a masked fictitious character, wrote:
 
> Uri, suffering verbal diarrhea spewed:
> > Kalle Anka aka Lou aka Jimmy Hoffa aka D. B. Cooper aka et al, drooled:

> > > > Godzilla! Do you please your ego by insulting people.

(Godzilla! being realistic, wrote:)

> > > I do as I please.
 
> > who came up with kalle? is her address and poor english such
> > so obviously forged?
 
> Check out:
> http://www.disney.se/kalleanka/
 
> Quack-quack...


More fitting and a fabulous subtle pun:

http://kulturkonsult.no/donald/images/tenkeboksen.jpg


Godzilla!


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

Date: Sat, 17 Mar 2001 03:26:45 GMT
From: Rick Delaney <rick.delaney@home.com>
Subject: Re: Print own "die" message
Message-Id: <3AB2DCB5.96B23377@home.com>

Chris Stith wrote:
> 
> > I guess some syntax error are fatal enough to have it give up.
> 
> 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.

That is what happens.  Some fatal compile errors are queued so that you
can see more than the first one.  These should all be trappable into $@
from eval or into $SIG{__DIE__} handlers.  They are not--at least not
anymore--implemented as warnings.

If the __DIE__ handler isn't called for syntax errors from inside an
eval but is when they're not in an eval then it is probably a bug.  But
the fact that __DIE__ handlers are called from inside eval at all is
usually just a nuisance.

-- 
Rick Delaney
rick.delaney@home.com


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

Date: Fri, 16 Mar 2001 10:58:50 +0800
From: Mathias Koerber <mathias@koerber.org>
Subject: Re: problem installing DBD::mysql
Message-Id: <ga03bt8dnibj3ek2hs912m888ipu0h0vjc@4ax.com>


>->	t/00base............install_driver(mysql) failed: Can't load 
>->		'../blib/arch/auto/DBD/mysql/mysql.so' for module 
>->		DBD::mysql: File not found at 
>->		/usr/local/lib/perl5/5.6.0/i586-linux/DynaLoader.pm 
>		line 200.


I found it. The problem was not mysql.so, but libmysqlclient.so.10,
which for some reason DBD::mysql only looked for in /usr/lib, but
which ws installed only in /usr/local/mysql/lib/mysql.

DOes anyone know
	a) why the default installation (from source .tgz) of MySQL
	   does not install it in /usr/lib
or	b) DBD::mysql looks for this library in /usr/lib when it by 
	   default gets installed under /usr/local/mysql/...

? Any help is appreciated.

Mathias


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

Date: Sat, 17 Mar 2001 03:50:44 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Subroutine in separate files
Message-Id: <x7y9u55a0b.fsf@home.sysarch.com>

>>>>> "G" == Godzilla!  <godzilla@stomp.stomp.tokyo> writes:

  G> Dave Stang wrote:
  G> (snippage)

  >> 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?

  G> There is a very efficient way to accomplish this. Use
  G> of LWP simple is a very viable alternative. Using this
  G> module is especially nice if your subroutines are not
  G> needed at times. This allows a shorter more efficient
  G> master script which calls remote scripts as needed.

you are bonkers. more than the usual moronzilla bonkers. WHERE does he
say his scripts are remote on web servers. WHERE does he mention ANYTHING
about the WEB? 

  G> Research and learn about this LWP module. You can use
  G> it to run and return results from a remote script,
  G> within your master script.

you think using LWP is more efficient and easier than require or use?

print '*BOGGLE*' x 10e20 ;

  G> However there is a note of caution. If your subroutines
  G> are called everytime your master script is run, you would
  G> do better to leave those subroutines in your script, as is.
  G> Regardless of what method you employ to call remote scripts,
  G> subroutines in your case, there will be inherent time lag.

you have no clue how to modularize a large script. in fact seeing you
promote use of a module is so amazingly bizarre coming from you, that it
only makes sense because your suggestion is so wrong. 

to the OP:

just keep a copy of this crap around so the next time you see moronzilla
posting, you will know to kill it before you read it.

i just have to laugh some more. this was one of the most ludicrous
answers you hve ever posted and that says a lot. using a WEB mechanism
to load local perl modules. wow. why not take a trip to the grocery
store but drive across the country and back along the way.

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: Fri, 16 Mar 2001 20:03:50 -0800
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: Subroutine in separate files
Message-Id: <3AB2E226.4A968A2E@stomp.stomp.tokyo>

Uri Guttman wrote:
 
> Godzilla! wrote:
 
> > Dave Stang wrote:

(significant snippage)
 
> you are bonkers. more than the usual moronzilla bonkers.
> WHERE does he say his scripts are remote on web servers.
> WHERE does he mention ANYTHING about the WEB?


Only respondent mentioning "web" and "web server" is you, Uri.

Duh?

Godzilla!


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

Date: Sat, 17 Mar 2001 04:03:56 GMT
From: Benjamin Sugars <ben.sugars@home.com>
Subject: Re: Subroutine in separate files
Message-Id: <Pine.LNX.4.21.0103162253490.30778-100000@localhost.localdomain>

On Fri, 16 Mar 2001, Godzilla! wrote:

> Dave Stang 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.

[ ... deletia ... ]

Please ignore everything this lonely and pathetic troll says.  Do not
waste your precious time trying to deconvolve her fiction.  Instead, put
your subroutines in a separate file and require() that file.  See the
perlfunc and perlsub man pages for more information.

Cheers,
-Ben

-- 
Benjamin Sugars <ben.sugars@home.com>



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

Date: Sat, 17 Mar 2001 05:09:42 +0100
From: TF <tanstaafly@yahoo.com>
Subject: Re: Subroutine in separate files
Message-Id: <170320010509429205%tanstaafly@yahoo.com>

In article <3AB2E226.4A968A2E@stomp.stomp.tokyo>, "Godzilla!"
<godzilla@stomp.stomp.tokyo> wrote:

> Uri Guttman wrote:
>  
> > Godzilla! wrote:
>  
> > ..something about the LWP module...
> 
> > you are bonkers. more than the usual moronzilla bonkers.
> > WHERE does he say his scripts are remote on web servers.
> > WHERE does he mention ANYTHING about the WEB?
> 
> Only respondent mentioning "web" and "web server" is you, Uri.
> 
> Duh?

from the head of LWP.pm:

   "LWP - Library for WWW access in Perl"

last time I checked, WWW stood for "world wide web"
                                               ^^^
Duh?


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

Date: Fri, 16 Mar 2001 20:22:09 -0800
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: Subroutine in separate files
Message-Id: <3AB2E671.5735ACED@stomp.stomp.tokyo>

TF wrote:
 
>  Godzilla! wrote:
 
> > Uri Guttman wrote:

> > > Godzilla! wrote:

> > > ..something about the LWP module...

> > > you are bonkers. more than the usual moronzilla bonkers.
> > > WHERE does he say his scripts are remote on web servers.
> > > WHERE does he mention ANYTHING about the WEB?

> > Only respondent mentioning "web" and "web server" is you, Uri.

> > Duh?
 
> from the head of LWP.pm:
 
>    "LWP - Library for WWW access in Perl"
 
> last time I checked, WWW stood for "world wide web"
                                                ^^^
> Duh?


Exceptionally duh. Both you and Uri are displaying a
lack of programming knowledge. You have both made an
assumption LWP only works off-site.

Duh?

Godzilla!


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

Date: Sat, 17 Mar 2001 04:31:47 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Subroutine in separate files
Message-Id: <x7vgp9583x.fsf@home.sysarch.com>

>>>>> "G" == Godzilla!  <godzilla@stomp.stomp.tokyo> writes:

  G> TF wrote:
  >> Godzilla! wrote:
 
  >> > Uri Guttman wrote:

  >> > > Godzilla! wrote:

  >> > > ..something about the LWP module...

  >> > > you are bonkers. more than the usual moronzilla bonkers.
  >> > > WHERE does he say his scripts are remote on web servers.
  >> > > WHERE does he mention ANYTHING about the WEB?

  >> > Only respondent mentioning "web" and "web server" is you, Uri.

  >> > Duh?
 
  >> from the head of LWP.pm:
 
  >> "LWP - Library for WWW access in Perl"
 
  >> last time I checked, WWW stood for "world wide web"
  G> ^^^
  >> Duh?


  G> Exceptionally duh. Both you and Uri are displaying a
  G> lack of programming knowledge. You have both made an
  G> assumption LWP only works off-site.

it still has nothing to do with splitting a large script into multiple
files. in fact you said:

	There is a very efficient way to accomplish this. Use
	of LWP simple is a very viable alternative. Using this
	module is especially nice if your subroutines are not
	needed at times. This allows a shorter more efficient
	master script which calls remote scripts as needed.

now, that mentions calling remote scripts which means executes. LWP
CANNOT execute remote scripts without a web server. LWP can GET a local
file using the file: but that file still won't be EXECUTED. you can just
as easily open the file and read it insted of using LWP to fetch it. now
what about actually executing it INSIDE the current script which is what
the OP wants as asks for. he wants to have subs in different files to
make his code easier to manage which is a common problem. are you
suggesting that he uses LWP to fetch those local files and then do what? 

you obviously have latched on to LWP as your only way to get files in
perl. ever heard of open, require or even do? in fact have you ever
actually written a module yet? had a script that was actually in
multiple files? oh, yeah, you will probably say, it is a script, so it
is one file. well that is bogus like all the other crap you post.

you lost this one flat out. just run away with your tail between you
legs and piss on some other group. using LWP to LOAD and EXECUTE files
of code in the CURRENT script makes no sense. 

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 05:51:51 +0100
From: TF <tanstaafly@yahoo.com>
Subject: Re: Subroutine in separate files
Message-Id: <170320010551511429%tanstaafly@yahoo.com>

In article <3AB2E671.5735ACED@stomp.stomp.tokyo>, "Godzilla!"
<godzilla@stomp.stomp.tokyo> wrote:

> TF wrote:
>  
> >  Godzilla! wrote:
>  
> > > Uri Guttman wrote:
> 
> > > > Godzilla! wrote:
> 
> > > > ..something about the LWP module...
> 
> > > > you are bonkers. more than the usual moronzilla bonkers.
> > > > WHERE does he say his scripts are remote on web servers.
> > > > WHERE does he mention ANYTHING about the WEB?
> 
> > > Only respondent mentioning "web" and "web server" is you, Uri.
      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> > > Duh?
>  
> > from the head of LWP.pm:
>  
> >    "LWP - Library for WWW access in Perl"
>  
> > last time I checked, WWW stood for "world wide web"
>                                                 ^^^
> > Duh?
> 
> 
> Exceptionally duh. Both you and Uri are displaying a
> lack of programming knowledge. You have both made an
> assumption LWP only works off-site.
> 
> Duh?

Au contraire. The only thing we "have assumed" is that the LWP group of
modules are useful in conjunction with a web server of some kind, be
that locally, "on site" or remotely, "off site".

Let's remember that the OP asked about grouping frequently used
functions into a separate file -- something that in C/C++ one might
write like:

#include <file.c>

Then you advocated the Library for WWW access in Perl.

Now, are you talking web server here or not?

I took the liberty to emphasize the line where you claimed you weren't.
By implication, however, you are. You clearly need to work on your
abstraction skills. I suggest you abandon all endeavors with respect to
programming and focus on obtaining a minimal level of proficiency in
English conversation. Evening school might be a good place to start,
that is, assuming you do have a day job.

TF


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

Date: Fri, 16 Mar 2001 20:59:05 -0800
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: Subroutine in separate files
Message-Id: <3AB2EF19.E6A71F03@stomp.stomp.tokyo>

TF wrote:
 
> Godzilla! wrote:
> > Uri Guttman wrote:
> > > Godzilla! wrote:

> > > ..something about the LWP module...

> > > you are bonkers. more than the usual moronzilla bonkers.
> > > WHERE does he say his scripts are remote on web servers.
> > > WHERE does he mention ANYTHING about the WEB?

> > Only respondent mentioning "web" and "web server" is you, Uri.

> > Duh?
 
> from the head of LWP.pm:
 
>    "LWP - Library for WWW access in Perl"
 
> last time I checked, WWW stood for "world wide web"
                                                ^^^
> Duh?


Not only are both you and Uri displaying a lack of knowledge
about LWP as commented by myself previously, you are both
displaying a lack of prerequisite reading comprehension 
skills qualifying both of you as viable and valid
participants of this newsgroup. It is clear you are not.

The originating author did not ask how to use a module,
how to use a package name, how to use an object or whatever.
He asked how to mount his subroutines in a separate "file"
or files, whatever he means by this.

So far, I have read no respondent to this thread who has
offered any help or advice worth diddly-squat. What I have
read is lame references to "use" and "require" with no
notes on how much work is involved in using those pragmas.

I have offered advice which may or may not be applicable,
lacking any clear parameters as I noted originally. My
comments are helpful, expanded and include a caution note.

You geeks have offered nothing but a display of very
poor reading comprehesion skills, as is so common.

Like I often say, DUH!



Is this your twenty-eighth day? You seem to 
be a tad bit cranky today, Frank.

Godzilla!


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

Date: Sat, 17 Mar 2001 13:32:02 +1100
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: ZPT, a next-generation template technology
Message-Id: <slrn9b5j52.i70.mgjv@martien.heliotrope.home>

On Sat, 17 Mar 2001 01:43:50 -0000,
	Hamish Lawson <hamish_lawson@btinternet.com> wrote:
> 
> * Zope is a leading open-source web application server and content-
> management framework, written in Python by Digital Creations.

So why did you post it to cll.perl.misc and cl.java? At least alt.php is
slightly relevant to this, although you might piss them off as well. I
don't know what their policy on offtopic posts is.

However, cl.perl.misc gets enough offtopic crap as it is. Don't post
future announcements here.

Martien
-- 
Martien Verbruggen              | My friend has a baby. I'm writing
Interactive Media Division      | down all the noises the baby makes so
Commercial Dynamics Pty. Ltd.   | later I can ask him what he meant -
NSW, Australia                  | Steven Wright


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

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


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