[28516] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 9880 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Oct 23 11:05:52 2006

Date: Mon, 23 Oct 2006 08:05:07 -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           Mon, 23 Oct 2006     Volume: 10 Number: 9880

Today's topics:
        "Did not find leading dereferencer" - new findings to a <ronaldf@eml.cc>
    Re: "Did not find leading dereferencer" - new findings  <bol@adv.magwien.gv.at>
    Re: ability to match / detect acronyms ? anno4000@radom.zrz.tu-berlin.de
    Re: can Perl detect / match unicode characters <scobloke2@infotop.co.uk>
        exit a Net:telnet connection <pdc124@yahoo.co.uk>
    Re: exit a Net:telnet connection <mark.clementsREMOVETHIS@wanadoo.fr>
    Re: exit a Net:telnet connection <pdc124@yahoo.co.uk>
    Re: exit a Net:telnet connection <mark.clementsREMOVETHIS@wanadoo.fr>
    Re: FTP to a windows file share? <scobloke2@infotop.co.uk>
        Soap Server in perl <kunanu@gmail.com>
    Re: Soap Server in perl <scobloke2@infotop.co.uk>
    Re: Soap Server in perl <kunanu@gmail.com>
    Re: Soap Server in perl <scobloke2@infotop.co.uk>
    Re: Soap Server in perl <kunanu@gmail.com>
    Re: string substitution for a file, without replacing p <bik.mido@tiscalinet.it>
    Re: Switch module misbehavior <graffiti@yahoo.com>
    Re: Trying to get past code error in Perl book I'm lear <tadmc@augustmail.com>
    Re: Trying to get past code error in Perl book I'm lear <uri@stemsystems.com>
        Why I no longer use Perl strenholme.usenet@gmail.com
    Re: Why I no longer use Perl <aukjan@vanbelkum.no.spam.nl>
    Re: Why I no longer use Perl <mgarrish@gmail.com>
    Re: Why I no longer use Perl <aukjan@vanbelkum.no.spam.nl>
    Re: Why I no longer use Perl <rvtol+news@isolution.nl>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Mon, 23 Oct 2006 14:08:54 +0200
From: Ronald Fischer <ronaldf@eml.cc>
Subject: "Did not find leading dereferencer" - new findings to an old puzzle
Message-Id: <1161605334.46@user.newsoffice.de>

In this ng was repeatedly discussed the strange error message "Did not 
find
leading dereferencer", which nobody really seems to be able to explain. 
Some
people seem to suggest that this happens when prototyped functions are
incorrectly called, and indeed this helped me when I had this problem 
last
time.

The *general* reason seems to be different, however. When I had this 
error
today again, I experimented around (see below), and I suggest a 
different
explanation:

The error occurs sometimes if you have a real problem in your code, 
which
would usually cause an error or warning, AND the program to be compiled 
is
sufficiently long and/or complex. This means that in a sufficiently long
(not really tremendously long) program, it might happen that the 
compiler
issues the "Did not find leading dereferencer" message instead of what
he really had to say.

Now here is how I came to this conclusion:

For example, I had a program of about 360 lines (not that huge, isn't 
it?),
which showed this error. By cutting it down line by line, even the
deletion of a single comment line (anyone anywhere in the code would do)
made that error disappear, and instead a warning occur. In this case,
the erroneous line in question looked like this:

  chomp("a","b");

and the compiler complained now (reasonably) that it's not possible to
chomp constant strings. The reason why I had used a chomp here was 
simply
because to track down the bug in my testcode, I wanted to call a 
standard
function permitting to string arguments and used chomp without thinking
that the compiler might be clever enough to find out this nonsense.
I replaced now chomp by crypt (which made the warning disappear), and
added back the previously deleted comment lines, and lo! the 
Dereferencer
error does not reappear. This is, BTW, reproducible with my version of
Perl, which is 5.8.3, and if one of the developers wants to have my
testprogram to play around with this bug, I will happily send it by
email.

Even more interesting is the second example I nailed down (this time
in my 'real' application code). This module is about 700 lines, and
the offending line looked like this:

  print(bladename($blade,"OMM $B (%I) is ","c"),"d");

