[24953] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 7203 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Oct 3 06:06:53 2004

Date: Sun, 3 Oct 2004 03:05:09 -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           Sun, 3 Oct 2004     Volume: 10 Number: 7203

Today's topics:
    Re: Can't compile (perlcc) both Net::FTP and Config::In <tintin@invalid.invalid>
    Re: Can't compile (perlcc) both Net::FTP and Config::In <kalinaubears@iinet.net.au>
    Re: Custom Perl Scripting <tintin@invalid.invalid>
    Re: Custom Perl Scripting <Joe.Smith@inwap.com>
    Re: How to test if I got Mod_Perl in apache? <nospam@bigpond.com>
    Re: How to test if I got Mod_Perl in apache? <asdf@asdfsadf.com>
    Re: How to test if I got Mod_Perl in apache? <nospam@bigpond.com>
    Re: How to test if I got Mod_Perl in apache? <asdf@asdfsadf.com>
    Re: How to test if I got Mod_Perl in apache? <spamtrap@dot-app.org>
    Re: Is PHP still slower than Perl? <dougd99@XXXXremovetheXearthlink.net>
    Re: Is PHP still slower than Perl? <vilain@spamcop.net>
    Re: Is PHP still slower than Perl? <chernyshevsky@hotmail.com>
    Re: Is PHP still slower than Perl? <asdf@asdfsadf.com>
    Re: Is PHP still slower than Perl? <asdf@asdfsadf.com>
    Re: Is PHP still slower than Perl? <spamtrap@dot-app.org>
    Re: Is PHP still slower than Perl? <shawn.corey@sympatico.ca>
    Re: Is PHP still slower than Perl? <shawn.corey@sympatico.ca>
    Re: Is PHP still slower than Perl? <tony@NOSPAM.demon.co.uk>
    Re: Is PHP still slower than Perl? <spamtrap@dot-app.org>
    Re: removing empty split() fields <tadmc@augustmail.com>
    Re: Syntax appears inconsistent - why is this? <tadmc@augustmail.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Sun, 3 Oct 2004 14:56:52 +1300
From: "Tintin" <tintin@invalid.invalid>
Subject: Re: Can't compile (perlcc) both Net::FTP and Config::IniFiles at the same time
Message-Id: <2s94heF1ij1b6U1@uni-berlin.de>


"Thomas Watson Steen" <usenet@m-me.dk> wrote in message 
news:415ebc29$0$109$65c69314@mercury.nildram.net...
>I am using Cygwin on a Windows XP box. I'm running perlcc from the Cygwin 
>shell. I am using perl v5.8.5 built for cygwin-thread-multi-64int. The 
>command I am executing to compile is "perlcc -o tst.exe tst.pl".
>
> When trying to compile a perl file only containing the following two use 
> statements the compiler (perlcc) just runs for what seems forever (filling 
> up huge amounts of memory):
>
> use Net::FTP;
> use Config::IniFiles;
>
> When compiling a file the only contains one of the above use statements 
> the compile completes sucessfully.
>
> Any ideas on how to get arround this?

Notice the documentation for perlcc says:

       The code generated in this way is not guaranteed to work. The whole
       codegen suite ("perlcc" included) should be considered very 
experimen-
       tal. Use for production purposes is strongly discouraged.




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

Date: Sun, 03 Oct 2004 17:13:50 +1000
From: Sisyphus <kalinaubears@iinet.net.au>
Subject: Re: Can't compile (perlcc) both Net::FTP and Config::IniFiles at the same time
Message-Id: <415fa7e6$0$1290$5a62ac22@per-qv1-newsreader-01.iinet.net.au>

Thomas Watson Steen wrote:

> 
> Any ideas on how to get arround this?
> 

Yes - use the PAR module's pp utility instead of perlcc.

Cheers,
Rob

-- 
To reply by email u have to take out the u in kalinaubears.



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

