[29116] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 360 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Apr 19 18:14:25 2007

Date: Thu, 19 Apr 2007 15:14:18 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Thu, 19 Apr 2007     Volume: 11 Number: 360

Today's topics:
        What are the vestiges of Pascal left in Perl? <jmazon@invalid.invalid>
    Re: What are the vestiges of Pascal left in Perl? <spamtrap@dot-app.org>
    Re: What are the vestiges of Pascal left in Perl? <wahab-mail@gmx.de>
    Re: What are the vestiges of Pascal left in Perl? <abigail@abigail.be>
    Re: What are the vestiges of Pascal left in Perl? <jmazon@invalid.invalid>
    Re: What are the vestiges of Pascal left in Perl? <tony_curtis32@yahoo.com>
    Re: What are the vestiges of Pascal left in Perl? usenet@DavidFilmer.com
    Re: What are the vestiges of Pascal left in Perl? <wahab-mail@gmx.de>
    Re: What are the vestiges of Pascal left in Perl? <wahab-mail@gmx.de>
    Re: What are the vestiges of Pascal left in Perl? <wahab-mail@gmx.de>
    Re: What are the vestiges of Pascal left in Perl? <uri@stemsystems.com>
    Re: What are the vestiges of Pascal left in Perl? <abigail@abigail.be>
    Re: What are the vestiges of Pascal left in Perl? <wahab-mail@gmx.de>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: 19 Apr 2007 21:04:05 +0200
From: Jean-Baptiste Mazon <jmazon@invalid.invalid>
Subject: What are the vestiges of Pascal left in Perl?
Message-Id: <fmsslawqj8a.fsf@somewhere.net>

Hi,

The perl manpage mentions the following:

       Perl combines (in the author's opinion, anyway) some of the
       best features of C, *sed*, *awk*, and *sh*, so people familiar
       with those languages should have little difficulty with it.
       (Language historians will also note some vestiges of *csh*,
       Pascal, and even BASIC-PLUS.)

I could easily find a few examples of Perl features common with C,
sed, awk and sh.  With a little additional research, I could find
similarities with csh and BASIC-PLUS, too.

I'm stuck about Pascal.

What vestige did the author have in mind?


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

Date: Thu, 19 Apr 2007 15:22:04 -0400
From: Sherm Pendley <spamtrap@dot-app.org>
Subject: Re: What are the vestiges of Pascal left in Perl?
Message-Id: <m2ejmgw4o3.fsf@local.wv-www.com>

Jean-Baptiste Mazon <jmazon@invalid.invalid> writes:

> The perl manpage mentions the following:
>
>        Perl combines (in the author's opinion, anyway) some of the
>        best features of C, *sed*, *awk*, and *sh*, so people familiar
>        with those languages should have little difficulty with it.
>        (Language historians will also note some vestiges of *csh*,
>        Pascal, and even BASIC-PLUS.)
>
> I could easily find a few examples of Perl features common with C,
> sed, awk and sh.  With a little additional research, I could find
> similarities with csh and BASIC-PLUS, too.
>
> I'm stuck about Pascal.
>
> What vestige did the author have in mind?

Packages maybe, although Pascal calls them "units".

sherm--

-- 
Web Hosting by West Virginians, for West Virginians: http://wv-www.net
Cocoa programming in Perl: http://camelbones.sourceforge.net


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

Date: Thu, 19 Apr 2007 21:27:31 +0200
From: Mirco Wahab <wahab-mail@gmx.de>
Subject: Re: What are the vestiges of Pascal left in Perl?
Message-Id: <f08g6i$huv$1@mlucom4.urz.uni-halle.de>

Jean-Baptiste Mazon wrote:
> I'm stuck about Pascal.
> 
> What vestige did the author have in mind?

There are some ideas, like:

    BEGIN
      writeln('Hello, World!')
      ...
      ...
      writeln('By bye world!')
    END.

evolved to:

    BEGIN {
      print "Hello, World!\n"
    }
    ...
    ...
    END {
      print "By bye world!\n";
    }

Other points:

    # use 'use vars' because it resembles pascals 'var'
    #   Perl              #    Pascal
    use vars qw'@a1 @a2 @a3';
    @a1 =  1 .. 10;       # var a1:  1..10;
    @a2 = 'a'..'z';       # var a2: 'a'..'z';
    @a3 = 'two'..'four';  # var a3:  two..four;


Of course, the latter *would not* do what you'd
expect from Pascal ;-)


Regards

M.


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

Date: 19 Apr 2007 19:49:19 GMT
From: Abigail <abigail@abigail.be>
Subject: Re: What are the vestiges of Pascal left in Perl?
Message-Id: <slrnf2fhtf.7ug.abigail@alexandra.abigail.be>

Mirco Wahab (wahab-mail@gmx.de) wrote on MMMMCMLXXIX September MCMXCIII
in <URL:news:f08g6i$huv$1@mlucom4.urz.uni-halle.de>:
}}  Jean-Baptiste Mazon wrote:
}} > I'm stuck about Pascal.
}} > 
}} > What vestige did the author have in mind?
}}  
}}  There are some ideas, like:
}}  
}}      BEGIN
}}        writeln('Hello, World!')
}}        ...
}}        ...
}}        writeln('By bye world!')
}}      END.
}}  
}}  evolved to:
}}  
}}      BEGIN {
}}        print "Hello, World!\n"
}}      }
}}      ...
}}      ...
}}      END {
}}        print "By bye world!\n";
}}      }