The error is here really subtle. The correct statement would be

  print(bladename($blade,"OMM %B (%I) is ","c"),"d");

Note that I'm doing a "use strict" in my module (and of course -w).
Here, the string passed to the function bladename was supposed to
contain a %B, but I had made a typo and wrote $B, which is an
interpolation of the variable $B, which happens to be undefined.
The compiler should issue an error, that $B is not known,
but instead I got the "Dereferencer" error. Changing the $ into
a % made the error disappear.

Ronald

-- 
Ronald Fischer <ronaldf@eml.cc>
Posted via http://www.newsoffice.de/



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

Date: Mon, 23 Oct 2006 16:53:20 +0200
From: "Ferry Bolhar" <bol@adv.magwien.gv.at>
Subject: Re: "Did not find leading dereferencer" - new findings to an old puzzle
Message-Id: <1161615200.731589@proxy.dienste.wien.at>

Ronald Fischer:

> Note that I'm doing a "use strict" in my module (and of course -w).
> Here, the string passed to the function bladename was supposed to
> contain a %B, but I had made a typo and wrote $B, which is an
> interpolation of the variable $B, which happens to be undefined.
> The compiler should issue an error, that $B is not known,
> but instead I got the "Dereferencer" error.

Is this a compile-time or run-time error? Is bladename()
declared or imported?

Greetings, Ferry

-- 
Ing Ferry Bolhar
Magistrat der Stadt Wien - MA 14
A-1010 Wien
E-Mail: bol@adv.magwien.gv.at




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

Date: 23 Oct 2006 11:21:59 GMT
From: anno4000@radom.zrz.tu-berlin.de
Subject: Re: ability to match / detect acronyms ?
Message-Id: <4q3munFlartjU1@news.dfncis.de>

Josef Moellers  <josef.moellers@fujitsu-siemens.com> wrote in comp.lang.perl.misc:
> John W. Kennedy wrote:
> > anno4000@radom.zrz.tu-berlin.de wrote:
> > 
> >> Jack <jack_posemsky@yahoo.com> wrote in comp.lang.perl.misc:
> >>
> >>> Jack wrote:
> >>>
> >>>> Hi I was wondering if anyone had any code to detect / match / identify
> >>>> acronyms (AAA, BD) , essentially these are non words..besides just
> >>>> detecting the capitals of course.
> >>
> >>
> >> Some acronyms are words,
> > 
> > 
> > All acronyms are words, by definition.
> 
> There are acronyms that
> 1. you couldn't pronounce, e.g. WWW,
> 2. you can pronounce (in some language) but they aren't "proper words" 
> in most languages, e.g. "USA"
> 3. you can pronounce and they are "proper words" in at least some 
> language, e.g. "ARM: Advanced RISC machine, RISC: Reduced Instruction 
> Set Computer".
> 
> I guess Anno was referring to 3.

More or less, yes.

A bit of dictionary-thumbing has turned out that the usual definition of
"acronym" is "A *word* made up of ...".  Non-words like "www" would be
called "initialisms" instead.  I'm not sure what to make of cases like
"ARM" and "RISC" where the word precedes the sequence of initials.

Anno


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

Date: Mon, 23 Oct 2006 14:37:47 +0100
From: Ian Wilson <scobloke2@infotop.co.uk>
Subject: Re: can Perl detect / match unicode characters
Message-Id: <Z96dnbxNAoUsWKHYRVnysA@bt.com>

Jack wrote:
> Hi I have some data that has unicode characters that I want to parse
> out and remove since its throwing off regex, does anyone know how to
> detect these ?
> 

Yes, that is easy.

AFAIK the /.*/ regex pattern matches all Unicode characters.

This sentence starts with Unicode character U0054 which can be matched 
by the reqular expression /T/. This posting is comprised solely of 
Unicode characters, are these the ones you want to remove?

I'd aim to set the encoding correctly for the data. YMMV.


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

