[18448] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 616 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Apr 3 09:09:11 2001

Date: Tue, 3 Apr 2001 06:05:13 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <986303113-v10-i616@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Tue, 3 Apr 2001     Volume: 10 Number: 616

Today's topics:
        Call a script from a script NOSPAM@mail.ru
        Call a script from a script NOSPAM@mail.ru
    Re: Call a script from a script <skv@iis.nsk.su>
    Re: cookies.how do I put one on a image? <webmaster@webdragon.unmunge.net>
    Re: Current filename in one-liner - How? <eighner@io.com>
    Re: Disguising Perl scripts (Peter J. Acklam)
    Re: Disguising Perl scripts (Anno Siegel)
    Re: efficient char subst (Anno Siegel)
    Re: Formatting HTML using Perl <educool@mpx.com.au>
    Re: Funny behavior? (Anno Siegel)
    Re: Getting Mod Time While Uploading nobull@mail.com
    Re: Histograms? <Daniel.Maloney@bms.com>
        Javascript <emanuele.didedda@alephinfo.it>
        Javascript <emanuele.didedda@alephinfo.it>
    Re: keep configurations in central place <webmaster@webdragon.unmunge.net>
        NT User Group Administration with Perl <greg.murphy@bt.com>
    Re: NT User Group Administration with Perl <carvdawg@patriot.net>
    Re: parrot!?! <siraaj@eastcrew.org>
    Re: Please Flame my Benchmark: open vs. cat <revjack@revjack.net>
    Re: Regular exasperation (Mark Jason Dominus)
    Re: Regular expression for conversions that exclude HTM <webmaster@webdragon.unmunge.net>
    Re: Script optimization question <jonni@ifm.liu.se>
    Re: Script or Application (Anno Siegel)
    Re: Script or Application (Logan Shaw)
    Re: Script or Application (Anno Siegel)
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Wed, 04 Apr 2001 03:05:17 +0000
From: NOSPAM@mail.ru
Subject: Call a script from a script
Message-Id: <oq3lct8tnmue93u7h08j7ctpvbn7vl1mo4@4ax.com>

Hi,

Inside a perl script, I want call another one.