No.

Perls 'BEGIN' and 'END' come from awk where they perform a similar role
as in Perl.

Pascals 'BEGIN' and 'END' are Perls '{' and '}'.



Abigail
-- 
#!/opt/perl/bin/perl -w
$\ = $"; $; = $$; END {$: and print $:} $SIG {TERM} = sub {$ := $_}; kill 15 =>
fork and ($; == getppid and exit or wait) foreach qw /Just another Perl Hacker/


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

Date: 19 Apr 2007 21:49:48 +0200
From: Jean-Baptiste Mazon <jmazon@invalid.invalid>
Subject: Re: What are the vestiges of Pascal left in Perl?
Message-Id: <fmsodlkqh43.fsf@somewhere.net>

Mirco Wahab <wahab-mail@gmx.de> writes:
> Jean-Baptiste Mazon wrote:
> > I'm stuck about Pascal.
> > What vestige did the author have in mind?
>
>     BEGIN {
>       print "Hello, World!\n"
>     }
>     ...
>     ...
>     END {
>       print "By bye world!\n";
>     }

Those really look more like awk than Pascal to me :-)

>     # use 'use vars' because it resembles pascals 'var'
>     #   Perl              #    Pascal
>     use vars qw'@a1 @a2 @a3';

I don't think both languages calling variables "variables" is going to
be enough for me to rank it a similarity ;-)

>     @a1 =  1 .. 10;       # var a1:  1..10;
>     @a2 = 'a'..'z';       # var a2: 'a'..'z';
>     @a3 = 'two'..'four';  # var a3:  two..four;

The range operator in list context is a very good one!  Thanks!
It sounds pretty much like a conclusive "that's the one!", unless
someone can dig up another candidate of such fine quality.


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

Date: Thu, 19 Apr 2007 15:44:35 -0400
From: Tony Curtis <tony_curtis32@yahoo.com>
Subject: Re: What are the vestiges of Pascal left in Perl?
Message-Id: <f08gr3$rka$1@knot.queensu.ca>

Mirco Wahab wrote:
> Jean-Baptiste Mazon wrote:
>> I'm stuck about Pascal.
>>
>> What vestige did the author have in mind?
> 
> There are some ideas, like:
> 
>    BEGIN
>      writeln('Hello, World!')
>      ...
>      ...
>      writeln('By bye world!')
>    END.
> 
> evolved to:
> 
>    BEGIN {
>      print "Hello, World!\n"
>    }
>    ...
>    ...
>    END {
>      print "By bye world!\n";
>    }