Date: 23 Oct 2006 03:39:33 -0700
From: "pdc124@yahoo.co.uk" <pdc124@yahoo.co.uk>
Subject: exit a Net:telnet connection
Message-Id: <1161599973.311973.284710@e3g2000cwe.googlegroups.com>

Im pulling data from a telnet Server with Net::Telnet and I want to
exit if either of 2 text strings are matched.
either 'Delete  attendance' or 'No more previous'

($text)=$t2->waitfor('/Delete  attendance|No more previous/');
and most other variations Ive tried dont work either (times out at this
pattern match  althought the logfile shows the text is being received )

so whats the correct string please ?



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

Date: Mon, 23 Oct 2006 12:49:00 +0200
From: Mark Clements <mark.clementsREMOVETHIS@wanadoo.fr>
Subject: Re: exit a Net:telnet connection
Message-Id: <453c9e1c$0$25929$ba4acef3@news.orange.fr>

pdc124@yahoo.co.uk wrote:
> Im pulling data from a telnet Server with Net::Telnet and I want to
> exit if either of 2 text strings are matched.
> either 'Delete  attendance' or 'No more previous'
> 
> ($text)=$t2->waitfor('/Delete  attendance|No more previous/');
> and most other variations Ive tried dont work either (times out at this
> pattern match  althought the logfile shows the text is being received )
> 
> so whats the correct string please ?
> 

Nobody apart from you has any way of knowing what your telnet server sends.

However: the documentation for Net::Telnet mentions potential problems 
with many telnet servers running on Windows. What does dump_log give you?

Mark


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

Date: 23 Oct 2006 04:21:31 -0700
From: "pdc124@yahoo.co.uk" <pdc124@yahoo.co.uk>
Subject: Re: exit a Net:telnet connection
Message-Id: <1161602491.905391.263900@h48g2000cwc.googlegroups.com>

 it behaves as i want if i look for each separately
ie
($text)=$t2->waitfor('/Delete  attendance/');
($text)=$t2->waitfor('/No more previous/');
 and the text is there in the output stream from the server as space
seprateed ascii.

i  cant get the syntax of OR  combination correct  and the text strings
appear 
and yes its a  windows server 

:-(



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

Date: Mon, 23 Oct 2006 13:52:50 +0200
From: Mark Clements <mark.clementsREMOVETHIS@wanadoo.fr>
Subject: Re: exit a Net:telnet connection
Message-Id: <453cad12$0$5066$ba4acef3@news.orange.fr>

pdc124@yahoo.co.uk wrote:
>  it behaves as i want if i look for each separately
> ie
> ($text)=$t2->waitfor('/Delete  attendance/');
> ($text)=$t2->waitfor('/No more previous/');
>  and the text is there in the output stream from the server as space
> seprateed ascii.
Is it really "Delete  attendance" and not "Delete attendance" (one space)?

Anyway, in order to get a useful response here (and not just guesses), 
you'll need to post the smallest *complete* program that demonstrates 
your problem, and its output. Read the posting guidelines for tips on 
how to do this.

cheers,

Mark



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

Date: Mon, 23 Oct 2006 15:34:04 +0100
From: Ian Wilson <scobloke2@infotop.co.uk>
Subject: Re: FTP to a windows file share?
Message-Id: <re2dnfmqVNd8T6HYRVnyug@bt.com>

MattJ83 wrote:
>> C:\temp>type \\Violet\Infotop\UNC.txt 
>> This is a text file on another PC
> 
> ^^^ are you just creating a txt file here in temp? but with 
> '\\Violet\Infotop\UNC.txt' as a filename?

No, It is reading a txt file on server Violet.

The "type" command is a standard Windows / DOS command. I'm surprised 
you don't know of it.

In your original message you used UNC names so I assumed you were 
familiar with them.

\\Violet\Infotop\UNC.txt can never be trhe name of a local file on a 
Windows PC. (or if it could, I'd have to be exceptionally mischevious to 
use it in an example)

The format of a UNC name is

\\ServerName\ShareName\FileName

where the filename includes any path relative to the share root.

All the above is basic Windows terminology, nothing to do with Perl.

>> C:\temp>type test.pl 
>> #!perl use strict; 
>> use warnings; 
>> open my $fh, '<', '//Violet/Infotop/UNC.txt' 
>>   or die "Unable to open file because $!"; 
>> while (<$fh>) { print; } 
>> close $fh;
>> 
>> 
>> C:\temp>test.pl 
>> This is a text file on another PC
> 
> This code is just creating a file called UNC.txt in temp and then 
> running some code from temp to open the file isn't it?
> 

No it is a perl program running on a windows PC that reads a file from a 
server.

> Im trying to run the script from a unix server (bash shell) 

It's a shame you didn't say so at the beginning!

Well the above example won't work on Unix since on Unix AFAIK you don't 
use UNC names or map drive letters to shares, you 'mount' a remote share 
to a mount-point. You can use Samba to do this where the client is Unix 
and the file server is using Windows file sharing protocols.

> and
> trying to get the same result 

Really? From your other postings, it now seems you are only trying to 
write a file to the remote server, not read one from it. Ah well.

> at the moment (ie - open a file from a
> windows file share in unix). Eventually - getting the data passed
> from unix to this windows file share.

I'd either get an FTP-service enabled at the file-server, or use Samba 
to mount the remote share in a local directory. With Samba you could 
then use normal (local) file copying techniques in Perl.

The former approach looks like it will be much easier for you.


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

Date: 23 Oct 2006 06:00:40 -0700
From: "Kuna" <kunanu@gmail.com>
Subject: Soap Server in perl
Message-Id: <1161608440.285288.187100@m7g2000cwm.googlegroups.com>

Hi All,

I had joined this group because i heared much more about this goroup so
I also hope that the group members will help me. I want to create a
SOAP server in perl so have gone through web but thatr was not
satisfactory. If any body will give sample codes or some well defined
link then that will be helpfull to me.


Thanks, :)
Kuna



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