Date: Sun, 3 Oct 2004 14:59:08 +1300
From: "Tintin" <tintin@invalid.invalid>
Subject: Re: Custom Perl Scripting
Message-Id: <2s94lmF1g7ttpU1@uni-berlin.de>


"Perl Newbie" <lsmsintelligence@hotmail.com> wrote in message 
news:1096743493.454729.47530@h37g2000oda.googlegroups.com...
>I am trying to set up a webpage that uses four frames in a frameset:
> the top frame (most important links), the left-hand frame (other
> links), the center frame (bloxom post material), and the right-hand
> frame (links specifict to which part of my site you are in).  I am
> trying to figure out if and how I can write a Perl script that would
> tell the browser which page to display in the right-hand frame  based
> on the page being displayed in the center frame.  Can someone help me
> on this one?

The Perl answer to your question is to use the print function.

Seriously, you need to breakdown the problem into the various components and 
work out which part is responsible for doing what you need. 




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

Date: Sun, 03 Oct 2004 08:57:40 GMT
From: Joe Smith <Joe.Smith@inwap.com>
Subject: Re: Custom Perl Scripting
Message-Id: <4aP7d.160514$MQ5.18569@attbi_s52>

Perl Newbie wrote:

> how I can write a Perl script that would
> tell the browser which page to display in the right-hand frame  based
> on the page being displayed in the center frame.

That's something you can do with static HTML and JavaScript.
Perl is not necessary do to that.
	-Joe


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

Date: Sun, 03 Oct 2004 11:08:22 +1000
From: Gregory Toomey <nospam@bigpond.com>
Subject: Re: How to test if I got Mod_Perl in apache?
Message-Id: <2s91o7F1iau3gU1@uni-berlin.de>

@ wrote:

> Is there any way to tell if mod_perl is installed in apache? I am using a
> shared account. No root access.

You probably can't if if have a shared account. As root, you need to type
type 'httpd -l ' and look for mode_perl.

And you will need to modify httpd.conf, which you probably cant do either.

Try a cheap VPS at www.linode.com or similar.

gtoomey


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

Date: Sat, 2 Oct 2004 23:16:27 -0400
From: "@" <asdf@asdfsadf.com>
Subject: Re: How to test if I got Mod_Perl in apache?
Message-Id: <6o6dna0Sipa68sLcRVn-vw@rogers.com>

> > Is there any way to tell if mod_perl is installed in apache? I am using
a
> > shared account. No root access.
>
> You probably can't if if have a shared account. As root, you need to type
> type 'httpd -l ' and look for mode_perl.
>
> And you will need to modify httpd.conf, which you probably cant do either.
>
> Try a cheap VPS at www.linode.com or similar.
>
> gtoomey

However, PHP is included in the HTTP header. I thought if Mod_perl is
included, it should say something.

Another idea. Is there a program which will have different results in
mod_perl or none. Then I can test it with this script.




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

Date: Sun, 03 Oct 2004 15:34:28 +1000
From: Gregory Toomey <nospam@bigpond.com>
Subject: Re: How to test if I got Mod_Perl in apache?
Message-Id: <2s9hb4F1gt6fnU2@uni-berlin.de>

@ wrote:

>> > Is there any way to tell if mod_perl is installed in apache? I am using
> a
>> > shared account. No root access.
>>
>> You probably can't if if have a shared account. As root, you need to type
>> type 'httpd -l ' and look for mode_perl.
>>
>> And you will need to modify httpd.conf, which you probably cant do
>> either.
>>
>> Try a cheap VPS at www.linode.com or similar.
>>
>> gtoomey
> 
> However, PHP is included in the HTTP header. I thought if Mod_perl is
> included, it should say something.
> 
> Another idea. Is there a program which will have different results in
> mod_perl or none. Then I can test it with this script.

If Apache does not say 'mod_perl' in  the headers it is unlikely to be
installed.

You really need root access to configure mod_perl.

gtoomey


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