(I don't need to go back to the first script after)


How can I do by a simple way ?

Thanks


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

Date: Wed, 04 Apr 2001 03:06:56 +0000
From: NOSPAM@mail.ru
Subject: Call a script from a script
Message-Id: <it3lct02ied8u950toc21evesk07u78t03@4ax.com>

Hi,

Inside a perl script, I want call another one.

(I don't need to go back to the first script after)


How can I do by a simple way ?

Thanks


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

Date: Tue, 3 Apr 2001 18:12:13 +0600
From: "Konstantin Stupnik" <skv@iis.nsk.su>
Subject: Re: Call a script from a script
Message-Id: <9acb1v$h0m$1@nl.novosoft.ru>

<NOSPAM@mail.ru> wrote in message
news:it3lct02ied8u950toc21evesk07u78t03@4ax.com...
> Hi,
>
> Inside a perl script, I want call another one.
>
> (I don't need to go back to the first script after)
>
>
> How can I do by a simple way ?

exec("$^X /path/to/another/script.pl");

--
Best regards,
  Konstantin.
Brainbench MVP for perl.




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

Date: 3 Apr 2001 11:24:44 GMT
From: "Scott R. Godin" <webmaster@webdragon.unmunge.net>
Subject: Re: cookies.how do I put one on a image?
Message-Id: <9acbts$7lc$0@216.155.33.88>

In article <Ei7y6.3$uV5.59451@news.interact.net.au>,
 "Chris W" <chrisw+usenet@dynamite.com.au> wrote:

 | <gabloid@eudoramail.com> wrote in message
 | news:3ac81612.7513138@news.aruba.it...
 | > I'd like to know if it is possible to put a cookie on a image, so that
 | > how download it sends me back the cookie..
 | 
 | http://www.eff.org/pub/Privacy/Profiling_cookies_webbugs/web_bug.html
 | 
 | Since the main users of sureptitious data gathering techniques like this are
 | marketing companies and spammers you will generally not be liked for these
 | sorts of shennanigans.


Interesting to note the date of that article as being November 1999 (not 
something more recent like Nov. 2000) considering the fact that this has 
only gotten any serious attention recently. 

strange. 

Yet another reason I love iCab -- image filtering :)

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


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

Date: Tue, 03 Apr 2001 11:53:33 GMT
From: Lars Eighner <eighner@io.com>
Subject: Re: Current filename in one-liner - How?
Message-Id: <8666gnegmt.fsflars@dumpster.io.com>

In our last episode,  <9a9dau$45dfe$1@fu-berlin.de>,
the lovely and talented Tina Mueller
broadcast on comp.lang.perl.misc:

TM> hi, Lars Eighner <eighner@io.com> wrote:
>> How can I use the current filename in a one-liner?

>> For example:

>> perl -pi -e "s/flastmod file\=\"/flastmod file\=\"$$$$/g" *.html

>> The $$$$ is where I want the name of whatever the current file is.
>> $ARGV doesn't work outside of a glob, so it doesn't work here.

TM> for me $ARGV contains the current filename. i'm on linux 2.2.13,
TM> perl 5.6 and Sun 5.7 perl 5.005...

TM> i did a perl -pi -e 's/test/TEST $ARGV/' file*

Yes, it's the double quotes that did me in.  My shell thinks $ARGV
is a shell variable and expands it to nothing before sending the
line to perl.

Thanks to all who responded.

-- 
  Lars Eighner           eighner@io.com           http://www.io.com/~eighner/
Break out of the faceless masses: http://www.cs.indiana.edu/picons/ftp/faq.html
                    Save the whales! Collect the whole set!


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

Date: 03 Apr 2001 11:29:49 +0200
From: jacklam@math.uio.no (Peter J. Acklam)
Subject: Re: Disguising Perl scripts
Message-Id: <wku246pca0.fsf@math.uio.no>

mark.warnes@limecs.com (Mark Warnes) writes:

> I have a Perl script that I have developed that is going to
> be sold commercially.  The problem I have is that I need to
> disguise the Perl source so that it cannot be copied.

When I need to disguise my Perl programs, I usually just
draw glasses and mustaches on them.

Peter

-- 
#!/local/bin/perl5 -wp -*- mode: cperl; coding: iso-8859-1; -*-
# matlab comment stripper (strips comments from Matlab m-files)
s/^((?:(?:[])}\w.]'+|[^'%])+|'[^'\n]*(?:''[^'\n]*)*')*).*/$1/x;


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

Date: 3 Apr 2001 12:31:27 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Disguising Perl scripts
Message-Id: <9acfqv$mfb$2@mamenchi.zrz.TU-Berlin.DE>

According to Peter J. Acklam <jacklam@math.uio.no>:
> mark.warnes@limecs.com (Mark Warnes) writes:
> 
> > I have a Perl script that I have developed that is going to
> > be sold commercially.  The problem I have is that I need to
> > disguise the Perl source so that it cannot be copied.
> 
> When I need to disguise my Perl programs, I usually just
> draw glasses and mustaches on them.

Amateur!  Rubber masks and natural-hair wigs are state of the art.

Anno


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

Date: 3 Apr 2001 11:44:59 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: efficient char subst
Message-Id: <9acd3r$kml$1@mamenchi.zrz.TU-Berlin.DE>

According to John Hunter  <jdhunter@nitace.bsd.uchicago.edu>:
> 
> 
> I have a hash which maps characters (some hex) to strings.

What is a hex character?

>                                                             What is
> the most efficient way to take a block of text and replace all
> characters appearing as keys with their hash values?  Is the answer
> different if the keys are short, non-regexp strings?
>
> Repeatedly calling the regexp substitution operator seems inefficient.

As is often the case with efficiency questions, the answer depends
on more parameters than you have supplied.  How many substitutions
are in the hash?  How frequently do they occur in the text?  It may
also be of interest how keys are built.  Do they have a common
pattern?  All the same length?

Without more information the "most efficient" way isn't defined, not
to mention that you never know if what you have is indeed the most
efficient way.

Usually the best procedure is to write a version that is simple to
program and *gets it right* first, even if it's blatantly inefficient.
The only thing to worry about now is to give it a clean interface so
that it's easily replaced later, if and when it turns out that it is
indeed too slow.