Date: Mon, 23 Oct 2006 14:26:00 +0100
From: Ian Wilson <scobloke2@infotop.co.uk>
Subject: Re: Soap Server in perl
Message-Id: <WfmdnRTV84t3X6HYRVnyrQ@bt.com>

Kuna wrote:
> Hi All,
> 
> I had joined this group because i heared much more about this goroup so
> I also hope that the group members will help me. I want to create a
> SOAP server in perl so have gone through web but thatr was not
> satisfactory. If any body will give sample codes or some well defined
> link then that will be helpfull to me.
> 

http://www.soaplite.com/

The quickstart guide and cookbook have examples.


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

Date: 23 Oct 2006 06:38:40 -0700
From: "Kuna" <kunanu@gmail.com>
Subject: Re: Soap Server in perl
Message-Id: <1161610720.808869.232930@f16g2000cwb.googlegroups.com>


Ian Wilson wrote:

> Kuna wrote:
> > Hi All,
> >
> > I had joined this group because i heared much more about this goroup so
> > I also hope that the group members will help me. I want to create a
> > SOAP server in perl so have gone through web but thatr was not
> > satisfactory. If any body will give sample codes or some well defined
> > link then that will be helpfull to me.
> >
>
> http://www.soaplite.com/
>
> The quickstart guide and cookbook have examples.

Hi Ian
thanks a lot for replying but this link is not opening and apart of
that I want to say that I have tried many links but those are having
fundamental ideas but I need to reate soap server in perl which will
invoke some methods and show me the responce from the server. So if
possible then suggest me some sample codes for some advanced operation.

Thanks,
Kuna :)



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

Date: Mon, 23 Oct 2006 14:54:32 +0100
From: Ian Wilson <scobloke2@infotop.co.uk>
Subject: Re: Soap Server in perl
Message-Id: <TeednQSsH_sBVKHYnZ2dnUVZ8tWdnZ2d@bt.com>