Date: Sun, 3 Oct 2004 03:47:37 -0400
From: "@" <asdf@asdfsadf.com>
Subject: Re: How to test if I got Mod_Perl in apache?
Message-Id: <RsydnT2_CfwoM8LcRVn-tQ@rogers.com>

> @ wrote:
>
> >> > Is there any way to tell if mod_perl is installed in apache? I am
using
> > a
> >> > shared account. No root access.
> >>
> >> You probably can't if if have a shared account. As root, you need to
type
> >> type 'httpd -l ' and look for mode_perl.
> >>
> >> And you will need to modify httpd.conf, which you probably cant do
> >> either.
> >>
> >> Try a cheap VPS at www.linode.com or similar.
> >>
> >> gtoomey
> >
> > However, PHP is included in the HTTP header. I thought if Mod_perl is
> > included, it should say something.
> >
> > Another idea. Is there a program which will have different results in
> > mod_perl or none. Then I can test it with this script.
>
> If Apache does not say 'mod_perl' in  the headers it is unlikely to be
> installed.
>
> You really need root access to configure mod_perl.
>
> gtoomey

I agree. That is one server shows it
2004-10-03 03:41:30.401 Server: Apache/1.3.28 (Unix) PHP/4.3.3 mod_perl/1.28
mod_ssl/2.8.15 OpenSSL/0.9.7c
Another does not:
2004-10-03 03:42:59.700 Server: Apache/1.3.31 (Unix) mod_gzip/1.3.26.1a
mod_auth_passthrough/1.8 mod_log_bytes/1.2 mod_bwlimited/1.4 PHP/4.3.8
FrontPage/5.0.2.2634a mod_ssl/2.8.19 OpenSSL/0.9.7a
Here is mine:
2004-10-03 03:44:17.782 Server: Apache/1.3.29 (Unix)
However, mine does have PHP, so it is very possible that the Apache is set
up not to say anything about those added headers.

So I am still looking for a script to test it.






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

Date: Sun, 03 Oct 2004 04:22:59 -0400
From: Sherm Pendley <spamtrap@dot-app.org>
Subject: Re: How to test if I got Mod_Perl in apache?
Message-Id: <P5GdnagxHNh-K8LcRVn-pA@adelphia.com>

@ wrote:

> I agree.

Gregory was not giving you an opinion, he was informing you of a fact. 
Good of you to agree with the facts though.

> Here is mine:
> 2004-10-03 03:44:17.782 Server: Apache/1.3.29 (Unix)

Your server does not have mod_perl installed. See how easy that was?

> However, mine does have PHP, so it is very possible that the Apache is set
> up not to say anything about those added headers.

Possible? Sure, anything's possible - including little green men on 
Mars. But I won't bet on that, or on your server having mod_perl and not 
reporting it.

> So I am still looking for a script to test it.

Why? Just ask your hosting provider, and they'll tell you that you don't 
have it.

So what's got your panties in a bunch over mod_perl? Between this series 
of posts, and the other ones in the "PHP vs. Perl" thread, I highly 
doubt you'll be able to make effective use of it anyway.

It's not a simple matter of just sprinkling your site with some sort of 
"magic mod_perl dust" and making it go faster - for any chance at *real* 
improvement, you have to write your scripts with mod_perl in mind, and 
optimize them to take advantage of the persistent environment.

sherm--

-- 
Cocoa programming in Perl: http://camelbones.sourceforge.net
Hire me! My resume: http://www.dot-app.org


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

Date: Sun, 03 Oct 2004 02:52:58 GMT
From: Doug <dougd99@XXXXremovetheXearthlink.net>
Subject: Re: Is PHP still slower than Perl?
Message-Id: <eQJ7d.2044$gs1.1994@newsread2.news.atl.earthlink.net>



@ wrote:

> C. I don't know why it is not popular. It should be. Maybe those Web
> inventors always thought in Linux so they never wanted to push something
> binary so they selected Perl, a slower scripting.

Why don't you try assembly!!!! I bet you can get that to be running even 
faster than C!!!

good luck,
-d


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