In that situation you have a working program to check results with.
You can also use the preliminary version to gather statistics about
your data if you need that much fine-tuning.  Most importantly, you
will be able to see how the performance of one part or another
influences the overall performance of your program.  Sometimes the
"do it twice" method is applicable:  Just call the routine you intend
to optimize twice instead of once.  If the performance doesn't change
(much), don't bother to optimize.

All in all, optimize as late as possible.  Premature optimization
has killed more projects than... programmer incompetence?  Well,
maybe not.

That said, it must be admitted that early optimization easily
just happens.  Oh... this would run much faster if I only did...
Wait, Variable $smurf in module Murphy still has that value. Now
let's just... 

It takes a monk-like discipline to resist such temptations, but the
way to maintenance hell is paved with little bright ideas.

Anno



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

Date: Tue, 3 Apr 2001 18:16:22 +1000
From: "Chris Hartles" <educool@mpx.com.au>
Subject: Re: Formatting HTML using Perl
Message-Id: <3ac98809$0$25473$7f31c96c@news01.syd.optusnet.com.au>


Sorry "Me"
 I wasn't laughing at you I was laughing at the signature at the end of the
E-mail.
"Try Not.  Do or do not.  There is no try."
It was from Yoda in one of the Starwars movies and also out of a kickboxing
movie.
Just answering the question, don't take offence.
Best Regards
Chris



Patrick <patrickolson@qwest.net> wrote in message
news:Zoby6.1686$u5.658939@news.uswest.net...
> The sig I think
> --
> Geekette
>
> "Try Not.  Do or do not.  There is no try."
> -If you don't know who said this,
> I don't want to talk to you. ;-)
>
> "Nothing is impossible, no matter how improbable."
> -Anonymous
>
>
>
> "Me" <moiraine@qwest.net> wrote in message
> news:3AC8EA52.B1AB537C@qwest.net...
> > Uh.....
> > Did I miss something?  I'm new to the group and new to more advanced CGI
> using
> > Perl...
> > I know it's not the most efficient templating..but it seems the easiest
to
> > learn.
> > Maybe I'm wrong, but nobody else said anthing.  I didn't want to leave
the
> poor
> > guy hanging.
> >
> >
> > Chris Hartles wrote:
> >
> > > hahahaha
> > >
> > > Uncle Zien
> > > Is that Right?
> > >
> >
> > <snip>
> >
> > --
> > Geekette
> >
> > "Try Not.  Do or do not.  There is no try."
> > -If you don't know who said this,
> > I don't want to talk to you. ;-)
> >
> > "Nothing is impossible, no matter how improbable."
> > -Anonymous
> >
> >
> >
>
>




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

Date: 3 Apr 2001 12:48:38 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Funny behavior?
Message-Id: <9acgr6$mfb$3@mamenchi.zrz.TU-Berlin.DE>

According to Scott R. Godin <webmaster@webdragon.unmunge.net>:
> In article <slrn9cgnrv.852.tadmc@tadmc26.august.net>,
>  tadmc@augustmail.com (Tad McClellan) wrote:
> 
>  | >where does the term come from, anyway?
>  | 
>  | 
>  | "here-docs" are borrowed from the shell. 
>  | 
>  | I think the name is too ingrained to be changed...
> 
> ...essentially because the 'document' in question is "right here" and 
> not somewhere else needing to be imported on the fly or built by the 
> script from an array of lines, or some other method, hence the name.

So would an include file be a there-document?  And man pages?
All-over-the-place documents?

Anno


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

Date: 03 Apr 2001 12:10:03 +0100
From: nobull@mail.com
Subject: Re: Getting Mod Time While Uploading
Message-Id: <u9elvatf1w.fsf@wcl-l.bham.ac.uk>

Chaz Warriner <chaz.warriner@idesk.com> writes:

> So, I guess my question is twofold:-
> 
> Is there any way using Perl I can get the modification time of a file on
> a user's computer directly (I've tried using stat() but this only works
> for files already on the server)?

Your question is equivalent to "If I connect to a web site can (Perl)
programs running on the web server read my local disks?".  Putting the
question like that I hope you realise the answer is "not unless there
are big security holes in your browser".