Kuna wrote:
> Ian Wilson wrote:
> 
> 
>>Kuna wrote:
>>
>>>Hi All,
>>>
>>>I had joined this group because i heared much more about this goroup so
>>>I also hope that the group members will help me. I want to create a
>>>SOAP server in perl so have gone through web but thatr was not
>>>satisfactory. If any body will give sample codes or some well defined
>>>link then that will be helpfull to me.
>>>
>>
>>http://www.soaplite.com/
>>
>>The quickstart guide and cookbook have examples.
> 
> 
> Hi Ian
> thanks a lot for replying but this link is not opening and apart of
> that I want to say that I have tried many links but those are having
> fundamental ideas but I need to reate soap server in perl which will
> invoke some methods and show me the responce from the server. So if
> possible then suggest me some sample codes for some advanced operation.

So, let me get this straight, are you asking me to go to that web page 
for you, look up some example code for you, then cut & paste that code 
into a newsgroup posting for you?

That URL works fine here. If my Internet connection was broken, the way 
yours is, I'd phone my ISP and complain!


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

Date: 23 Oct 2006 07:35:23 -0700
From: "Kuna" <kunanu@gmail.com>
Subject: Re: Soap Server in perl
Message-Id: <1161614123.216771.237860@i3g2000cwc.googlegroups.com>


Ian Wilson wrote:
> Kuna wrote:
> > Ian Wilson wrote:
> >
> >
> >>Kuna wrote:
> >>
> >>>Hi All,
> >>>
> >>>I had joined this group because i heared much more about this goroup so
> >>>I also hope that the group members will help me. I want to create a
> >>>SOAP server in perl so have gone through web but thatr was not
> >>>satisfactory. If any body will give sample codes or some well defined
> >>>link then that will be helpfull to me.
> >>>
> >>
> >>http://www.soaplite.com/
> >>
> >>The quickstart guide and cookbook have examples.
> >
> >
> > Hi Ian
> > thanks a lot for replying but this link is not opening and apart of
> > that I want to say that I have tried many links but those are having
> > fundamental ideas but I need to reate soap server in perl which will
> > invoke some methods and show me the responce from the server. So if
> > possible then suggest me some sample codes for some advanced operation.
>
> So, let me get this straight, are you asking me to go to that web page
> for you, look up some example code for you, then cut & paste that code
> into a newsgroup posting for you?
>
> That URL works fine here. If my Internet connection was broken, the way
> yours is, I'd phone my ISP and complain!

Sorry Ian
I donot mean to say like that but actually I am new to perl and I have
given this task to be done so as per my little knowledge I am not able
to get these examples from the web so I want that some one will guide
me and by which I can able to get some knowledge and get my to be done.
Again sorry if I have asked something worng to you.

Regards,
Kuna



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

Date: 23 Oct 2006 12:06:41 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: string substitution for a file, without replacing partial string?
Message-Id: <0u4pj2pdqtgsgr792gf9qc1u5jathnmq8i@4ax.com>

On 22 Oct 2006 16:33:52 -0700, "gavino" <bootiack@yahoo.com> wrote:

>You the man that worked!

What?!?

>perl -pi.bak -e "s/\b50\b/450/g" 50.txt
>awesome!!!

Give a man a fish, he'll live for a day.

Teach him how to fish, he'll tell you that he has not time to loose
playing games with hooks and lines!

(Seen somewhere...)


Michele
-- 
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
 .'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,


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

Date: Mon, 23 Oct 2006 10:39:04 -0400
From: Berk Birand <graffiti@yahoo.com>
Subject: Re: Switch module misbehavior
Message-Id: <pan.2006.10.23.14.39.04.415629@yahoo.com>

On Mon, 23 Oct 2006 07:14:21 +0000, Mumia W. (reading news) wrote:

> 
> I was able to execute this function, and the case statement is 
> recognized here; however, I'll believe you if you say that Switch.pm is 
> messed up.
> 
> I had loads of problems with Switch.pm until I abandoned it. It seems to 
> work passably at the command line or in a CGI script, but it falls over 
> under mod_perl.
> 
> My advise is not to use Switch.pm. Use the alternatives:
> perldoc -q switch

Thanks for trying out the code for me. The stand-alone tests also work
fine for me, although it suddenly breaks when put into my main code. 

Do you think I should use the elsifs instead? What is your preference for
using switch constructs?

Thanks for the reply,
Berk

