[30278] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1521 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu May 8 18:09:41 2008

Date: Thu, 8 May 2008 15:09:08 -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, 8 May 2008     Volume: 11 Number: 1521

Today's topics:
    Re: Apache vs IIS current directory fro Perl script <spamtrap@dot-app.org>
    Re: cpan shell and MyConfig.pm problem <brian.d.foy@gmail.com>
    Re: Is this expected in a foreach()? <achimpeters@gmx.de>
    Re: Is this expected in a foreach()? <rvtol+news@isolution.nl>
    Re: Perl DBI Module: SQL query where there is space in  <spamtrap@dot-app.org>
    Re: Perl DBI Module: SQL query where there is space in  <kkeller-usenet@wombat.san-francisco.ca.us>
    Re: Perl DBI Module: SQL query where there is space in  <RedGrittyBrick@SpamWeary.foo>
    Re: Perl DBI Module: SQL query where there is space in  <ben@morrow.me.uk>
    Re: Perl DBI Module: SQL query where there is space in  (Jens Thoms Toerring)
    Re: Perl DBI Module: SQL query where there is space in  <spamtrap@dot-app.org>
    Re: Perl DBI Module: SQL query where there is space in  <jurgenex@hotmail.com>
        Perl OLE Excel - edit width/height Comment window <slick.users@gmail.com>
    Re: Perl OLE Excel - edit width/height Comment window <brian.helterline@hp.com>
    Re: Selected cipher type  not supported by server <smallpond@juno.com>
    Re: The Importance of Terminology's Quality <java.oke@gmail.com>
    Re: The Importance of Terminology's Quality <jon@ffconsultancy.com>
        trailing spaces in unpack("A10") <klaus03@gmail.com>
    Re: trailing spaces in unpack("A10") <uri@stemsystems.com>
    Re: trailing spaces in unpack("A10") <spamtrap@dot-app.org>
    Re: Why doesn't Perl complain about this bareword? <ced@blv-sam-01.ca.boeing.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Thu, 08 May 2008 11:20:37 -0400
From: Sherman Pendley <spamtrap@dot-app.org>
Subject: Re: Apache vs IIS current directory fro Perl script
Message-Id: <m1r6cckeka.fsf@dot-app.org>

andipfaff <andreas.pfaff@swissonline.ch> writes:

> Is there a way to change the behaviour of Apache without touching the
> scripts?

Maybe. If so, you'd do it the same way whether your scripts were in Perl,
Python, Ruby, or whatever. Your question is about Apache, not Perl.

sherm--

-- 
My blog: http://shermspace.blogspot.com
Cocoa programming in Perl: http://camelbones.sourceforge.net


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

Date: Thu, 08 May 2008 19:53:14 +0200
From: brian d  foy <brian.d.foy@gmail.com>
Subject: Re: cpan shell and MyConfig.pm problem
Message-Id: <080520081953147550%brian.d.foy@gmail.com>

In article
<e71040c4-5f85-4266-b07d-d35b1fc384ac@r66g2000hsg.googlegroups.com>,
Ronny <ro.naldfi.scher@gmail.com> wrote:

> I would like to install CPAN modules with the cpan command. Since I
> don't have
> write permission to the Perl installation directories, I need to do a
> local installation.

For using the cpan command, configure your CPAN.pm with the right
values in:

make_arg             arguments that should always be passed to 'make'
make_install_make_command
                     the make command for running 'make install', for
                     example 'sudo make'

make_install_arg     same as make_arg for 'make install'
makepl_arg              arguments passed to 'perl Makefile.PL'
mbuild_arg              arguments passed to './Build'
mbuild_install_arg   arguments passed to './Build install'
  
mbuild_install_build_command
                     command to use instead of './Build' when we are
                     in the install stage, for example 'sudo ./Build'

mbuildpl_arg       arguments passed to 'perl Build.PL'


For instance, you might set makepl_arg to "PREFIX=~/lib" to install
things in the lib directory inside your home directory.

> After playing around with the cpan command a bit and looking at the
> source code of
> CPAN::Config, I created a $HOME/.cpan/CPAN/MyConfig.pm with the
> following content:

The CPAN::FirstTime module can help you make a configuration file. My
first guess would be that making by hand meant you left out something.