And this, of course, has nothing to do with Perl.

> Is there any way to preserve the modification time of a file while
> uploading it?

I'm sure there's nothing in RFC2388 to say that the HTTP client can't
insert a 'Last-modified' (or any other applicable HTTP/MIME header) in
the file upload.  Indeed common sense would say that it SHOULD do so.
I do not know of any browsers that actually do.

This has nothing to do with Perl.

If you ever find a browser that does then you'd use the CGI
uploadInfo() method to fetch the hash containing the header information
and HTTP::Headers->new() to convert the returned hash into an
HTTP::Headers object so that you can use the last_modified() method on
it.

IMNSHO the whole MIME/HTTP/CGI upload stuff needs a bit of a
rationalisation.

> I'm sorry if I am attempting the impossible and missing the point in
> some way

Applogy accepted.

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


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

Date: Tue, 03 Apr 2001 08:29:54 -0400
From: Daniel P Maloney <Daniel.Maloney@bms.com>
Subject: Re: Histograms?
Message-Id: <3AC9C242.1DAE54E9@bms.com>

Bryan Coon wrote:
> 
> Just in case I forgot to mention it (which I did) in my previous posts
> about GD::Graph does anyone know of a perl module that will do
> histograms? 

Try Chart.pm, on your local CPAN mirror.

================================================================
 Dan Maloney                             daniel.maloney@bms.com
 Instrumentation Technologies Group                203.677.7135
 Discovery Technologies		              fax: 203.677.6417
 Bristol-Myers Squibb Co.


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

Date: Tue, 3 Apr 2001 11:46:31 +0200
From: "Emanuele Di Dedda" <emanuele.didedda@alephinfo.it>
Subject: Javascript
Message-Id: <9ac66a$brp$1@serv1.iunet.it>

http://www.netscape.com/eng/mozilla/3.0/handbook/javascript/index.html
http://hotwired.lycos.com/webmonkey/programming/javascript/




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

Date: Tue, 3 Apr 2001 11:54:53 +0200
From: "Emanuele Di Dedda" <emanuele.didedda@alephinfo.it>
Subject: Javascript
Message-Id: <9ac6m0$ej2$1@serv1.iunet.it>

Scusate. Ho sbagliato a spedire una email.
Sono sicuramente OT.




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

Date: 3 Apr 2001 10:48:12 GMT
From: "Scott R. Godin" <webmaster@webdragon.unmunge.net>
Subject: Re: keep configurations in central place
Message-Id: <9ac9pc$1p8$0@216.155.33.88>

[courtesy cc: sent in e-mail]

In article <3AC8DAB2.1FC782DF@tamu.edu>, Bing Du <bing-du@tamu.edu> 
wrote:

 | I have some basic configurations (e.g. server name, port, data types,
 | etc.) that may be used by many different scripts.  Instead of define the
 | configs in every script, how should I put them in just one place and
 | have all other scripts 'include' it?  Do I need to write a module
 | containing the configs for the scripts to 'use'?

You could also try the Config::IniFiles module, in addition to the other 
suggestions made so far.. just depends on how you want to implement 
things. ;) 

cpan> i Config::IniFiles
Module id = Config::IniFiles
    DESCRIPTION  Read/Write INI-Style configuration files
    CPAN_USERID  RBOW (Rich Bowen <rbowen@rcbowen.com>)
    CPAN_VERSION 2.18
    CPAN_FILE    R/RB/RBOW/Config-IniFiles-2.18.tar.gz
    INST_FILE    (not installed)

HTH :)

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


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

Date: Tue, 03 Apr 2001 11:38:49 +0100
From: Greg Murphy <greg.murphy@bt.com>
Subject: NT User Group Administration with Perl
Message-Id: <3AC9A838.367EBD97@bt.com>

Hi

As a (very) casual user of Perl, I'm a bit in the dark on this one.

I've heard that its possible to do quite a lot of NT admin automatically
with Perl, which would be ideal for my situation. I need to be able to
move hundreds of users between a number of NT groups pretty quickly - is
there an easy way to do this with Perl?

Any help appreciated.

Cheers

Greg Murphy



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