-- 
Posted via a free Usenet account from http://www.teranews.com



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

Date: Mon, 23 Oct 2006 07:12:06 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Trying to get past code error in Perl book I'm learning from
Message-Id: <slrnejpccm.6sg.tadmc@tadmc30.august.net>

Uri Guttman <uri@stemsystems.com> wrote:
>>>>>> "rc" == rankenory@gmail com <rankenory@gmail.com> writes:
>
>  rc> I'm learning Perl from a book called "Learn Perl in a Weekend."  I like


> (even if 24 hours is bad and 21 days is decent).
                       ^^^                ^^^^^^

Surely you have those backwards.

"Learn Perl in 24 Hours", by Clinton Pierce, is the decent one!


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


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

Date: Mon, 23 Oct 2006 10:15:46 -0400
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: Trying to get past code error in Perl book I'm learning from
Message-Id: <x7fydf2k4t.fsf@mail.sysarch.com>

>>>>> "TM" == Tad McClellan <tadmc@augustmail.com> writes:

  TM> Uri Guttman <uri@stemsystems.com> wrote:
  >>>>>>> "rc" == rankenory@gmail com <rankenory@gmail.com> writes:
  >> 
  rc> I'm learning Perl from a book called "Learn Perl in a Weekend."  I like


  >> (even if 24 hours is bad and 21 days is decent).
  TM>                        ^^^                ^^^^^^

  TM> Surely you have those backwards.

  TM> "Learn Perl in 24 Hours", by Clinton Pierce, is the decent one!

yep. i can't remember which he wrote and i don't have copies. but
someone else mentioned the rule tha learn XXX in YYY time is always a
bad idea for a perl book (or any book). clinton's is the exception to
that rule (i have read some of the book and as tad said, it is decent).

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: 23 Oct 2006 06:40:46 -0700
From: strenholme.usenet@gmail.com
Subject: Why I no longer use Perl
Message-Id: <1161610846.318615.239050@m73g2000cwd.googlegroups.com>

I have been a Perl programmer for over ten years.  Recently, I found a
bug in Perl which made me stop using Perl altogether.

In these examples, the accented character is a 2-byte UTF-8 sequence.

$ /usr/bin/perl --version

This is perl, v5.8.0 built for i386-linux-thread-multi
(with 1 registered patch, see perl -V for more detail)

[Full Perl license text removed for brevity]

$ /usr/local/bin/perl --version

This is perl, v5.8.8 built for i686-linux

[Full Perl license text removed for brevity]

$ echo =E1 | /usr/bin/perl -pe 's/=E1/aye/'
=E1
$ echo =E1 | /usr/local/bin/perl -pe 's/=E1/aye/'
aye

So, is there any way to work around this problem? Nope. You might think
"use utf8" will fix this issue. It doesn't.

$ cat unicode.char
=E1
$ cat unicode.script
use utf8;

open(A,"< unicode.char");

while(<A>) {

        $_ =3D~ s/=E1/aye/;
        print;

}
$ /usr/bin/perl unicode.script
aye
$ /usr/local/bin/perl unicode.script
=E1

As you can see, "use utf8" just causes Perl 5.8.0 to do the right
thing, yet breaks Perl 5.8.8. So maybe we can fix this with a
conditional statement.

$ cat unicode.script.2
$vers=3Dsprintf("%vd",$^V);

if($vers =3D~ /5.8.0/) {
 use utf8;
}

open(A,"< unicode.char");

while(<A>) {

 $_ =3D~ s/=E1/aye/;
 print;

}
$ /usr/bin/perl unicode.script.2
=E1
$ /usr/local/bin/perl unicode.script.2
aye

At this point, I gave up. These days, I write in either awk (for simple
stuff) or Python (for complicated stuff). For example, none of the four
freely downloadable awk interpreters have this problem:

$ echo =E1 | busybox awk '{gsub(/=E1/,"aye");print}'
aye
$ echo =E1 | gawk '{gsub(/=E1/,"aye");print}'
aye
$ echo =E1 | mawk '{gsub(/=E1/,"aye");print}'
aye
$ echo =E1 | bwk-awk '{gsub(/=E1/,"aye");print}'
aye

