[30272] in Perl-Users-Digest
Perl-Users Digest, Issue: 1515 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed May 7 11:10:20 2008
Date: Wed, 7 May 2008 08:09:13 -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 Wed, 7 May 2008 Volume: 11 Number: 1515
Today's topics:
cpan shell and MyConfig.pm problem <ro.naldfi.scher@gmail.com>
Re: Identification of which line causing regex problem <ro.naldfi.scher@gmail.com>
Re: Identification of which line causing regex problem <benkasminbullock@gmail.com>
Re: Identification of which line causing regex problem <rvtol+news@isolution.nl>
Re: Identification of which line causing regex problem <devnull4711@web.de>
Net::SMTP fails hendedav@gmail.com
Re: perl GD Image resolution problem <zentara@highstream.net>
Re: perl GD Image resolution problem <benkasminbullock@gmail.com>
Re: perl PNG image searching <zentara@highstream.net>
Re: perl PNG image searching <benkasminbullock@gmail.com>
Re: Problem with email attachment, 1 becomes 10 <bill@ts1000.us>
Removing HTML from text <bill@ts1000.us>
Re: Removing HTML from text <benkasminbullock@gmail.com>
Re: Removing HTML from text <jurgenex@hotmail.com>
Re: Some sort of scoping problem <ro.naldfi.scher@gmail.com>
state of Erlang? <cartercc@gmail.com>
Re: Why doesn't Perl complain about this bareword? sheinrich@my-deja.com
Re: Why doesn't Perl complain about this bareword? <1usa@llenroc.ude.invalid>
Re: Why doesn't Perl complain about this bareword? sheinrich@my-deja.com
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 7 May 2008 03:31:56 -0700 (PDT)
From: Ronny <ro.naldfi.scher@gmail.com>
Subject: cpan shell and MyConfig.pm problem
Message-Id: <e71040c4-5f85-4266-b07d-d35b1fc384ac@r66g2000hsg.googlegroups.com>
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.
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:
$CPAN::Config->{cpan_home}="$ENV{HOME}/.cpan";
$CPAN::Config->{keep_source_where}=$CPAN::Config->{cpan_home}.'/
sources';
$CPAN::Config->{histfile}=$CPAN::Config->{cpan_home}.'/history';
$CPAN::Config->{build_dir}=$CPAN::Config->{cpan_home}.'/build';
This works fine for download and test, but install still tries to
write the modules into
the Perl installation directory. In addition, I get during install the
error message
sh: /Perl/cpan-autoconfig: not found
What is broken here?
Ronald
------------------------------
Date: Wed, 7 May 2008 04:21:01 -0700 (PDT)
From: Ronny <ro.naldfi.scher@gmail.com>
Subject: Re: Identification of which line causing regex problem
Message-Id: <944e9ab0-c9da-4fca-80f5-e8befa64b478@t54g2000hsg.googlegroups.com>
On 6 Mai, 04:07, Ben Bullock <benkasminbull...@gmail.com> wrote:
> On Tue, 06 May 2008 09:44:32 +0800, Ela wrote:
> > I'm modifying a system (totally more than 100000-lines for tens of
> > files) written by others and would like to identify which line leads to
> > the following problem.
>
> > Invalid [] range "l-c" in regex; marked by <-- HERE in
> > m/^3-oxoacyl-[acyl-c <-- HERE arrier protein] reductase fabg1$/
>
> > Unfortunately the error message does not tell me which line of which
> > file leads to the problem. Could anybody advise?
>
> Just grep for oxoacyl?
This might not help here, unless the regexp is really given literally
(in which case the OP likely would have found it already). I suspect
that there is a string interpolation going on - kind of
m/^${protein_name}$/
In this case, a simple source code search wouldn't be of much help.
Ronald
------------------------------
Date: Wed, 7 May 2008 07:25:56 -0700 (PDT)
From: Ben Bullock <benkasminbullock@gmail.com>
Subject: Re: Identification of which line causing regex problem
Message-Id: <7cf7ed9a-657f-498b-b579-eac45eeb0463@w34g2000prm.googlegroups.com>
On May 7, 8:21 pm, Ronny <ro.naldfi.sc...@gmail.com> wrote:
> On 6 Mai, 04:07, Ben Bullock
> > Just grep for oxoacyl?
>
> This might not help here, unless the regexp is really given literally
> (in which case the OP likely would have found it already). I suspect
> that there is a string interpolation going on - kind of
>
> m/^${protein_name}$/
It's possible, but I don't see the point in speculating without
further information from the original poster. Note that, as I pointed
out in the part of the message you didn't quote, the original poster
claimed he wasn't getting line numbers in the error messages, which
isn't the behaviour of Perl 5.8 or Perl 5.10, or probably any other
version of Perl you could find, so until that is clarified there is
not much else to say about it. Realistically the most likely
explanation is that he somehow missed the line numbers in Perl's error
message.
------------------------------
Date: Wed, 7 May 2008 16:32:59 +0200
From: "Dr.Ruud" <rvtol+news@isolution.nl>
Subject: Re: Identification of which line causing regex problem
Message-Id: <fvslro.1gg.1@news.isolution.nl>
Ela schreef:
> I'm modifying a system (totally more than 100000-lines for tens of
> files) written by others and would like to identify which line leads
> to the following problem.
>
> Invalid [] range "l-c" in regex; marked by <-- HERE in
> m/^3-oxoacyl-[acyl-c <-- HERE arrier protein] reductase fabg1$/
>
> Unfortunately the error message does not tell me which line of which
> file leads to the problem. Could anybody advise?
This is not a runnable and minimal source. Go and read the Posting
Guidelines again.
--
Affijn, Ruud
"Gewoon is een tijger."
------------------------------
Date: Wed, 07 May 2008 16:39:56 +0200
From: Frank Seitz <devnull4711@web.de>
Subject: Re: Identification of which line causing regex problem
Message-Id: <68dtb1F2slnr9U2@mid.individual.net>
Ben Bullock wrote:
> On May 7, 8:21 pm, Ronny <ro.naldfi.sc...@gmail.com> wrote:
>
>>On 6 Mai, 04:07, Ben Bullock
>>
>>>Just grep for oxoacyl?
>>
>>This might not help here, unless the regexp is really given literally
>>(in which case the OP likely would have found it already). I suspect
>>that there is a string interpolation going on - kind of
>>
>> m/^${protein_name}$/
>
> It's possible, but I don't see the point in speculating without
> further information from the original poster. Note that, as I pointed
> out in the part of the message you didn't quote, the original poster
> claimed he wasn't getting line numbers in the error messages, which
> isn't the behaviour of Perl 5.8 or Perl 5.10, or probably any other
> version of Perl you could find, so until that is clarified there is
> not much else to say about it. Realistically the most likely
> explanation is that he somehow missed the line numbers in Perl's error
> message.
The OP expected, strangely enough, the line number
of the input file, not the line number of the source file.
Frank
--
Dipl.-Inform. Frank Seitz; http://www.fseitz.de/
Anwendungen für Ihr Internet und Intranet
Tel: 04103/180301; Fax: -02; Industriestr. 31, 22880 Wedel
------------------------------
Date: Wed, 7 May 2008 08:01:42 -0700 (PDT)
From: hendedav@gmail.com
Subject: Net::SMTP fails
Message-Id: <1ec01e25-107f-455c-b904-0b3fa1fbd57e@z24g2000prf.googlegroups.com>
Gang,
I am trying to use Net::SMTP to send email from a computer and it
fails to send (debug info below). I can take this same script and put
it on another computer and it works just fine. That would tell me
some piece of software isn't installed on the non-working computer,
but I have no idea as to what it may be. I have made sure the files
are the same on both computers that are listed in the "use" statements
at the top of the Net::SMTP module. I am using Debian 3.1 on the one
that works and 4.0 on the one that doesn't work. Any help would
greatly be appreciated.
Thanks,
Dave
Net::SMTP>>> Net::SMTP(2.29)
Net::SMTP>>> Net::Cmd(2.26)
Net::SMTP>>> Exporter(5.58)
Net::SMTP>>> IO::Socket::INET(1.29)
Net::SMTP>>> IO::Socket(1.29)
Net::SMTP>>> IO::Handle(1.25)
Net::SMTP=GLOB(0x82cd2dc)<<< 220 smtp106.biz.mail.re2.yahoo.com ESMTP
Net::SMTP=GLOB(0x82cd2dc)>>> EHLO digital-pipe.com
Net::SMTP=GLOB(0x82cd2dc)<<< 250-smtp106.biz.mail.re2.yahoo.com
Net::SMTP=GLOB(0x82cd2dc)<<< 250-AUTH LOGIN PLAIN XYMCOOKIE
Net::SMTP=GLOB(0x82cd2dc)<<< 250-PIPELINING
Net::SMTP=GLOB(0x82cd2dc)<<< 250 8BITMIME
------------------------------
Date: Wed, 07 May 2008 09:22:13 -0400
From: zentara <zentara@highstream.net>
Subject: Re: perl GD Image resolution problem
Message-Id: <m0b324d1j895ejr0jlkbp68e1ia8b9oguu@4ax.com>
On Tue, 6 May 2008 08:29:09 -0700 (PDT), Zhiliang Hu
<zhilianghu@gmail.com> wrote:
>Many thanks for all your hints. That'll be useful.
I just looked at your sample output, and since it's lines and
text, you could use the Scalable Vector Graphics format, or
.svg
GD has svg output with the module
http://search.cpan.org/~twh/GD-SVG-0.28/SVG.pm
SVG files look like xml, and will change resolution
automatically to adjust to window size.
Google for svg for more info.
zentara
--
I'm not really a human, but I play one on earth.
http://zentara.net/japh.html
------------------------------
Date: Wed, 7 May 2008 07:10:36 -0700 (PDT)
From: Ben Bullock <benkasminbullock@gmail.com>
Subject: Re: perl GD Image resolution problem
Message-Id: <450e3515-222a-4c0c-8f33-f041d36d74f0@w1g2000prd.googlegroups.com>
On May 7, 10:22 pm, zentara <zent...@highstream.net> wrote:
> SVG files look like xml
That's because they are XML.
------------------------------
Date: Wed, 07 May 2008 09:37:32 -0400
From: zentara <zentara@highstream.net>
Subject: Re: perl PNG image searching
Message-Id: <blb324t9ilinko2ct7qf3f6qpc87mruet6@4ax.com>
On Tue, 6 May 2008 11:02:22 -0700 (PDT), elie <mazzawi@gmail.com> wrote:
>Hello,
>
>so I have some images (all PNG)
>
>I have a small image, ( a checkered box) and other larger images that
>may or may not contain the checkered box small image.
>I want to somehow find out if the small image (the checkered box)
>apprears anywhere in the larger PNG's or not.
>
>any hits would be appreciated.
>
>Regards,
This is just a brainstorm, :-)
but you might be able to do some sort
of binary regex search of the larger images. You would have to strip
off the png header of the smaller image.
The problem, is that the smaller image will not be contained as a linear
string in the larger image.
What you might do, is break the larger image into "binary lines"
depending on it's resolution. Then do the same thing for the
smaller image.
Then a fast go/no-go test would be to seach each binary line of the
large image for the first non-header binary line of the smaller one.
If a first line match is found, then continue for matching the rest
of the lines.
The only problem left, is to determine if the matches all line up at
the same pixel shift point. Regexes do have the ability to report
the position of the match, so it should be doable.
I'm sorry my regex skills (especially with binary data) is not that
expert, but someone else here may know.
Goodluck,
zentara
--
I'm not really a human, but I play one on earth.
http://zentara.net/japh.html
------------------------------
Date: Wed, 7 May 2008 23:41:38 +0900
From: "Ben Bullock" <benkasminbullock@gmail.com>
Subject: Re: perl PNG image searching
Message-Id: <fvsf39$oje$1@ml.accsnet.ne.jp>
"zentara" <zentara@highstream.net> wrote in message
news:blb324t9ilinko2ct7qf3f6qpc87mruet6@4ax.com...
> This is just a brainstorm, :-)
> but you might be able to do some sort
> of binary regex search of the larger images. You would have to strip
> off the png header of the smaller image.
As far as I know, PNG is a compressed format, so it's not possible to access
the actual pixel data just by "stripping off the png header".
------------------------------
Date: Wed, 7 May 2008 04:14:16 -0700 (PDT)
From: Bill H <bill@ts1000.us>
Subject: Re: Problem with email attachment, 1 becomes 10
Message-Id: <c0db2605-7c64-4d39-bbe2-544e11720c3f@a70g2000hsh.googlegroups.com>
On May 4, 9:07=A0pm, "M.O.B. i L." <mika...@df.lth.se> wrote:
> for my $row (@$as) {
> =A0 =A0 =A0my $body_text =3D $settings{BODY};
> =A0 =A0 =A0$body_text =3D~ s/\$cCompany/$row->{cCompany}/g;
> =A0 =A0 =A0my $email =3D Email::Simple->create(
> =A0 =A0 =A0 =A0 =A0header =3D> [
> =A0 =A0 =A0 =A0 =A0 =A0 =A0From =A0 =A0 =A0 =A0 =A0 =3D> $settings{FROM},
> =A0 =A0 =A0 =A0 =A0 =A0 =A0To =A0 =A0 =A0 =A0 =A0 =A0 =3D> $row->{cEmail},=
> =A0 =A0 =A0 =A0 =A0 =A0 =A0Subject =A0 =A0 =A0 =A0=3D> encode_mimewords( $=
settings{SUBJECT} ),
> =A0 =A0 =A0 =A0 =A0 =A0 =A0'Content-Type' =3D> 'text/plain; charset=3D"utf=
-8"',
> =A0 =A0 =A0 =A0 =A0],
> =A0 =A0 =A0 =A0 =A0body =3D> $body_text,
> =A0 =A0 =A0);
> =A0 =A0 =A0my $body =3D load( $settings{UPLDDIR}, $settings{FILE} );
> =A0 =A0 =A0my $part =3D Email::MIME->new('');
> =A0 =A0 =A0$part->body_set($body);
> =A0 =A0 =A0$part->disposition_set('attachment');
> =A0 =A0 =A0$part->name_set( $settings{FILE} ); =A0 =A0 =A0 =A0# Both neede=
d?
> =A0 =A0 =A0$part->filename_set( $settings{FILE} ); =A0 =A0# Both needed?
> =A0 =A0 =A0$part->encoding_set('base64');
> =A0 =A0 =A0$part->content_type_set('application/octet-stream');
> =A0 =A0 =A0my @more_parts =3D ($part);
> =A0 =A0 =A0$email =3D Email::MIME->new( $email->as_string );
> =A0 =A0 =A0$email->parts_add( \@more_parts );
>
> =A0 =A0 =A0eval { $mailer->send($email) };
> =A0 =A0 =A0die "Error sending email: $@" if $@;
I think your issue has to do with the "more_parts".
Bill H
------------------------------
Date: Wed, 7 May 2008 03:29:24 -0700 (PDT)
From: Bill H <bill@ts1000.us>
Subject: Removing HTML from text
Message-Id: <6a027206-cabd-4cd2-9ea1-39c86135a4b3@s50g2000hsb.googlegroups.com>
I am looking for a perl routine that will strip HTML from a text file
and allow me to setup exceptions. For example, remove all HTML except
<B> <I> <U> <P> and their close tags, and optionally (preferably)
clean up any <P> tags so that contain just <P ALIGN="LEFT"> (or right
or center).
Is there such a beast out there before I write my own code?
Bill H
------------------------------
Date: Wed, 7 May 2008 11:08:22 +0000 (UTC)
From: Ben Bullock <benkasminbullock@gmail.com>
Subject: Re: Removing HTML from text
Message-Id: <fvs2j6$lo0$1@ml.accsnet.ne.jp>
On Wed, 07 May 2008 03:29:24 -0700, Bill H wrote:
> I am looking for a perl routine that will strip HTML from a text file
> and allow me to setup exceptions. For example, remove all HTML except
> <B> <I> <U> <P> and their close tags, and optionally (preferably) clean
> up any <P> tags so that contain just <P ALIGN="LEFT"> (or right or
> center).
>
> Is there such a beast out there before I write my own code?
The place to look is http://search.cpan.org/.
------------------------------
Date: Wed, 07 May 2008 12:18:35 GMT
From: Jürgen Exner <jurgenex@hotmail.com>
Subject: Re: Removing HTML from text
Message-Id: <p77324917vgfb1ouqombb3li98hqi542nh@4ax.com>
Bill H <bill@ts1000.us> wrote:
>I am looking for a perl routine that will strip HTML from a text file
>and allow me to setup exceptions. For example, remove all HTML except
Your Question is Asked Frequently: perldoc -q "remove HTML"
><B> <I> <U> <P> and their close tags, and optionally (preferably)
>clean up any <P> tags so that contain just <P ALIGN="LEFT"> (or right
>or center).
You can define any custom action (remove or retain or whatever you like)
for any HTML element.
jue
------------------------------
Date: Wed, 7 May 2008 04:45:15 -0700 (PDT)
From: Ronny <ro.naldfi.scher@gmail.com>
Subject: Re: Some sort of scoping problem
Message-Id: <b0708f94-635b-42c7-b38d-b0597c443c96@25g2000hsx.googlegroups.com>
On 6 Mai, 03:04, Mintcake <t...@skelding.co.uk> wrote:
> package Foo;
>
> my @xyzzy = (1,2,3);
>
> sub new {
> my $self = bless {}, shift;
> $self->ini('xyzzy');
> print \@xyzzy, ' ', scalar @xyzzy;
> print $self->{xyzzy}, ' ', scalar @{$self->{xyzzy}};
>
> }
>
> sub ini {
> my ($self, $field) = @_;
> eval "\$self->{$field} = \\\@$field";
>
> }
>
> 1;
> My main program is simply this:
>
> #!/usr/local/bin/perl -l
> use Foo;
> new Foo;
>
> The two lines of output are:
>
> ARRAY(0x90edda4) 3
> ARRAY(0x90edfcc) 0
First I run your program with
use warnings;
enabled, and here I got the message:
Variable "@xyzzy" is not available at (eval 1) line 2.
Which means @xyzzy can't be seen from within eval. Things are
different if I "use" the variable inside the routine, so that
the compiler can see it - for example by writing
sub ini {
my ($self, $field) = @_;
print "ini: ", \@xyzzy,"\n";
eval "\$self->{$field} = \\\@$field";
}
You can also put the usage after the eval; it is only important
that the variable is used somewhere in the function:
sub ini {
my ($self, $field) = @_;
eval "\$self->{$field} = \\\@$field";
print "ini: ", \@xyzzy,"\n";
}
In both cases, Foo::new will print the same value for the hash.
We learn two things from this:
(1) Perl can be pretty bizarre in its details.
(2) If you do not "use warnings", you are automatically in a state of
sin.
Ronald
------------------------------
Date: Wed, 7 May 2008 06:29:03 -0700 (PDT)
From: cartercc <cartercc@gmail.com>
Subject: state of Erlang?
Message-Id: <f1c9be0d-5479-4db1-9b02-dede35066fc9@l64g2000hse.googlegroups.com>
Please excuse this OT post.
I have had the experience of attempting to implement some wireless
routing protocols (GPSR and AODV) in Java in the past two years, and
the experience hasn't been particularly fulfilling. The ideas are good
but the technology, Java, leaves something to be desired.
Having some spare time, I picked up Joe Armstrong's book 'Programming
Erlang' and have been going through it. When I got to the sections on
concurrent programming, I felt that the floor just dropped from under
me. Having done some significant network programming in Java, I was
rendered breathless at the ease at which the same thing can be done in
Erlang.
Out of curiosity, I checked the job boards (Dice, etc.) for Erlang
jobs, and there seemed to be precious few. Erlang dates from the same
generation as Perl (mid 80s), and has strengths in concurrent,
distributed, and multi-processor programming. It also had an
impressive framework in the OTP.
So ... just wondering ... why isn't Erlang buzzing? Why does it seem
so dead? Is it because it has a reputation of being extremetly
difficult? It's not. Does a language need some sort of critical mass
before it collects a big following? Perl has a large following which
seems to be keeping it up despite the competition (at least accordting
to TIOBE).
Any thoughts on the state of Erlang from the Perl community?
CC
------------------------------
Date: Wed, 7 May 2008 03:51:13 -0700 (PDT)
From: sheinrich@my-deja.com
Subject: Re: Why doesn't Perl complain about this bareword?
Message-Id: <764d756d-1678-422e-b813-7b39dedc0e3b@34g2000hsh.googlegroups.com>
On May 7, 6:31 am, benkasminbull...@gmail.com (Ben Bullock) wrote:
> 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?
>
> It seems to be a bug in Perl.
Even stranger:
scripts>perl -we "use strict; print(Does::Not::Exist);"
Name "Does::Not::Exist" used only once: possible typo at -e line 1.
print() on unopened filehandle Exist at -e line 1.
scripts>
------------------------------
Date: Wed, 07 May 2008 11:45:52 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: Why doesn't Perl complain about this bareword?
Message-Id: <Xns9A974EFA3D2EFasu1cornelledu@127.0.0.1>
sheinrich@my-deja.com wrote in
news:764d756d-1678-422e-b813-7b39dedc0e3b@34g2000hsh.googlegroups.com:
> On May 7, 6:31 am, benkasminbull...@gmail.com (Ben Bullock) wrote:
>> 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?
>>
>> It seems to be a bug in Perl.
>
> Even stranger:
>
> scripts>perl -we "use strict; print(Does::Not::Exist);"
> Name "Does::Not::Exist" used only once: possible typo at -e line 1.
> print() on unopened filehandle Exist at -e line 1.
Note that the issue only arises with print. In the case above,
Does::Not::Exist is being taken to refer to a bareword filehandle Exist
in the package Does::Not. It then seems like print wants to print $_ to
this filehandle.
As such, this treatment *may* be consistent with the following excerpt
from perldoc perldata:
Barewords
A word that has no other interpretation in the grammar will be treated
as if it were a quoted string. These are known as "barewords".
In the case of
print Does::Not::Exist;
there does seem to be a valid interpretation of Does::Not::Exist as a
filehandle if one assumes that $_ is printed.
That interpretation is borne out by the following script:
#!/usr/bin/perl
use strict;
use warnings;
print STDERR while $_ = shift;
__END__
Now, let's go back to
print Does::Not::Exist, "\n";
The comma between Does::Not::Exist and "\n" tells print that
Does::Not::Exist is not a filehandle.
Note the following cases:
C:\t> perl -w -Mstrict -e "print Does,Not,Exist, qq{\n}"
No comma allowed after filehandle at -e line 1.
In this case, Does has a valid interpretation as a
bareword filehandle. Thus, strict does not kick in.
C:\t> perl -w -Mstrict -e "print Does'Not'Exist, qq{\n}"
Does::Not::Exist
Note that ' and :: are equivalent, AFAIK.
C:\t> perl -w -Mstrict -e "print Does-Not-Exist, qq{\n}"
Bareword "Exist" not allowed while "strict subs" in use at -e line 1.
Execution of -e aborted due to compilation errors.
Note no complaint about Does and Not. I don't know why.
C:\t> perl -w -Mstrict -e "print Does+Not+Exist, qq{\n}"
Bareword "Not" not allowed while "strict subs" in use at -e line 1.
Bareword "Exist" not allowed while "strict subs" in use at -e line 1.
Execution of -e aborted due to compilation errors.
Note no complaint about Does. I don't know why.
Again, let's go back to:
C:\t> perl -w -Mstrict -e "print Does::Not::Exist, qq{\n}"
Does::Not::Exist
The comma establishes that Does::Not::Exist is not referring to
filehandle Exist in the package Does::Not.
Recall the excerpt from perldata above. Is there a valid interpretation
of Does::Not::Exist in the current grammar?
I claim that there is. The :: characters in the name establish that it
is the name of a package.
So, it is printed.
Sinan
--
A. Sinan Unur <1usa@llenroc.ude.invalid>
(remove .invalid and reverse each component for email address)
comp.lang.perl.misc guidelines on the WWW:
http://www.rehabitation.com/clpmisc/
------------------------------
Date: Wed, 7 May 2008 07:47:54 -0700 (PDT)
From: sheinrich@my-deja.com
Subject: Re: Why doesn't Perl complain about this bareword?
Message-Id: <41f43d75-d4cb-4633-95a9-e5b76af6a97c@c58g2000hsc.googlegroups.com>
On May 7, 1:45 pm, "A. Sinan Unur" <1...@llenroc.ude.invalid> wrote:
...
> Note the following cases:
>
> C:\t> perl -w -Mstrict -e "print Does,Not,Exist, qq{\n}"
> No comma allowed after filehandle at -e line 1.
>
> In this case, Does has a valid interpretation as a
> bareword filehandle. Thus, strict does not kick in.
>
But why is the first argument being taken here for a filehandle, in
spite of the comma, and not considered as namespace, as in your other
example?
...
>
> Again, let's go back to:
>
> C:\t> perl -w -Mstrict -e "print Does::Not::Exist, qq{\n}"
> Does::Not::Exist
>
> The comma establishes that Does::Not::Exist is not referring to
> filehandle Exist in the package Does::Not.
>
It seems like only Strings containing :: (or ' ) qualify as possible
package names.
Steffen
------------------------------
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 1515
***************************************