Date: Tue, 03 Apr 2001 06:51:53 -0400
From: H C <carvdawg@patriot.net>
Subject: Re: NT User Group Administration with Perl
Message-Id: <3AC9AB49.CAE24E3F@patriot.net>

Greg,

Yes, you can do this quite easily with Perl, and the Win32::Lanman module.
Jens Helberg is the author, and the module is up on CPAN.

Let me know if you would like some help with the module or the script...I
use it quite a lot.  In fact, I have some skeleton code I use, and it starts
off
w/ 'use strict;' and 'use Win32::Lanman;'...

Greg Murphy wrote:

> Hi
>
> As a (very) casual user of Perl, I'm a bit in the dark on this one.
>
> I've heard that its possible to do quite a lot of NT admin automatically
> with Perl, which would be ideal for my situation. I need to be able to
> move hundreds of users between a number of NT groups pretty quickly - is
> there an easy way to do this with Perl?
>
> Any help appreciated.
>
> Cheers
>
> Greg Murphy



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

Date: Tue, 3 Apr 2001 03:44:05 -0400
From: "Siraaj" <siraaj@eastcrew.org>
Subject: Re: parrot!?!
Message-Id: <9abvvh$4erj0$2@ID-50537.news.dfncis.de>


"wayne.keenan" <wayne.keenan@ntlworld.com> wrote in message
news:3AC7AAA9.76DAE320@ntlworld.com...
> a joke,
>

after seeing something like
"left_angle_right_angle" and "dollar_underscore"
I sure hope it was a joke.






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

Date: 3 Apr 2001 11:34:17 GMT
From: revjack <revjack@revjack.net>
Subject: Re: Please Flame my Benchmark: open vs. cat
Message-Id: <9accfp$apq$1@news1.Radix.Net>
Keywords: Hexapodia as the key insight

Uri Guttman <uri@sysarch.com> wrote:
:>>>>> "r" == revjack  <revjack@revjack.net> writes:

:   r> In order to demonstrate to my cow orkers that open() is a
:   r> wiser choice than `cat`, I ran this benchmark: 

:   r> #!/usr/bin/perl
:   r> use Benchmark;
:   r> $count = 10_000;
:   r> timethese($count, {
:   r>   'cat'  => '$foo = `cat temp.txt`',
:   r>   'open' => 'local $/; open IN, "<temp.txt"; $foo = <IN>; close IN',
:   r> });


: looks like a fair benchmark to me. they both do the exact same function
: of slurping a file into a scalar. what more would you need to add to it?

Thanks for the feedback.

: and what are your results? i know which one will win and i want to see
: the look on the orker's face when he sees the results.

Benchmark: timing 10000 iterations of cat, open...
       cat: 131 wallclock secs ( 2.38 usr 18.87 sys + 27.25 cusr 77.51 csys =  0.00 CPU)
      open:  2 wallclock secs ( 0.49 usr +  0.82 sys =  1.31 

Sun Enterprise 450, 2 processors @ 466MHz, Solaris 5.6
perl 5.005_02

I knew cat would lose too, but wow.

-- 
___________________
revjack@revjack.net


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

Date: Mon, 02 Apr 2001 16:54:02 GMT
From: mjd@plover.com (Mark Jason Dominus)
Subject: Re: Regular exasperation
Message-Id: <3ac8aeb7.28dc$313@news.op.net>

In article <3AC87250.F787FF2E@nospam.com>,
William D. Ezell <nospam@nospam.com> wrote:
>Sorry if the e-mail address was
>problematic but I've held this ISP account now for a couple of years
>with virtually no spam, due almost entirely to not posting a valid
>'Reply-To' address on USENET.

But you also send out private email with your bogus address, which
makes no sense at all, unless you're expecting the people with whom
you have personal correspondence to start spamming you.



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

Date: 3 Apr 2001 11:04:24 GMT
From: "Scott R. Godin" <webmaster@webdragon.unmunge.net>
Subject: Re: Regular expression for conversions that exclude HTML-comments
Message-Id: <9acano$4bg$0@216.155.33.88>

In article <slrn9ci89s.11q.tadmc@tadmc26.august.net>,
 tadmc@augustmail.com (Tad McClellan) wrote:
 
 | I felt OK using that only because the HTML I was processing was
 | machine-generated so I can expect no "weird stuff"...

"Confidence is going after Moby Dick in a row boat and taking the tartar 
sauce with you."

:-) *duck*

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


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