Good luck :)


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

Date: Thu, 08 May 2008 17:13:10 +0200
From: Achim Peters <achimpeters@gmx.de>
Subject: Re: Is this expected in a foreach()?
Message-Id: <48231886$0$6559$9b4e6d93@newsspool3.arcor-online.net>

Gowtham schrieb:
> Is this expected? I feel changes to $b shouldn't change the array
> @a ...
> 
>   DB<26> @a = qw/ A B C /;
> 
>   DB<27> foreach my $b ( @a ) { $b =~ s/([A-Z])/lc $1/e;  }

And don't forget the 11th perl commandment:

"Thou shalt never use $a or $b except when thou art programming in a 
sort context"

"But it's only sample code!"

"I said, NEVER, son."

Bye
  Achim


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

Date: Thu, 8 May 2008 17:14:35 +0200
From: "Dr.Ruud" <rvtol+news@isolution.nl>
Subject: Re: Is this expected in a foreach()?
Message-Id: <fvvcti.3cg.1@news.isolution.nl>

Gowtham schreef:

> It will also be helpful if somebody can give
> examples for non-lvalues...

perl -Mstrict -Mwarnings -le'
    my @txt = qw{this is an example};
    tr/a-z/n-za-m/ for @txt;
    print for @txt;
    tr/a-z/n-za-m/ for qw{this is an example};
'
guvf
vf
na
rknzcyr
Modification of a read-only value attempted at -e line 5.

-- 
Affijn, Ruud

"Gewoon is een tijger."


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

Date: Thu, 08 May 2008 12:10:06 -0400
From: Sherman Pendley <spamtrap@dot-app.org>
Subject: Re: Perl DBI Module: SQL query where there is space in field name
Message-Id: <m1fxssrd41.fsf@dot-app.org>

ambarish.mitra@gmail.com writes:

> Question: What is the way to fire this command in PERL where the field
> name (and value as well) can have spaces?

I have no idea. You might ask in a PERL group - this one talks about Perl.

sherm--

-- 
My blog: http://shermspace.blogspot.com
Cocoa programming in Perl: http://camelbones.sourceforge.net


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

Date: Thu, 8 May 2008 09:47:19 -0700
From: Keith Keller <kkeller-usenet@wombat.san-francisco.ca.us>
Subject: Re: Perl DBI Module: SQL query where there is space in field name
Message-Id: <odnbf5xb4f.ln2@goaway.wombat.san-francisco.ca.us>

On 2008-05-08, ambarish.mitra@gmail.com <ambarish.mitra@gmail.com> wrote:
>
> Using the DBI module, I have connected to a CSV file, and am trying to
> execute SQL queries on the CSV file. I am stuck when there is a space
> in the field name and I cannot proceed.

The obvious workaround would be to remove the spaces from the field name.

> Question: What is the way to fire this command in PERL where the field
> name (and value as well) can have spaces?

Spaces are fine in the values, it's just the column names that are
problematic.  perldoc DBD::CSV talks about whitespace being problematic
in the table name, and I would guess that it's similar for column names.

--keith

-- 
kkeller-usenet@wombat.san-francisco.ca.us
(try just my userid to email me)
AOLSFAQ=http://www.therockgarden.ca/aolsfaq.txt
see X- headers for PGP signature information



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

Date: Thu, 08 May 2008 17:59:37 +0100
From: RedGrittyBrick <RedGrittyBrick@SpamWeary.foo>
Subject: Re: Perl DBI Module: SQL query where there is space in field name
Message-Id: <4823317a$0$10639$fa0fcedb@news.zen.co.uk>

ambarish.mitra@gmail.com wrote:

> [Apparently using DBD::CSV] 
>
> my $sth = $dbh->prepare("select * from report where [Display Type]
> =MultiLineText");
> ...
> SQL ERROR: Bad table or column name '[Display Type]' has chars not
> alphanumeric or underscore!
> ... 
> Question: What is the way to fire this command in PERL where the field
> name (and value as well) can have spaces?
> 

See col_names and skip_first_row in
http://search.cpan.org/~jzucker/DBD-CSV-0.22/lib/DBD/CSV.pm

I think you can use these to assign legal column names without requiring 
changes to the CSV.

-- 
RGB


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

Date: Thu, 8 May 2008 17:48:54 +0100
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: Perl DBI Module: SQL query where there is space in field name
Message-Id: <mgnbf5-iv41.ln1@osiris.mauzo.dyndns.org>


Quoth ambarish.mitra@gmail.com:
> Hi all,
> 
> Using the DBI module, I have connected to a CSV file, and am trying to
> execute SQL queries on the CSV file. I am stuck when there is a space
> in the field name and I cannot proceed.
> 
> The CSV file col heading:
> "Attribute","Display Name","Semantic Type","Display Type".  (ie, space
> in the heading)
> 
> I am trying to "prepare" only those lines for which 'Display Type' is
> given.
> 
> The error line is given:
> 
> my $sth = $dbh->prepare("select * from report where [Display Type]
> =MultiLineText");
> 
> 
> SQL ERROR: Bad table or column name '[Display Type]' has chars not
> alphanumeric or underscore!
> SQL ERROR: Couldn't find predicate!

Assuming you are using DBD::CSV, the docs point you to SQL::Statement,
which says you should quote identifiers with double quotes. Quoting with
square brackets is (IIRC) an MS Access-specific syntax. So try

    my $sth = $dbh->prepare(
        'select * from report where "Display Type"=MultiLineText'
    );

Ben

-- 
For the last month, a large number of PSNs in the Arpa[Inter-]net have been
reporting symptoms of congestion ... These reports have been accompanied by an
increasing number of user complaints ... As of June,... the Arpanet contained
47 nodes and 63 links. [ftp://rtfm.mit.edu/pub/arpaprob.txt] * ben@morrow.me.uk


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

Date: 8 May 2008 17:12:15 GMT
From: jt@toerring.de (Jens Thoms Toerring)
Subject: Re: Perl DBI Module: SQL query where there is space in field name
Message-Id: <68gqjfF2s9katU1@mid.uni-berlin.de>

ambarish.mitra@gmail.com wrote:
> Using the DBI module, I have connected to a CSV file, and am trying to
> execute SQL queries on the CSV file. I am stuck when there is a space
> in the field name and I cannot proceed.

> The CSV file col heading:
> "Attribute","Display Name","Semantic Type","Display Type".  (ie, space
> in the heading)

> I am trying to "prepare" only those lines for which 'Display Type' is
> given.

> The error line is given:

> my $sth = $dbh->prepare("select * from report where [Display Type]
> =MultiLineText");


> SQL ERROR: Bad table or column name '[Display Type]' has chars not
> alphanumeric or underscore!
> SQL ERROR: Couldn't find predicate!

> I have tried some googling and also tried multiple combination of
> brackets/qoutes/escapes with a hope that one of them will work, but
> without luck.

> Question: What is the way to fire this command in PERL where the field
> name (and value as well) can have spaces?

I guess you're out of luck. While the documentation of DBI::CVS only
explicitely says that table names can't contain spaces (due to SQL
not allowing any) if I remember correctly also spaces in column
names aren't allowed in SQL. Thus I wouldn't expect DBI to accept
them even with some kinds of quotation/escape characters (which
probably would have an extra meaning in an SQL statement).

                               Regards, Jens
-- 
  \   Jens Thoms Toerring  ___      jt@toerring.de
   \__________________________      http://toerring.de


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

Date: Thu, 08 May 2008 14:36:06 -0400
From: Sherman Pendley <spamtrap@dot-app.org>
Subject: Re: Perl DBI Module: SQL query where there is space in field name
Message-Id: <m13aosy76x.fsf@dot-app.org>

Andrew DeFaria <Andrew@DeFaria.com> writes:

> What a non-helpful answer Sherm...

So how helpful is the CSS gibberish you insist on including with every one
of your posts?

sherm--

-- 
My blog: http://shermspace.blogspot.com
Cocoa programming in Perl: http://camelbones.sourceforge.net


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

Date: Thu, 08 May 2008 19:24:51 GMT
From: Jürgen Exner <jurgenex@hotmail.com>
Subject: Re: Perl DBI Module: SQL query where there is space in field name
Message-Id: <elk624llqp8hd3v4ocpplio4bnc418en17@4ax.com>

Andrew DeFaria <Andrew@DeFaria.com> wrote:
> --------------070607060008040400030708
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
> Content-Transfer-Encoding: 7bit
> 
> Sherman Pendley wrote:
> > ambarish.mitra@gmail.com writes:
> >> Question: What is the way to fire this command in PERL where the 
> >> field name (and value as well) can have spaces?
> > I have no idea. You might ask in a PERL group - this one talks about Perl.
> What a non-helpful answer Sherm...

And you honestly believe your 120+ lines long signature (quoted in full
below) is any more helpful?

jue

> -- 
> Andrew DeFaria <http://defaria.com>
> Whatever happened to Preparations A through G?
> 
> --------------070607060008040400030708
> Content-Type: text/html; charset=ISO-8859-1
> Content-Transfer-Encoding: 7bit
> 
> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
> <html>
> <head>
>   <style type="text/css">
> body {
>   font:			Helvetica, Arial, sans-serif;
> }
> p {
>   font:			Helvetica, Arial, sans-serif;
> }
> .standout {
>   font-family:		verdana,
> 			arial,
> 			sans-serif;
>   font-size:		12px;
>   color:		#993333;
>   line-height:		13px;
>   font-weight:		bold;
>   margin-bottom:	10px;
> }
> .code {
>   border-top:		1px solid #ddd;
>   border-left:		1px solid #ddd;
>   border-right:		2px solid #000;
>   border-bottom:	2px solid #000;
>   padding:		10px;
>   margin-top:		5px;
>   margin-left:		5%;
>   margin-right:		5%;
>   background:		#ffffea;
>   color:		black;
>   -moz-border-radius:	10px;
> }
> .terminal {
>   border-top:		10px solid #03f;
>   border-left:		1px solid #ddd;
>   border-right:		2px solid grey;
>   border-bottom:	2px solid grey;
>   padding:		10px;
>   margin-top:		5px;
>   margin-left:		5%;
>   margin-right:		5%;
>   background:		black;
>   color:		white;
>   -moz-border-radius:	10px;
> }
> #code {
>   color:		black;
>   font-size:		14px;
>   font-family:		courier;
>   padding-left:		5px;
> }
> #line-number {
>   color:		#804000;
>   font-family:		Arial;
>   font-size:		14px;
>   padding-right:	5px;
>   border-right:		1px dotted #804000;
> }
> blockquote[type=cite] {
>   padding:	0em .5em .5em .5em	!important;
>   border-right:	2px  solid blue		!important;
>   border-left:	2px solid blue		!important;
> }
> blockquote[type=cite]
> blockquote[type=cite] {
>   border-right:	2px solid maroon	!important;
>   border-left:	2px solid maroon	!important;
> }
> blockquote[type=cite]
> blockquote[type=cite]
> blockquote[type=cite] {
>   border-right:	2px solid teal		!important;
>   border-left:	2px solid teal		!important;
> }
> blockquote[type=cite]
> blockquote[type=cite]
> blockquote[type=cite]
> blockquote[type=cite] {
>   border-right:	2px solid purple	!important;
>   border-left:	2px solid purple	!important;
> }
> blockquote[type=cite]
> blockquote[type=cite]
> blockquote[type=cite]
> blockquote[type=cite]
> blockquote[type=cite] {
>   border-right:	2px solid green		!important;
>   border-left:	2px solid green		!important;
> }
>   </style>
> </head>
> <body>
> Sherman Pendley wrote:
> <blockquote id="mid_m1fxssrd41_fsf_dot-app_org"
>  cite="mid:m1fxssrd41.fsf@dot-app.org" type="cite"><a class="moz-txt-link-abbreviated" href="mailto:ambarish.mitra@gmail.com">ambarish.mitra@gmail.com</a>
> writes:<br>
>   <blockquote id="StationeryCiteGenerated_1" type="cite">Question: What
> is the way to fire this command in PERL where the field name (and value
> as well) can have spaces?<br>
>   </blockquote>
> <!---->I have no idea. You might ask in a PERL group - this one talks
> about Perl.<br>
> </blockquote>
> What a non-helpful answer Sherm...<br>
> <div class="moz-signature">-- <br>
> <a href="http://defaria.com">Andrew DeFaria</a><br>
> <small><font color="#999999">Whatever happened to Preparations A
> through G?</font></small>
> </div>
> </body>
> </html>
> 
> --------------070607060008040400030708--
> 


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

Date: Thu, 8 May 2008 10:32:42 -0700 (PDT)
From: Slickuser <slick.users@gmail.com>
Subject: Perl OLE Excel - edit width/height Comment window
Message-Id: <54c2a5cf-8dd9-4d30-8b2e-5421379d9963@x19g2000prg.googlegroups.com>

I have achieved adding comments but I can't change the width and
height of the comment box. Any help?

This is the VBA macro code:
       Range("C23").Comment.Text Text:= _
        "Slickuser:" & Chr(10) & "Helllo              " & Chr(10) & ""
& Chr(10) & "" & Chr(10) & "" & Chr(10) & "" & Chr(10) & "wowow this
is awesome!!!!!!!!!!!! " & Chr(10) & "what!!"
    Selection.ShapeRange.ScaleWidth 1.76, msoFalse,
msoScaleFromTopLeft
    Selection.ShapeRange.ScaleHeight 0.54, msoFalse,
msoScaleFromTopLeft
    Range("C23").Comment.Shape.Select True
    ActiveWindow.SmallScroll Down:=6
    Range("F19").Select


Perl OLE Browser info:

Comment: Property Shape As Shape readonly
ShapeRange: Sub ScaleHeight(Factor As VT_R4, RelativeToOriginalSize As
MsoTriState, [Scale])


Here is the Perl code:

$Range_Enter = $Worksheet->Range("C23");

$Range_Enter->{AddComment};
$Range_Enter->{Comment}->{Visible} = 0;
my $string = "".$Range_Enter->{Comment}->{Author}.":
\nHelllo              \n\n\n\n\nwowow this is awesome!!!!!!!!!!!!
\nwhat!!" ;
$Range_Enter->{Comment}->Text($string);

//not sure how to translate this with Selection
#$Range_Enter>{ShapeRange}->ScaleWidth("1.76, msoFalse,
msoScaleFromTopLeft");
#$Range_Enter->{ShapeRange}->ScaleHeight("0.54, msoFalse,
msoScaleFromTopLeft");


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

Date: Thu, 08 May 2008 13:16:15 -0700
From: Brian Helterline <brian.helterline@hp.com>
Subject: Re: Perl OLE Excel - edit width/height Comment window
Message-Id: <fvvn2f$k4v$1@usenet01.boi.hp.com>

Slickuser wrote:
> I have achieved adding comments but I can't change the width and
> height of the comment box. Any help?
> 
> This is the VBA macro code:
>        Range("C23").Comment.Text Text:= _
>         "Slickuser:" & Chr(10) & "Helllo              " & Chr(10) & ""
> & Chr(10) & "" & Chr(10) & "" & Chr(10) & "" & Chr(10) & "wowow this
> is awesome!!!!!!!!!!!! " & Chr(10) & "what!!"
>     Selection.ShapeRange.ScaleWidth 1.76, msoFalse,
> msoScaleFromTopLeft
>     Selection.ShapeRange.ScaleHeight 0.54, msoFalse,
> msoScaleFromTopLeft
>     Range("C23").Comment.Shape.Select True
>     ActiveWindow.SmallScroll Down:=6
>     Range("F19").Select
> 
> 
> Perl OLE Browser info:
> 
> Comment: Property Shape As Shape readonly
> ShapeRange: Sub ScaleHeight(Factor As VT_R4, RelativeToOriginalSize As
> MsoTriState, [Scale])
> 
> 
> Here is the Perl code:
> 
> $Range_Enter = $Worksheet->Range("C23");
> 
> $Range_Enter->{AddComment};
$my $comment = $Range_Enter->{AddComment};

> $Range_Enter->{Comment}->{Visible} = 0;
$comment->{Visible} = 1;

> my $string = "".$Range_Enter->{Comment}->{Author}.":
> \nHelllo              \n\n\n\n\nwowow this is awesome!!!!!!!!!!!!
> \nwhat!!" ;

my $string = $comment->{Author} . ":.........";

> $Range_Enter->{Comment}->Text($string);
$comment->Text($string);

> 
> //not sure how to translate this with Selection
> #$Range_Enter>{ShapeRange}->ScaleWidth("1.76, msoFalse, msoScaleFromTopLeft");
> #$Range_Enter->{ShapeRange}->ScaleHeight("0.54, msoFalse, msoScaleFromTopLeft");

use constant msoFalse => 0;	# or import the entire Office typelib
use constant msoScaleFromTopLeft => 0;

my $shape = $comment->{Shape};	# now you have your shape object
$shape->ScaleWidth( 1.76, msoFalse, msoScaleFromTopLeft );
$shape->ScaleHeight(0.54, msoFalse, msoScaleFromTopLeft );


In your excel macro, the ScaleWidth and ScaleHeight functions were 
called on the current selection,  you need to make get that "selection" 
in perl before you can operate on it.

-- 
-brian


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

Date: Thu, 08 May 2008 11:09:47 -0400
From: smallpond <smallpond@juno.com>
Subject: Re: Selected cipher type  not supported by server
Message-Id: <e1f5f$482317c5$461@news.teranews.com>

lovecreatesbea...@gmail.com wrote:
> Hi,
> 
> I'm getting "Selected cipher type  not supported by server" error on
> this line
> 
>     $cnn = Net::SSH::Perl->new($host);
> 

Are you tring to connect to an SSH-1 or SSH-2 host?
If not sure, report the error(s) you get from trying each.
--S
** Posted from http://www.teranews.com **


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

Date: Thu, 8 May 2008 14:39:19 -0700 (PDT)
From: "j.oke" <java.oke@gmail.com>
Subject: Re: The Importance of Terminology's Quality
Message-Id: <0c3c6e48-32cf-4fdd-883e-348f4436a309@y38g2000hsy.googlegroups.com>

xahlee@gmail.com ha scritto:

> [bli bla blo, blu blu bum bum bam bam bim bim bim...]

don't know Y, by your arty-phycial excerptions always seem chinese
me...

-JO


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

Date: Thu, 08 May 2008 19:02:18 +0100
From: Jon Harrop <jon@ffconsultancy.com>
Subject: Re: The Importance of Terminology's Quality
Message-Id: <5NCdnRlmwIIt5L7VnZ2dnUVZ8sSrnZ2d@plusnet>

xahlee@gmail.com wrote:
> I'd like to introduce a blog post by Stephen Wolfram, on the design
> process of Mathematica. In particular, he touches on the importance of
> naming of functions.
> 
> ? Ten Thousand Hours of Design Reviews (2008 Jan 10) by Stephen
> Wolfram
>  http://blog.wolfram.com/2008/01/10/ten-thousand-hours-of-design-reviews/
> 
> The issue is fitting here today, in our discussion of ?closure?
> terminology recently, as well the jargons ?lisp 1 vs lisp2? (multi-
> meaning space vs single-meaning space), ?tail recursion?, ?currying?,
> ?lambda?, that perennially crop up here and elsewhere in computer
> language forums in wild misunderstanding and brouhaha.
> 
> The functions in Mathematica, are usually very well-name, in contrast
> to most other computing languages.

The mathematical functions are well named but many of the general
programming constructs are not even well defined, let alone well named.

For example, overloaded "Gamma" in Mathematica vs "gammainc" in MATLAB for
the incomplete gamma functions.

> In particular, the naming in 
> Mathematica, as Stephen Wolfram implied in his blog above, takes the
> perspective of naming by capturing the essense, or mathematical
> essence, of the keyword in question. (as opposed to, naming it
> according to convention, which often came from historical happenings)
> When a thing is well-named from the perspective of what it actually
> ?mathematically? is, as opposed to historical developments, it avoids
> vast amount of potential confusion.
> 
> Let me give a few example.
> 
> ? ?lambda?, widely used as a keyword in functional languages, is named
> just ?Function? in Mathematica. The ?lambda? happend to be called so
> in the field of symbolic logic, is due to use of the greek letter
> lambda ??? by happenstance. The word does not convey what it means.
> While, the name ?Function?, stands for the mathematical concept of
> ?function? as is.

Look at the "function" keyword in OCaml and F#. They also pattern match over
their input whereas Mathematica does not allow this in "Function".

> ? Module, Block, in Mathematica is in lisp's various ?let*?. The
> lisp's keywords ?let?, is based on the English word ?let?. That word
> is one of the English word with multitudes of meanings. If you look up
> its definition in a dictionary, you'll see that it means many
> disparate things. One of them, as in ?let's go?, has the meaning of
> ?permit; to cause to; allow?. This meaning is rather vague from a
> mathematical sense. Mathematica's choice of Module, Block, is based on
> the idea that it builds a self-contained segment of code. (however,
> the choice of Block as keyword here isn't perfect, since the word also
> has meanings like ?obstruct; jam?)

Bad example. Mathematica's "Block" implements what we all know as "Scope".
Mathematica's "Module" implements something most people have never needed
to learn (rewriting a subexpression with uniquely tagged identifiers to
disambiguate them from externals):

  In[1] := Module[{a}, a]
  Out[1] = a$617

> ? Functions that takes elements out of list are variously named First,
> Rest, Last, Extract, Part, Take, Select, Cases, DeleteCases... as
> opposed to ?car?, ?cdr?, ?filter?, ?filter?, ?pop?, ?shift?,
> ?unshift?, in lisps and perl and other langs.

You are comparing arrays in Mathematica to lists in other functional
languages. Mathematica is often asymptotically slower as a consequence,
with "Rest" being O(n):

  In[1] := AbsoluteTiming[Rest[Range[1, 1000000]];]
  Out[1] = {0.219, Null}

The equivalents over lists are all O(1) in SML, OCaml, F#, Haskell, Scala,
Lisp and Scheme and is called the "tail" of a list. For example, in F#:

  > time List.tl [1 .. 1000000];;
  Took 0ms
  val it : int list = ...

Perhaps the best example I can think of to substantiate your original point
is simple comparison because Mathematica allows:

  a < b < c

I wish other languages did.

-- 
Dr Jon D Harrop, Flying Frog Consultancy
http://www.ffconsultancy.com/products/?u


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

Date: Thu, 8 May 2008 12:52:30 -0700 (PDT)
From: Klaus <klaus03@gmail.com>
Subject: trailing spaces in unpack("A10")
Message-Id: <f8658731-1f24-4e9d-b2f1-015ef1528b15@56g2000hsm.googlegroups.com>

According to "perldoc perlpacktut", I could use unpack to extract
fixed length fields:

from "perldoc perlpacktut":
+++++++++++++++++++++++++++++++++++++
++ [...] we can see that the date column stretches from
++ column 1 to column 10 - ten characters wide. The
++ pack-ese for "character" is A, and ten of them are
++ A10. So if we just wanted to extract the dates, we
++ could say this:
++
++  my($date) = unpack("A10", $_);
+++++++++++++++++++++++++++++++++++++

So I have created a test case with 3 A's then 7 spaces, followed by 3
B's:


use strict;
use warnings;
$_ = 'AAA       BBB';
my $result = unpack("A10", $_);
print "result = '$result'\n";

This is the output:
result = 'AAA'

It basically works, but unpack seems to remove trailing spaces.

To my understanding of "perldoc perlpacktut", the output should show
as result a field of 10 characters (3 A's followed by 7 spaces), but
actually it only shows 3 A's.

Where have the 7 spaces gone ?

I can easily fill up the missing spaces with an sprintf("%-10s"), but
can somebody point me to the documentation where it says that
unpack("A10") removes trailing spaces ?

btw, I am using perl 5.10 under Win XP

--
Klaus


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

Date: Thu, 08 May 2008 20:22:01 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: trailing spaces in unpack("A10")
Message-Id: <x7myn0bl7c.fsf@mail.sysarch.com>

>>>>> "K" == Klaus  <klaus03@gmail.com> writes:

  K> According to "perldoc perlpacktut", I could use unpack to extract
  K> fixed length fields:

  K> from "perldoc perlpacktut":
  K> +++++++++++++++++++++++++++++++++++++
  K> ++ [...] we can see that the date column stretches from
  K> ++ column 1 to column 10 - ten characters wide. The
  K> ++ pack-ese for "character" is A, and ten of them are
  K> ++ A10. So if we just wanted to extract the dates, we
  K> ++ could say this:
  K> ++
  K> ++  my($date) = unpack("A10", $_);
  K> +++++++++++++++++++++++++++++++++++++

  K> So I have created a test case with 3 A's then 7 spaces, followed by 3
  K> B's:


  K> use strict;
  K> use warnings;
  K> $_ = 'AAA       BBB';
  K> my $result = unpack("A10", $_);
  K> print "result = '$result'\n";

  K> This is the output:
  K> result = 'AAA'

  K> It basically works, but unpack seems to remove trailing spaces.

from perldoc -f pack:

	The "a", "A", and "Z" types gobble just one value, but pack it
	as a string of length count, padding with nulls or spaces as
	necessary.  When unpacking, "A" strips trailing spaces and
	nulls, "Z" strips everything after the first null, and "a"
	returns data verbatim.  When packing, "a", and "Z" are
	equivalent.

  K> Where have the 7 spaces gone ?

where the docs said they would go. use the 'a' format to keep the spaces.

uri

-- 
Uri Guttman  ------  uri@stemsystems.com  --------  http://www.sysarch.com --
-----  Perl Code Review , Architecture, Development, Training, Support ------
--------- Free Perl Training --- http://perlhunter.com/college.html ---------
---------  Gourmet Hot Cocoa Mix  ----  http://bestfriendscocoa.com ---------


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

Date: Thu, 08 May 2008 17:16:06 -0400
From: Sherman Pendley <spamtrap@dot-app.org>
Subject: Re: trailing spaces in unpack("A10")
Message-Id: <m1od7gbip5.fsf@dot-app.org>

Klaus <klaus03@gmail.com> writes:

> use strict;
> use warnings;
> $_ = 'AAA       BBB';
> my $result = unpack("A10", $_);
> print "result = '$result'\n";
>
> This is the output:
> result = 'AAA'
>
> It basically works, but unpack seems to remove trailing spaces.

Have a look at 'perldoc -f pack' - A capital 'A' indicates that the field
will be space-padded. It seems that unpack is doing the opposite, removing
any trailing spaces.

A lowercase 'a' indicates a null-padded string - what happens when you use
that instead?

sherm--

-- 
My blog: http://shermspace.blogspot.com
Cocoa programming in Perl: http://camelbones.sourceforge.net


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

Date: Thu, 8 May 2008 12:29:01 -0700 (PDT)
From: "comp.llang.perl.moderated" <ced@blv-sam-01.ca.boeing.com>
Subject: Re: Why doesn't Perl complain about this bareword?
Message-Id: <1030bb1d-5008-4b8c-9e69-4cbadca7a7f3@z16g2000prn.googlegroups.com>

On May 6, 4:25 am, Ronny <ro.naldfi.sc...@gmail.com> wrote:
> By chance I found out that no error is issued on the following
> program:
>
> perl -w -e 'use strict; print(Does::Not::Exist,"\n")'
>
> Instead, "Does::Not::Exist" is printed. Shouldn't there be a warning
> about
> the improper use of a bareword? Similarily, the program
>
> perl -w -e 'use strict; system(Does::Not::Exist,"\n")'
>
> results in the message
>
> Can't exec "Does::Not::Exist": No such file or directory at -e line 1.

>
> which too seems to suggest that Does::Not::Exist is simply interpreted
> as string.
> But when I use it like this:
>
> perl -w -e 'use strict; print(ref(Does::Not::Exist),"\n")'
>
> I get the more reasonable:
>
> Bareword "Does::Not::Exist" not allowed while "strict subs" in use at -
> e line 1.
>
> Why is this bareword treated differently in these contexts?
>

Perl appears to failover to a literal string interpretation only if
the
package definition doesn't exist:

  $ perl  -wle 'sub Does::Not::Exist{"foo"};system(Does::Not::Exist)'
  Can't exec "foo": No such file or directory at -e line 1.

  and,

  $ perl  -le '*Does::Not::Exist=\*STDOUT;print(Does::Not::Exist
"foo")'
  foo


But, then, maybe unexpectedly:

  $ perl  -wle '*Does::Not::Exist=
\*STDOUT;print(Does::Not::Exist,"foo")'
  Does::Not::Existfoo

whereas, the expected behavior might be:

  No comma allowed after filehandle at -e line 1

  vs:

  $ perl -le '*foo=*STDOUT;print( STDOUT, "foo")'
  No comma allowed after filehandle at -e line 1.


--
Charles DeRykus


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

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


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