Date: Sat, 02 Oct 2004 21:01:12 -0700
From: "Michael Vilain <vilain@spamcop.net>"
Subject: Re: Is PHP still slower than Perl?
Message-Id: <vilain-6975D5.21011202102004@comcast.dca.giganews.com>

In article <Xns9576C5FB187DCcastleamber@130.133.1.4>,
 John Bokma <postmaster@castleamber.com> wrote:

> "Tony Marston" <tony@NOSPAM.demon.co.uk> wrote in
> news:cjmr56$kjq$1$8300dec7@news.demon.co.uk: 
> 
> > 
> > "John Bokma" <postmaster@castleamber.com> wrote in message 
> > news:Xns957679BFC204Bcastleamber@130.133.1.4...
> >> "@" <asdf@asdfsadf.com> wrote in
> >> news:hOSdnRvNILPWwsPcRVn-jw@rogers.com: 
> >>
> >>> A benchmark in 2002 showed PHP is much slower in shell or when
> >>> Apache has Mod_Perl.
> >>>
> >>> With the new PHP kissing Java's ass, Perl is once again the #1 CGI
> >>> choice.
> >>
> >> For me Perl is #1 (if possible) because PHP is probably the worst
> >> designed language ever. I am not sure if you can already prepare
> >> statements (MySQL),
> > 
> > Yes you CAN use prepare statemetnts with MySQL.
> > You should be aware
> > that this is a MySQL feature, not a PHP feature.
> 
> How can I use it from PHP?

Buy one of the many PHP books that mentions building sites and using 
MySQL.  O'Reilly has PROGRAMMING PHP, which I used to develop my site.  
There are others, which I leave to you to investigate.

If you're to strapped for funds to buy something, there's

http://www.php.net/manual/en/