That seems a bit of a stretch to me.  The BEGIN and END in perl are 
pattern-based as in awk, not a statement block syntactic container.


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

Date: 19 Apr 2007 13:09:31 -0700
From: usenet@DavidFilmer.com
Subject: Re: What are the vestiges of Pascal left in Perl?
Message-Id: <1177013371.500554.104710@e65g2000hsc.googlegroups.com>

On Apr 19, 12:04 pm, Jean-Baptiste Mazon <jma...@invalid.invalid>
wrote:
>        Pascal, and even BASIC-PLUS.)
>
> I'm stuck about Pascal.

Me too.  Pascal was my favorite language in college and I knew it
well.  When I picked up Perl, I never once thought, "hey, that's like
Pascal".  There are some conceptual similarities (RECORDs are like
hashes, etc) and some obvious overlap in keywords and operators, but
otherwise Perl does not strike me as anything whatsoever like Pascal,
and I am at a loss to see any vestiges.

--
The best way to get a good answer is to ask a good question.
David Filmer (http://DavidFilmer.com)



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

Date: Thu, 19 Apr 2007 22:20:57 +0200
From: Mirco Wahab <wahab-mail@gmx.de>
Subject: Re: What are the vestiges of Pascal left in Perl?
Message-Id: <f08jam$ioh$1@mlucom4.urz.uni-halle.de>

Abigail wrote:
> Mirco Wahab (wahab-mail@gmx.de) wrote on MMMMCMLXXIX September MCMXCIII
> in <URL:news:f08g6i$huv$1@mlucom4.urz.uni-halle.de>:
> Perls 'BEGIN' and 'END' come from awk where they perform a similar role
> as in Perl.
> 
> Pascals 'BEGIN' and 'END' are Perls '{' and '}'.

Correct, I was mislead because I considered
Pascal to be *older* than awk and therefore
had these keywords earlier.

But you are right, the meaning of the keywords
in Perl is somehwow close to awk.

Thanks & Regards

Mirco


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

Date: Thu, 19 Apr 2007 22:28:25 +0200
From: Mirco Wahab <wahab-mail@gmx.de>
Subject: Re: What are the vestiges of Pascal left in Perl?
Message-Id: <f08jom$itu$1@mlucom4.urz.uni-halle.de>

Tony Curtis wrote:
> Mirco Wahab wrote:
>>    BEGIN
>>      writeln('Hello, World!')
>>      ...
>>      ...
>>      writeln('By bye world!')
>>    END.
>>
>> evolved to:
>>
>>    BEGIN {
>>      print "Hello, World!\n"
>>    }
>>    ...
>>    ...
>>    END {
>>      print "By bye world!\n";
>>    }
> 
> That seems a bit of a stretch to me.  The BEGIN and END in perl are 
> pattern-based as in awk, not a statement block syntactic container.

Yepp, after thinking again, this seems to be nonsense
from my side. I was mislead by Pascal being the older
language and containing this keyword pair (which has,
of course, a completely different meaning there).

Sorry & thanks

M.


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

Date: Thu, 19 Apr 2007 22:34:54 +0200
From: Mirco Wahab <wahab-mail@gmx.de>
Subject: Re: What are the vestiges of Pascal left in Perl?
Message-Id: <f08k4s$j3b$1@mlucom4.urz.uni-halle.de>

Jean-Baptiste Mazon wrote:
> Mirco Wahab <wahab-mail@gmx.de> writes:
>>     @a1 =  1 .. 10;       # var a1:  1..10;
>>     @a2 = 'a'..'z';       # var a2: 'a'..'z';
>>     @a3 = 'two'..'four';  # var a3:  two..four;
> 
> The range operator in list context is a very good one!  Thanks!
> It sounds pretty much like a conclusive "that's the one!", unless
> someone can dig up another candidate of such fine quality.

There are, imho, some identical expressions, like:

length($string);     # length(string);
index($string, 'a'); # index(string, 'a');

but I'm not-as-sure-as-before if this
is a qualifying point ;-)