Date: Tue, 3 Apr 2001 09:07:08 +0200
From: "Jonas Nilsson" <jonni@ifm.liu.se>
Subject: Re: Script optimization question
Message-Id: <9absu0$86$1@newsy.ifm.liu.se>

OK, I see. May I just say this:

A) There is a unique solution if and only if a point is said to belong to a
cluster if it's sufficiently close to any of the points in the cluster.

B) There isn't (not generally at least) a unique solution if a point is said
to belong to a cluster if it is sufficiently close to all the points in the
cluster.

This is an example that proves B:

threshold<=2
points:0,2,4
Using A gives all points in one cluster.
Using B gives different results depending on which order you parse the
points.

/jN


> Alright - I'll try explaining it again...
> Say you have the following list and a threshold distance of 2;
> 1,0
> 1,1
> 12,5
> 25,1
> 0,1
> 13,4
> 1,3
>
> Take the first element and place it in a new list;
> 1,1                    1,0
> 12,5
> 25,1
> 0,1
> 13,4
> 1,3
> Compare each element in list 1 to each element (currently only 1 element)
in
> list 2, if they're close enough move them to list 2;
> 12,5                    1,0
> 25,1                    1,1 <- These are added because they're close
enough
> to element 1
> 13,4                    0,1 <
> 1,3
> Repeat the process, comparing to the last batch of points added:
> 12,5                    1,0
> 25,1                    1,1
> 13,4                    0,1
>                            1,3 < this is added because it's next to 1,1
> Keep repeating until nothing new is added.  Then process the result,
getting
> a value of 0.75,1.25 as the centroid.
> Clear the second list and move the first element of the original list
across
> 25,1                    12,5
> 13,4
> And so on.....
>
> There can only be one solution doing it the way I'm describing.  Hopefully
> the example above illustrates that.  It doesn't matter where you start,
> since you keep iterating through until nothing is sufficiently close to
the
> point list you have generated.  In your example below you've only gone
> through the process once.

--
_______________________________
Jonas Nilsson




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

Date: 3 Apr 2001 09:07:13 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Script or Application
Message-Id: <9ac3s1$9ka$1@mamenchi.zrz.TU-Berlin.DE>

According to Damian James <damian@qimr.edu.au>:
> Tom chose Mon, 02 Apr 2001 21:30:10 GMT to say this:
> >I have a question... should a perl program be called a script or an
> >application ?
> >
> 
> Really, it's whatever you want to call it. Language is arbitrary, there are
> no ontological links between words and their meanings, merely conventions.
> Of course you only annoy and/or confuse people by ignoring conventions...
> 
> That said, $high_horse->mount(<<DONE_RAMBLING);
> 
> The only 'scripting languages' are shells. To refer to every Perl program
> as a 'script' because you believe that Perl is a 'scripting language' is
> the act of a {pick suitable term of invective, so long as it carries the
> connotation of some sort of mental deficit}.
> 
> A script is what actors follow, and, depending on your regional usage,
> what your doctor writes to your pharmacist. Fit those analogies in to
> however you look at your program. My take is that if it uses anything
> other than external programs and basic flow control, then it's a 
> *program*, dammit! 
> 
> DONE_RAMBLING

Pejorative connotations of the word "script" aside, the simple
definition "It's a script when the executable contains the source"
is practicable and clear.  Unfortunately, this would make Perl a
scripting language.

German[1] uses the word "Skript" (adapted from the English word) in much
this sense.

Anno

[1] Well, I use it this way.  My colleagues don't object.


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

Date: 3 Apr 2001 05:39:12 -0500
From: logan@cs.utexas.edu (Logan Shaw)
Subject: Re: Script or Application
Message-Id: <9ac98g$71n$1@boomer.cs.utexas.edu>