> 
> >> something I used in Perl ages ago, or still have to use all those
> >> whatsamacalled_quote_shebang garbage.
> > 
> > If you don't like PHP then why are you posting to the PHP newsgroup?
> 
> Look at the headers, this has been crossed to a Perl group. Besides, I 
> hope the PHP group isn't only there for people who say it's a great 
> language? (which it isn't).

One thing I'm unconvinced of is security.  With database applications, I 
have to put passwords to the database inside php scripts and they have 
to be readable by the web server which runs under the nobody UID.  
Instead, I chose to do parts of my site with Perl CGI and CGIwrap.  This 
allows me to protect the files from group or other access as these 
scripts run as my account's UID.  

I found recently that you can put such files outside of the server's 
DOCUMENT ROOT and get access through the php include_path global, but 
the web server still needs access to the file.

One thing I like about php is that each script is stored in the usual 
place in the user's document directory.  The files are executed and the 
output is displayed without having to put everything in the ScriptAlias 
directory (usually cgi-bin).

While php has PEAR, a depository for additional libraries written by 
others, perl has CPAN which is at least 2 orders of magnitude larger and 
more diverse.  There's also lots of network and system-level things you 
can do with perl and usually someone's already done it in a CPAN module.

This thread is about as enlightening as "which car is better".  It all 
depends on where and how you're trying to get there.

-- 
DeeDee, don't press that button!  DeeDee!  NO!  Dee...





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

Date: Sun, 3 Oct 2004 02:12:19 -0400
From: "Chung Leong" <chernyshevsky@hotmail.com>
Subject: Re: Is PHP still slower than Perl?
Message-Id: <qJSdndBGp455BcLcRVn-ug@comcast.com>

"Doug" <dougd99@XXXXremovetheXearthlink.net> wrote in message
news:eQJ7d.2044$gs1.1994@newsread2.news.atl.earthlink.net...
>
>
> @ wrote:
>
> > C. I don't know why it is not popular. It should be. Maybe those Web
> > inventors always thought in Linux so they never wanted to push something
> > binary so they selected Perl, a slower scripting.
>
> Why don't you try assembly!!!! I bet you can get that to be running even
> faster than C!!!
>
> good luck,
> -d

And I heard that you can get great performance by designing your own
silicon.




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

Date: Sun, 3 Oct 2004 03:52:57 -0400
From: "@" <asdf@asdfsadf.com>
Subject: Re: Is PHP still slower than Perl?
Message-Id: <UfKdna5bOItrMsLcRVn-sw@rogers.com>

> One thing I'm unconvinced of is security.  With database applications, I
> have to put passwords to the database inside php scripts and they have
> to be readable by the web server which runs under the nobody UID.
> Instead, I chose to do parts of my site with Perl CGI and CGIwrap.  This
> allows me to protect the files from group or other access as these
> scripts run as my account's UID.

Could you tell me how others can read your files? If you set PHP as 604?

In perl's case, if I set it as 755, does it allow everyone to read the
script? Should I set it as 705?




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

Date: Sun, 3 Oct 2004 03:55:35 -0400
From: "@" <asdf@asdfsadf.com>
Subject: Re: Is PHP still slower than Perl?
Message-Id: <auudnUvfBNUOLcLcRVn-vA@rogers.com>

> > One thing I'm unconvinced of is security.  With database applications, I
> > have to put passwords to the database inside php scripts and they have
> > to be readable by the web server which runs under the nobody UID.
> > Instead, I chose to do parts of my site with Perl CGI and CGIwrap.  This
> > allows me to protect the files from group or other access as these
> > scripts run as my account's UID.
>
> Could you tell me how others can read your files? If you set PHP as 604?
>
> In perl's case, if I set it as 755, does it allow everyone to read the
> script? Should I set it as 705?
>

I think as long as the directory is set as 400 then nobody will be able to
get access to any of your files, regardless how they set mod on them




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

Date: Sun, 03 Oct 2004 04:36:06 -0400
From: Sherm Pendley <spamtrap@dot-app.org>
Subject: Re: Is PHP still slower than Perl?
Message-Id: <frCdncjZXcZqJMLcRVn-sA@adelphia.com>

@ wrote:

> Could you tell me how others can read your files? If you set PHP as 604?

What is "set PHP as 604" supposed to mean? Are you referring to setting 
the permissions on *.php files?

If that's what you mean, please read any basic introduction to UNIX. 604 
makes a file readable and writable by its owner, and readable by any 
other user.

> In perl's case

File permissions are language-independent. A file that's readable for 
Perl is readable for PHP, is readable for Java, is readable for C, etc.

Michael is referring to a server configuration that will run CGIs with 
the permissions of the CGI's owner, instead of running them as "nobody". 
That way, you don't have to make anything world readable - you can make 
sensitive files 0600, and the CGI will be able to read them.

> Should I set it as 705?

No. You should read a good basic introduction to UNIX, concentrating on 
the section(s) about file permissions and ownership. That way you'll 
know what these numbers mean, and you won't have to throw them around at 
random.

sherm--

-- 
Cocoa programming in Perl: http://camelbones.sourceforge.net
Hire me! My resume: http://www.dot-app.org


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

Date: Sun, 03 Oct 2004 04:32:39 -0400
From: Shawn Corey <shawn.corey@sympatico.ca>
Subject: Re: Is PHP still slower than Perl?
Message-Id: <HNO7d.8$jj2.3758@news20.bellglobal.com>

@ wrote:
>>In perl's case, if I set it as 755, does it allow everyone to read the
>>script? Should I set it as 705?
>>
> 
> 
> I think as long as the directory is set as 400 then nobody will be able to
> get access to any of your files, regardless how they set mod on them
> 
> 

The files should be set to o=r,go= (400) or u=rw,go= (600). The 
directory they are in should be u=rx,go= (500) or u=rwx,go= (700). 
Directories must be executable to read the inode. The inode stores, 
among other things, the sectors where the file contents are.

Perl modules should be placed in a directory not accessible by the 
server. Perl can access them by using 'use lib' to add the path to the 
library directory list (see perldoc lib). The permission on the modules 
should be u=rx,go= (500) and the first line:

#!/

This means if the server accesses the file, it will try to execute it 
and fail, making it impossible for it to display the code. This is 
important if you are under the obligation of not exposing the code to 
the public.

	--- Shawn


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

Date: Sun, 03 Oct 2004 04:46:42 -0400
From: Shawn Corey <shawn.corey@sympatico.ca>
Subject: Re: Is PHP still slower than Perl?
Message-Id: <R_O7d.9$jj2.4057@news20.bellglobal.com>

Sherm Pendley wrote:
> If that's what you mean, please read any basic introduction to UNIX. 604 
> makes a file readable and writable by its owner, and readable by any 
> other user.

Not so, users in the same group cannot read, write or execute the files. 
UNIX check only the user's permissions if you are the user, only the 
group's permissions if you are in that group and only the other's 
permissions if you are not the user or in the group. No cross sharing of 
permissions.

	--- Shawn


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

Date: Sun, 3 Oct 2004 10:13:37 +0100
From: "Tony Marston" <tony@NOSPAM.demon.co.uk>
Subject: Re: Is PHP still slower than Perl?
Message-Id: <cjofs2$sa9$1$830fa795@news.demon.co.uk>


"John Bokma" <postmaster@castleamber.com> wrote in message 
news:Xns9576C5FB187DCcastleamber@130.133.1.4...
> "Tony Marston" <tony@NOSPAM.demon.co.uk> wrote in
> news:cjmr56$kjq$1$8300dec7@news.demon.co.uk:
>
>>
>> "John Bokma" <postmaster@castleamber.com> wrote in message
>> news:Xns957679BFC204Bcastleamber@130.133.1.4...
>>> "@" <asdf@asdfsadf.com> wrote in
>>> news:hOSdnRvNILPWwsPcRVn-jw@rogers.com:
>>>
>>>> A benchmark in 2002 showed PHP is much slower in shell or when
>>>> Apache has Mod_Perl.
>>>>
>>>> With the new PHP kissing Java's ass, Perl is once again the #1 CGI
>>>> choice.
>>>
>>> For me Perl is #1 (if possible) because PHP is probably the worst
>>> designed language ever. I am not sure if you can already prepare
>>> statements (MySQL),
>>
>> Yes you CAN use prepare statemetnts with MySQL.
>> You should be aware
>> that this is a MySQL feature, not a PHP feature.
>
> How can I use it from PHP?

http://dev.mysql.com/tech-resources/articles/4.1/prepared-statements.html

>>> something I used in Perl ages ago, or still have to use all those
>>> whatsamacalled_quote_shebang garbage.
>>
>> If you don't like PHP then why are you posting to the PHP newsgroup?
>
> Look at the headers, this has been crossed to a Perl group. Besides, I
> hope the PHP group isn't only there for people who say it's a great
> language? (which it isn't).

I don't waste my time posting to a Microsoft newsgroup saying that all MS 
products suck (otherwise I'd never get anything done), so what makes you (or 
anyone else) think that you can post such comments to this group without 
getting an animated response.

You may think that Perl is better than PHP (what is your justification?) and 
as it is still a free country (that is until President Blair finishes 
screwing up the constitution) it is your God-given right to hold that 
opinion. I think you are wrong, but it is still your right.

-- 
Tony Marston

http://www.tonymarston.net





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

Date: Sun, 03 Oct 2004 05:50:10 -0400
From: Sherm Pendley <spamtrap@dot-app.org>
Subject: Re: Is PHP still slower than Perl?
Message-Id: <ceydnTY-WMDOVsLcRVn-gA@adelphia.com>

Shawn Corey wrote:

> Not so, users in the same group cannot read, write or execute the files. 
> UNIX check only the user's permissions if you are the user, only the 
> group's permissions if you are in that group and only the other's 
> permissions if you are not the user or in the group.

That's not a safe assumption to make. My Debian Linux machine behaves as 
you describe - if I disable group access for my group, but leave world 
access enabled, I cannot read the file.

But My Mac OS X machine behaves differently. On that, access to a file 
is granted if you have *any* means of doing so, whether it's by virtue 
of owning the file, belonging to the correct group, or by way of the 
"other user" permissions.

I don't know if what I'm seeing here is specific to Mac OS X, to HFS+, 
or shared with any other BSD* variants. Although to me, it makes more 
sense than what I'm seeing on Linux.

The traditional security mindset is to deny access by default (other), 
and grant access only to specific users (group). This is what's enforced 
on my Mac - if you want to deny anyone access to a file, you first have 
to deny *everyone* access via other permissions, and then decide what 
specific users to allow via group permissions.

Linux file permissions allow the opposite mindset as well - granting 
access by default (other), while denying specific users (group). An 
"allow by default" security mindset is not, in my opinion, a Good Thing.

sherm--

-- 
Cocoa programming in Perl: http://camelbones.sourceforge.net
Hire me! My resume: http://www.dot-app.org


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

Date: Sat, 2 Oct 2004 20:56:25 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: removing empty split() fields
Message-Id: <slrnclun29.2hj.tadmc@magna.augustmail.com>

dutone <dutone@hotmail.com> wrote:
> Tad McClellan <tadmc@augustmail.com> wrote in message news:<slrncls0n6.20i.tadmc@magna.augustmail.com>...
>> dutone <dutone@hotmail.com> wrote:
>> > sample file:
>> >  +123n
>> > blah blah blah
>> > +123+
>> > more blah

[snip]

> In my sample file '+123' is the first line, no
> spaces , tabs etc...  above it.


That isn't what was in the sample file that you showed to us.

In our data there _is_ a space in the first field.

Please post a short and complete program that *we can run*
that illustrates the problem you are trying to solve.

Do you know how to use the __DATA__ token to include file contents
in your source code file?

(If not, have you seen the Posting Guidelines that are posted here frequently?)


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


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

Date: Sat, 2 Oct 2004 20:36:09 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Syntax appears inconsistent - why is this?
Message-Id: <slrncluls9.2hj.tadmc@magna.augustmail.com>

John W. Kennedy <jwkenne@attglobal.net> wrote:
> Abigail wrote:
>> Eh, wrong. () seldomly build lists. It certainly doesn't in:
> 
>>     my %hash = (key1 => 'val1', key2 => 'val2');
> 
>> The parens in the above expression play exactly the same role as
>> they do in:
>> 
>>     my $val = 3 * (4 + 5);
> 
> No, 


Whenever I find myself about to say that to Abigail, I take pause
to think about it some more, and end up not needing to say it 
very often.  :-)


> the () /are/ building a list above.  


The documentation for the software that we are using says they
are not.

I take pause twice when I find myself disagreeing with the documentation
that came with the software I'm using.

The "List value constructors" section in perldata.pod is
germane to this discussion:

   List values are denoted by separating individual values by commas
  (and enclosing the list in parentheses where precedence requires it):
                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Darn! Looks like we won't be able to understand it without
following a reference, so off to perlop.pod to find out when
precedence requires it...

   Perl operators have the following associativity and precedence,
   listed from highest precedence to lowest.
   ...
   right       = += -= *= etc.
   left        , =>



> The statement is syntactic 
> sugar 

The "fat comma" is indeed sugar, but I don't think anyone was confused
about that. We have been discussing the role of the parenthesis
in this thread.


> for:
> 
>        my %hash = ('key1', 'val1', 'key2', 'val2');


If we write it without the parenthesis:

   my %hash = 'key1', 'val1', 'key2', 'val2';

we can see from the above precedence table that it will be parsed as:

   (my %hash = 'key1'), 'val1', 'key2', 'val2';

and we don't get the semantic that is needed, just as when we write

   my $val = 3 * 4 + 5;

without parenthesis it is parsed as

   my $val = (3 * 4) + 5;

and we don't get the semantic that is needed.


So, we *do* need parenthesis there, but not because they "form a list",
but because they override the default precedence.


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


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

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


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