(could come from BASIC)

Regards

M.


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

Date: Thu, 19 Apr 2007 16:45:11 -0400
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: What are the vestiges of Pascal left in Perl?
Message-Id: <x77is8qejs.fsf@mail.sysarch.com>

>>>>> "MW" == Mirco Wahab <wahab-mail@gmx.de> writes:

  MW> Abigail wrote:
  >> Mirco Wahab (wahab-mail@gmx.de) wrote on MMMMCMLXXIX September MCMXCIII
  >> in <URL:news:f08g6i$huv$1@mlucom4.urz.uni-halle.de>:
  >> Perls 'BEGIN' and 'END' come from awk where they perform a similar role
  >> as in Perl.
  >> Pascals 'BEGIN' and 'END' are Perls '{' and '}'.

  MW> Correct, I was mislead because I considered
  MW> Pascal to be *older* than awk and therefore
  MW> had these keywords earlier.

  MW> But you are right, the meaning of the keywords
  MW> in Perl is somehwow close to awk.

well, algol used BEGIN/END and PL/I also used END keywords (actually
pl/i didn't officially have keywords). most langs (other than lisp and
fortran which are so early) borrowed/stole ideas from other langs. it is
hard not to do that as most langs are created by someone using another
lang and saying, i want it to also do this feature in this way. larry
did just that as nothing he was using at the time (c, sh, awk) could do
it all and as easily as he wanted. and perl6 is doing this even more
deeply by integrating ideas from many many sources as languages have
evolved greatly since perl was created.

uri

-- 
Uri Guttman  ------  uri@stemsystems.com  -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs  ----------------------------  http://jobs.perl.org


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

Date: 19 Apr 2007 20:55:10 GMT
From: Abigail <abigail@abigail.be>
Subject: Re: What are the vestiges of Pascal left in Perl?
Message-Id: <slrnf2flou.7ug.abigail@alexandra.abigail.be>

Mirco Wahab (wahab-mail@gmx.de) wrote on MMMMCMLXXIX September MCMXCIII
in <URL:news:f08jam$ioh$1@mlucom4.urz.uni-halle.de>:
==  Abigail wrote:
== > Mirco Wahab (wahab-mail@gmx.de) wrote on MMMMCMLXXIX September MCMXCIII
== > in <URL:news:f08g6i$huv$1@mlucom4.urz.uni-halle.de>:
== > Perls 'BEGIN' and 'END' come from awk where they perform a similar role
== > as in Perl.
== > 
== > Pascals 'BEGIN' and 'END' are Perls '{' and '}'.
==  
==  Correct, I was mislead because I considered
==  Pascal to be *older* than awk and therefore
==  had these keywords earlier.

Well, Wirth wasn't the first to come up with 'BEGIN' and 'END'. 

However, I doubt that Aho, Kerninghan and Weinberger said "Hmmm, we want
to be able to define actions at the beginning of processing the input,
and at its end. Now, Pascal uses those nifty block delimiters 'BEGIN'
and 'END' - let's borrow them!'.



Abigail
-- 
#!/opt/perl/bin/perl -w
$\ = $"; $SIG {TERM} = sub {print and exit};
kill 15 => fork for qw /Just another Perl Hacker/;


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

Date: Thu, 19 Apr 2007 23:11:52 +0200
From: Mirco Wahab <wahab-mail@gmx.de>
Subject: Re: What are the vestiges of Pascal left in Perl?
Message-Id: <f08njh$kj7$1@mlucom4.urz.uni-halle.de>

Abigail wrote:
> However, I doubt that Aho, Kerninghan and Weinberger said "Hmmm, we want
> to be able to define actions at the beginning of processing the input,
> and at its end. Now, Pascal uses those nifty block delimiters 'BEGIN'
> and 'END' - let's borrow them!'.

Thanks, I needed that ;-)

shonky.com/Pics/larson.jpg

Regards

Mirco


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

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
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: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice. 

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 V11 Issue 360
**************************************


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