The nice thing about awk is that there is a Posix standard out there;
this guarantees that I can write my awk scripts in a manner that will
work on any modern system with an awk interpreter.

The nice thing about Python is that there is a strong committment from
the Python community to not arbitrarily break things or make changes
which break scripts between bugfix releases.

Perl 6 looks promising; it seems that there is a lot of work being done
to document anything and everything Perl 6 does.  It looks like Perl 6
will have a standard so a given script which follows the standard is
guaranteed to work with any version of Perl 6.  I might return to Perl
once Perl 6 has a stable release and a well-defined standard.

- Sam



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

Date: Mon, 23 Oct 2006 16:21:58 +0200
From: Aukjan van Belkum <aukjan@vanbelkum.no.spam.nl>
Subject: Re: Why I no longer use Perl
Message-Id: <4ec62$453cd006$c2abfc64$4127@news1.tudelft.nl>

strenholme.usenet@gmail.com wrote:

> $ cat unicode.script.2
> $vers=sprintf("%vd",$^V);
> 
> if($vers =~ /5.8.0/) {
>  use utf8;
> }
> 

Actually this will not work... since use statements are done as the 
first thing, and the 'if' statement has no effect on it. (AFAIK)
You could accomplish this with a BEGIN block and a 'require' statement 
instead... That should solve your problem!!

So please don't quit on Perl :-)

Aukjan


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

Date: 23 Oct 2006 07:26:14 -0700
From: "Matt Garrish" <mgarrish@gmail.com>
Subject: Re: Why I no longer use Perl
Message-Id: <1161613574.723971.9960@h48g2000cwc.googlegroups.com>


strenholme.usenet@gmail.com wrote:
> I have been a Perl programmer for over ten years.  Recently, I found a
> bug in Perl which made me stop using Perl altogether.
>

In ten years you've never learned how to set the locale?

perldoc perllocale

Matt



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

Date: Mon, 23 Oct 2006 16:30:18 +0200
From: Aukjan van Belkum <aukjan@vanbelkum.no.spam.nl>
Subject: Re: Why I no longer use Perl
Message-Id: <c101a$453cd1fa$c2abfc64$19638@news2.tudelft.nl>

Aukjan van Belkum wrote:
> strenholme.usenet@gmail.com wrote:
> 
>> $ cat unicode.script.2
>> $vers=sprintf("%vd",$^V);
>>
>> if($vers =~ /5.8.0/) {
>>  use utf8;
>> }
>>
> 
> Actually this will not work... since use statements are done as the 
> first thing, 

hmm .. just read 'perldoc -q require', which explains the difference 
between 'use' and 'require' better... :-)

Aukjan


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

Date: Mon, 23 Oct 2006 16:27:26 +0200
From: "Dr.Ruud" <rvtol+news@isolution.nl>
Subject: Re: Why I no longer use Perl
Message-Id: <ehiqki.1es.1@news.isolution.nl>

strenholme schreef:

> $ echo á | /usr/bin/perl -pe 's/á/aye/'
> á


perl 5.8.8 on Windows 2000:

C:\>echo á | perl -MO=Deparse -pe "s/á/aye/"
LINE: while (defined($_ = <ARGV>)) {
    s/\341/aye/;
}
continue {
    print $_;
}
-e syntax OK

"\341" is "\xE1" is chr(225).


C:\> echo á | perl -MO=Deparse -Mencoding=latin1 -pe "s/á/aye/"
use encoding (split(/,/, 'latin1', 0));
LINE: while (defined($_ = <ARGV>)) {
    s/\303\241/aye/;
}
continue {
    print $_;
}
-e syntax OK

"\303\241" (or "\xC3\xA1") must be utf8 for chr(225).



In Python you are in a special environment. Let's do the same with perl:

$ perl -de1
[...]

  DB<1> x $_="á"; s/á/aye/; print
aye0  1
  DB<2>

So I think your problem is with locales.

-- 
Affijn, Ruud

"Gewoon is een tijger."



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

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


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