In article <9ac3s1$9ka$1@mamenchi.zrz.TU-Berlin.DE>,
Anno Siegel <anno4000@lublin.zrz.tu-berlin.de> wrote:
>Pejorative connotations of the word "script" aside, the simple
>definition "It's a script when the executable contains the source"
>is practicable and clear.  Unfortunately, this would make Perl a
>scripting language.

So (assuming I use gcc), compiling with/without "-g" makes the
difference as to whether C and C++ is a scripting language?  :-)

A little more seriously, is Java a scripting language?  By
your definition, it isn't, but it has some characteristics in
common with script languages (it's interpreted, and you can
execute the same stuff on multiple platforms, more or less).

What about incrementally-compiled LISP?  The source
code is there at runtime, but sorta like in the C / C++
example, the source code isn't actually what gets run.

Interestingly, I was just thinking about what defines a
scripting language earlier today, and the conclusion I came to
was very different.  I decided it was a script if it was
interpreted, tried hard to make it convenient to interact with
the system, and had lots of string processing capabilities.

Thinking about it again, I might say that something is a
scripting language if it doesn't concern itself with efficiency
because it makes the assumption that it will mostly just be
calling other code that will do the real work.  (Perl would fall
in a real grey area here because while it's possible to use
native Perl to do lots of stuff somewhat efficiently, on the
other hand many modules have been written in C to do the heavy
duty processing, so often Perl is "just calling other code".)

  - 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: 3 Apr 2001 12:23:34 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Script or Application
Message-Id: <9acfc6$mfb$1@mamenchi.zrz.TU-Berlin.DE>

According to Logan Shaw <logan@cs.utexas.edu>:
> In article <9ac3s1$9ka$1@mamenchi.zrz.TU-Berlin.DE>,
> Anno Siegel <anno4000@lublin.zrz.tu-berlin.de> wrote:
> >Pejorative connotations of the word "script" aside, the simple
> >definition "It's a script when the executable contains the source"
> >is practicable and clear.  Unfortunately, this would make Perl a
> >scripting language.
> 
> So (assuming I use gcc), compiling with/without "-g" makes the
> difference as to whether C and C++ is a scripting language?  :-)

If I'm allowed to recast my definition slightly I think I can
cover that case:  It's a script when the executable *is* the
source.
 
> A little more seriously, is Java a scripting language?  By
> your definition, it isn't, but it has some characteristics in
> common with script languages (it's interpreted, and you can
> execute the same stuff on multiple platforms, more or less).
> 
> What about incrementally-compiled LISP?  The source
> code is there at runtime, but sorta like in the C / C++
> example, the source code isn't actually what gets run.

As always when you attempt to give a definition to a word,
there are cases where the definition fails to make a clear
distinction, or even fails to work at all.  All you can hope
is to find a definition whose gray areas don't come up often
in praxis.

> Interestingly, I was just thinking about what defines a
> scripting language earlier today, and the conclusion I came to
> was very different.  I decided it was a script if it was
> interpreted, tried hard to make it convenient to interact with
  ^^^^^^^^^^^

"Interpreted" is another notion that has blurry edges.  Even
a conventional binary often needs a runtime system which can
be viewed as an interpreter needed to execute the (heavily) pre-
compiled source.  Looking at micro-programmed CPUs you even
have an interpreter running that executes native machine code.

On the other hand, as you observe, few interpreters forgo a
compiling stage to transform the source text into something
less readable and more execution-friendly.  Shells and early
BASIC seem to be exceptions, Perl certainly isn't.  So, at least
in some cases, the compiled/interpreted distinction only begs
the question.

> the system, and had lots of string processing capabilities.
> 
> Thinking about it again, I might say that something is a
> scripting language if it doesn't concern itself with efficiency
> because it makes the assumption that it will mostly just be
> calling other code that will do the real work.  (Perl would fall
> in a real grey area here because while it's possible to use
> native Perl to do lots of stuff somewhat efficiently, on the
> other hand many modules have been written in C to do the heavy
> duty processing, so often Perl is "just calling other code".)

Certainly a large part of Perl's success is its aptness as a glue
language.  You deal with the big picture in Perl, and when you have
decided what must be done there are programs or library calls to do
it.  Though Perl's latest (and, in my eyes somewhat disreputable)
success as a "web language" has more to do with its text processing
capabilities.

Anno


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

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


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