[28518] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 9882 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Oct 23 18:10:16 2006

Date: Mon, 23 Oct 2006 15:10: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           Mon, 23 Oct 2006     Volume: 10 Number: 9882

Today's topics:
    Re: HTML::Mason scripts coming up as plain text on apac <tidusx2@cogeco.ca>
    Re: HTML::Mason scripts coming up as plain text on apac <tidusx2@cogeco.ca>
    Re: HTML::Mason scripts coming up as plain text on apac <tidusx2@cogeco.ca>
    Re: HTML::Mason scripts coming up as plain text on apac <glex_no-spam@qwest-spam-no.invalid>
    Re: LWP and Javascript -- Not The Same Old Question <sorry_no_email@yahoo.com>
    Re: Reverse algorithm with tangent <bart@nijlen.com>
    Re: Reverse algorithm with tangent <hjp-usenet2@hjp.at>
    Re: Soap Server in perl <glex_no-spam@qwest-spam-no.invalid>
    Re: Soap Server in perl <scobloke2@infotop.co.uk>
    Re: string substitution for a file, without replacing p <asandstrom@accesswave.ca>
    Re: string substitution for a file, without replacing p <noreply@gunnar.cc>
    Re: Switch module misbehavior (reading news)
    Re: Why I no longer use Perl <hjp-usenet2@hjp.at>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Mon, 23 Oct 2006 14:14:45 -0400
From: Adam Lawson <tidusx2@cogeco.ca>
Subject: Re: HTML::Mason scripts coming up as plain text on apache server
Message-Id: <wE7%g.122032$ED.106645@read2.cgocable.net>

Mirco Wahab wrote:
> Thus spoke Adam Lawson (on 2006-10-23 07:46):
> 
> 
>>I've been trying different routes in order to get HTML::Mason scripts to 
>>work....but the scripts come up as plain text in the browser
>>
>>I have mod_perl and HTML::Mason loaded and Apache httpd-2.2.3
>>here is my what is added in my httpd.conf
>>LoadModule perl_module /usr/local/apache2/modules/mod_perl.so
>>
>>PerlModule HTML::Mason::ApacheHandler
>><Location /usr/local/apache2/htdocs/mason>
>>SetHandler perl-script
>>PerlHandler HTML::Mason::ApacheHandler
>></Location>
> 
> 
> 1) are you sure, you installed mod_perl2 (two!) - otherwise
>    you have to enable 1.0 compatibility   use Apache::compat ();
> 2) what extension did you use for Mason (top-) files (.htm?)
> 3) what did you tell apache2 about this extension (DirectoryIndex?)
> 
> What receipt did you follow this one?
>    http://modperlbook.org/html/index.html
> 
> Regards
> 
> Mirco
Thanx for your reply Mirco,

Ok I followed the link you provided and followed their steps to install 
the mod_perl apache server

panic% perl Makefile.PL APACHE_SRC=../apache_1.3.xx/src \
   DO_HTTPD=1 USE_APACI=1 EVERYTHING=1
panic% make && make test
panic# make install
panic# cd ../apache_1.3.xx
panic# make install

using mod_perl-1.29 and apache_1.3.37

appearently everything went fine, fired up the server with 
/usr/local/apache/bin/apachectl start using 127.0.0.1 is my server 
address but now i get the error unable to connect in the browser

how do i begin to figure out whats going wrong?

thank u

Adam


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

Date: Mon, 23 Oct 2006 14:31:17 -0400
From: Adam Lawson <tidusx2@cogeco.ca>
Subject: Re: HTML::Mason scripts coming up as plain text on apache server
Message-Id: <0U7%g.122033$ED.20481@read2.cgocable.net>

Adam Lawson wrote:
> Mirco Wahab wrote:
> 
>> Thus spoke Adam Lawson (on 2006-10-23 07:46):
>>
>>
>>> I've been trying different routes in order to get HTML::Mason scripts 
>>> to work....but the scripts come up as plain text in the browser
>>>
>>> I have mod_perl and HTML::Mason loaded and Apache httpd-2.2.3
>>> here is my what is added in my httpd.conf
>>> LoadModule perl_module /usr/local/apache2/modules/mod_perl.so
>>>
>>> PerlModule HTML::Mason::ApacheHandler
>>> <Location /usr/local/apache2/htdocs/mason>
>>> SetHandler perl-script
>>> PerlHandler HTML::Mason::ApacheHandler
>>> </Location>
>>
>>
>>
>> 1) are you sure, you installed mod_perl2 (two!) - otherwise
>>    you have to enable 1.0 compatibility   use Apache::compat ();
>> 2) what extension did you use for Mason (top-) files (.htm?)
>> 3) what did you tell apache2 about this extension (DirectoryIndex?)
>>
>> What receipt did you follow this one?
>>    http://modperlbook.org/html/index.html
>>
>> Regards
>>
>> Mirco
> 
> Thanx for your reply Mirco,
> 
> Ok I followed the link you provided and followed their steps to install 
> the mod_perl apache server
> 
> panic% perl Makefile.PL APACHE_SRC=../apache_1.3.xx/src \
>   DO_HTTPD=1 USE_APACI=1 EVERYTHING=1
> panic% make && make test
> panic# make install
> panic# cd ../apache_1.3.xx
> panic# make install
> 
> using mod_perl-1.29 and apache_1.3.37
> 
> appearently everything went fine, fired up the server with 
> /usr/local/apache/bin/apachectl start using 127.0.0.1 is my server 
> address but now i get the error unable to connect in the browser
> 
> how do i begin to figure out whats going wrong?
> 
> thank u
> 
> Adam
I am sorry I had the port set to 8080 not 80 in the httpd.conf, server 
runs now, however now that iam up and running i tried adding:

     PerlModule HTML::Mason::ApacheHandler

     <Location />
       SetHandler   perl-script
       PerlHandler  HTML::Mason::ApacheHandler
     </Location>

to my httpd.conf in order to process mason scripts on the server, now i 
get an internal server error message when trying to access any pages.

is something wrong with my perl or perl modules? how to I troubleshoot this?

Adam


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

Date: Mon, 23 Oct 2006 14:36:42 -0400
From: Adam Lawson <tidusx2@cogeco.ca>
Subject: Re: HTML::Mason scripts coming up as plain text on apache server
Message-Id: <5Z7%g.172860$sS1.140106@read1.cgocable.net>

Adam Lawson wrote:
> Adam Lawson wrote:
> 
>> Mirco Wahab wrote:
>>
>>> Thus spoke Adam Lawson (on 2006-10-23 07:46):
>>>
>>>
>>>> I've been trying different routes in order to get HTML::Mason 
>>>> scripts to work....but the scripts come up as plain text in the browser
>>>>
>>>> I have mod_perl and HTML::Mason loaded and Apache httpd-2.2.3
>>>> here is my what is added in my httpd.conf
>>>> LoadModule perl_module /usr/local/apache2/modules/mod_perl.so
>>>>
>>>> PerlModule HTML::Mason::ApacheHandler
>>>> <Location /usr/local/apache2/htdocs/mason>
>>>> SetHandler perl-script
>>>> PerlHandler HTML::Mason::ApacheHandler
>>>> </Location>
>>>
>>>
>>>
>>>
>>> 1) are you sure, you installed mod_perl2 (two!) - otherwise
>>>    you have to enable 1.0 compatibility   use Apache::compat ();
>>> 2) what extension did you use for Mason (top-) files (.htm?)
>>> 3) what did you tell apache2 about this extension (DirectoryIndex?)
>>>
>>> What receipt did you follow this one?
>>>    http://modperlbook.org/html/index.html
>>>
>>> Regards
>>>
>>> Mirco
>>
>>
>> Thanx for your reply Mirco,
>>
>> Ok I followed the link you provided and followed their steps to 
>> install the mod_perl apache server
>>
>> panic% perl Makefile.PL APACHE_SRC=../apache_1.3.xx/src \
>>   DO_HTTPD=1 USE_APACI=1 EVERYTHING=1
>> panic% make && make test
>> panic# make install
>> panic# cd ../apache_1.3.xx
>> panic# make install
>>
>> using mod_perl-1.29 and apache_1.3.37
>>
>> appearently everything went fine, fired up the server with 
>> /usr/local/apache/bin/apachectl start using 127.0.0.1 is my server 
>> address but now i get the error unable to connect in the browser
>>
>> how do i begin to figure out whats going wrong?
>>
>> thank u
>>
>> Adam
> 
> I am sorry I had the port set to 8080 not 80 in the httpd.conf, server 
> runs now, however now that iam up and running i tried adding:
> 
>     PerlModule HTML::Mason::ApacheHandler
> 
>     <Location />
>       SetHandler   perl-script
>       PerlHandler  HTML::Mason::ApacheHandler
>     </Location>
> 
> to my httpd.conf in order to process mason scripts on the server, now i 
> get an internal server error message when trying to access any pages.
> 
> is something wrong with my perl or perl modules? how to I troubleshoot 
> this?
> 
> Adam
sorry I forgot to include the error log

error] Cannot create directory '/usr/local/apache/mason/obj' (mkdir 
/usr/local/apache/mason/obj: Permission denied at 
/usr/lib/perl5/site_perl/5.8.8/HTML/Mason/Interp.pm line 301\n) for user 
'nobody', group 'nobody'. Perhaps you need to create or set permissions 
on your data_dir ('/usr/local/apache/mason'). \nStack:\n 
[/usr/lib/perl5/site_perl/5.8.8/HTML/Mason/Interp.pm:318]\n 
[/usr/lib/perl5/site_perl/5.8.8/HTML/Mason/Interp.pm:222]\n 
[/usr/lib/perl5/site_perl/5.8.8/HTML/Mason/Interp.pm:169]\n 
[/usr/lib/perl5/site_perl/5.8.8/HTML/Mason/Interp.pm:155]\n 
[/usr/lib/perl5/site_perl/5.8.8/Class/Container.pm:329]\n 
[/usr/lib/perl5/site_perl/5.8.8/Class/Container.pm:53]\n 
[/usr/lib/perl5/site_perl/5.8.8/HTML/Mason/ApacheHandler.pm:633]\n 
[/usr/lib/perl5/site_perl/5.8.8/HTML/Mason/ApacheHandler.pm:412]\n 
[(eval 32):6]\n  [/dev/null:0]\n


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

Date: Mon, 23 Oct 2006 13:53:22 -0500
From: "J. Gleixner" <glex_no-spam@qwest-spam-no.invalid>
Subject: Re: HTML::Mason scripts coming up as plain text on apache server
Message-Id: <453d0f67$0$10308$815e3792@news.qwest.net>

Adam Lawson wrote:

> sorry I forgot to include the error log
> 
> error] Cannot create directory '/usr/local/apache/mason/obj' (mkdir 
> /usr/local/apache/mason/obj: Permission denied at 
> /usr/lib/perl5/site_perl/5.8.8/HTML/Mason/Interp.pm line 301\n) for user 
> 'nobody', group 'nobody'. Perhaps you need to create or set permissions 
> on your data_dir ('/usr/local/apache/mason'). \nStack:\n 

That isn't a big enough clue??????

There is a lot of very good documentation for Mason at 
http://www.masonhq.com/.


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

Date: 23 Oct 2006 08:13:37 -0700
From: "EdwardATeller" <sorry_no_email@yahoo.com>
Subject: Re: LWP and Javascript -- Not The Same Old Question
Message-Id: <1161616417.061738.313920@m73g2000cwd.googlegroups.com>

Peter J. Holzer wrote:
> On 2006-10-22 15:37, EdwardATeller <sorry_no_email@yahoo.com> wrote:
> > I am trying to scrape a page that seems to load important info via
> > javascript, since it isn't there when I just use LWP get.  When I visit
> > the page with Firefox with javascript turned off, the important info is
> > right there on my screen, although a litle garbled.  I'm guessing the
> > page detects javascript and serves accordingly.
> >
> > Here is my thought.  Can I create a useragent that grabs pages after
> > telling the webserver it doesn't support javascript?
>
> Not directly, no. There is no way for the browser to tell the server
> that it doesn't support JavaScript. A server can detect whether the
> browser supports JavaScript by serving a page which contains some

<SNIP>

Thanks very much for the tips.  I'll give them a try.



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

Date: 23 Oct 2006 08:50:38 -0700
From: "Bart Van der Donck" <bart@nijlen.com>
Subject: Re: Reverse algorithm with tangent
Message-Id: <1161618638.072031.238180@i42g2000cwa.googlegroups.com>

Peter J. Holzer wrote:

> [...]
> I see two possible ways to improve the code:
>
> 1) For each step, make sure that the computed value matches exactly.
>    If it doesn't it may be possible to compute a better value with
>    Newton's method. If there isn't, skip it.

Here is my meager attempt. In the first place, Math::Trig's tan()
differs from that in my original encryption (other implementation).
Sorry that I have to come up with this at this point.

The original encryption returns a tangent like this:

  0.0000000000000000

while Math::Trig returns

  0.00000000000000

This causes a significantly different encrypted result.

As for the decryption, I have played around with very precise tangent
calls. I'm using MySQL4's TAN (which can be customized how many digits
to return, up to 0.000000000000000000000000000000).

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

#!/usr/bin/perl

use warnings;
use strict;
use Math::Trig;
use DBI;

sub f {
    my ($v) = @_;

    for (0..9)  {
      $v = $v + 1;
      my $db = DBI->connect("DBI:mysql:NAME:HOST","USR","PW");
      # must use 0.0000000000000000 here
      my $query = $db->prepare("SELECT TAN($v)+0.0000000000000000");
      $query->execute;
      while (my @array = $query->fetchrow_array)  {
        $v = $array[0]; }
      $query->finish;
      $db->disconnect;
      $v =~ s/\d{1,}\./0./; # no ^ for possible minus
    }
    return $v;
}

sub rf {
    my ($v) = @_;
    for (0 .. 9) {
        my $s = $v >= 0 ? 1 : -1;

        FIND_INT:
        for my $i (0 .. 100) { # should really be 0 .. infinity
            my $vx = $v + $i * $s;
            my $db = DBI->connect("DBI:mysql:NAME:HOST","USR","PW");
            # use 0.000000000000000000000000000000 for max accuracy
            my $query =
               $db->prepare("SELECT
                    ATAN2($vx,1)+0.000000000000000000000000000000");
            $query->execute;
            while (my @array = $query->fetchrow_array)  {
              $vx = $array[0]; }
            $query->finish;
            $db->disconnect;

            if (abs ($vx - 1) < 1) {
                $v = $vx - 1;
                last FIND_INT;
            } elsif (abs ($vx + pi - 1) < 1) {
                $v = $vx + pi - 1;
                last FIND_INT;
            }
        }
    }
    return $v;

}

my $v = 0.6235584253;
print $v, "\n";

$v = f($v);
print $v, "\n";

$v = rf($v);
print $v, "\n";

$v = f($v);
print $v, "\n";

__END__

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

Output:

 0.6235584253
 -0.8666340060134772
 -0.217377922839505
 -0.8666340058771898

While your output was:

 0.6235584253
 -0.86659174554348
 -0.217377922712057
 -0.86659174566011

So it gets longer (which I had expected), but not preciser (which I had
not expected).

Also... can Math::Trig's PI be trusted to be precise enough ? Setting
it manually to 3.141592653589793115997963468544 doesn't seem to make a
difference.

-- 
 Bart



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

Date: Mon, 23 Oct 2006 20:59:07 +0200
From: "Peter J. Holzer" <hjp-usenet2@hjp.at>
Subject: Re: Reverse algorithm with tangent
Message-Id: <slrnejq47r.feu.hjp-usenet2@yoyo.hjp.at>

On 2006-10-23 15:50, Bart Van der Donck <bart@nijlen.com> wrote:
> Peter J. Holzer wrote:
>> I see two possible ways to improve the code:
>>
>> 1) For each step, make sure that the computed value matches exactly.
>>    If it doesn't it may be possible to compute a better value with
>>    Newton's method. If there isn't, skip it.
>
> Here is my meager attempt. In the first place, Math::Trig's tan()
> differs from that in my original encryption (other implementation).
> Sorry that I have to come up with this at this point.
>
> The original encryption returns a tangent like this:
>
>   0.0000000000000000
>
> while Math::Trig returns
>
>   0.00000000000000

I'd guess that neither returns a decimal number: Probably both return a
binary FP number. Using a decimal representation of such a number to
determine whether they are equal may be misleading.

(Also note that your "convert to decimal and replace digits before the
period with 0" operation is not the same as fmod, unlike the latter it
includes two rounding steps) 

Is your "other implementation" also in Perl? If it isn't, you must be
extra careful if duplicating its exact functionality.


> This causes a significantly different encrypted result.
>
> As for the decryption, I have played around with very precise tangent
> calls. I'm using MySQL4's TAN (which can be customized how many digits
> to return, up to 0.000000000000000000000000000000).

I doubt that. MySQL almost certainly uses double precision for
trigonometric functions, so the result won't be accurate for more than
about 16 decimal digits. Even if it uses extended precision that's only
about 19 decimal digits (on Intel x87 compatible processors). You may
see more digits, but they don't represent real accuracy. For comparison,
try:

perl -MMath::Trig -e 'printf("%.60f\n", tan(1))'
1.557407724654902070327011642802972346544265747070312500000000

That looks like it is accurate to 53 decimal digits, but it isn't - 
tan(1.0000000000000001)) returns exactly the same value, but
tan(1.00000000000000015)) returns
1.557407724654902958505431342928204685449600219726562500000000
which differs in the 17th decimal digit, or (if you look at both numbers
in binary) in the 50th bit. So you don't actually get more than about 15
decimal places of accuracy (possibly even less).


> Also... can Math::Trig's PI be trusted to be precise enough ? Setting
> it manually to 3.141592653589793115997963468544 doesn't seem to make a
> difference.

See above: You have 53 bits of precision - writing more digits won't
help as they will be ignored. (Unless you use a BigNum package)

	hp


-- 
   _  | Peter J. Holzer    | > Wieso sollte man etwas erfinden was nicht
|_|_) | Sysadmin WSR       | > ist?
| |   | hjp@hjp.at         | Was sonst wäre der Sinn des Erfindens?
__/   | http://www.hjp.at/ |	-- P. Einstein u. V. Gringmuth in desd


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

Date: Mon, 23 Oct 2006 10:46:26 -0500
From: "J. Gleixner" <glex_no-spam@qwest-spam-no.invalid>
Subject: Re: Soap Server in perl
Message-Id: <453ce396$0$597$815e3792@news.qwest.net>

Kuna wrote:
> 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.

The examples in the SOAP::Lite documentation should work.  Read the 
documentation, try the examples, and then post specific questions.

If you can't access the above URL, for some reason, you can always check 
the documentation with "perldoc SOAP::Lite", that is, assuming that you 
do have SOAP::Lite installed.

If the examples don't work, then post what you have tried along with the 
error and possibly someone will be able to help you get the code to 
work.  You could also ask the person who gave you this task, for help, 
since they have the most to gain by you completing it.


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

Date: Mon, 23 Oct 2006 17:24:58 +0100
From: Ian Wilson <scobloke2@infotop.co.uk>
Subject: Re: Soap Server in perl
Message-Id: <aY-dnaity69DcaHYRVnyrQ@bt.com>

Kuna wrote:
> Ian Wilson wrote:
>> Kuna wrote:
>>> Ian Wilson wrote:
>>>> Kuna wrote:
>>>>> 
>>>>> 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.
>> 
>> 
>> 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.

Its not that simple. If you don't have a web-server with support for CGI 
and Perl in which you can install SOAP::Lite then you'll have to 
implement the SOAP support some other way. The SOAP::Lite documentation 
covers various ways.

Here's an example of server code (soaptemp.pl)

#!/usr/bin/perl -w

use SOAP::Transport::HTTP;

SOAP::Transport::HTTP::CGI
   -> dispatch_to('Temperatures')
   -> handle;

package Temperatures;

sub f2c {
   my ($class, $f) = @_;
   return 5/9*($f-32);
}

sub c2f {
   my ($class, $c) = @_;
   return 32+$c*9/5;
}

Here's the corresponding client code (soaptempclient.pl)

#!/usr/bin/perl -w

use SOAP::Lite;

$c = shift @ARGV;
$c = 37.5 unless $c;

print
  "$c C = ",
  SOAP::Lite
  -> uri('http://your.server.name/Temperatures')
  -> proxy ('https://your.server.name/cgi-bin/soaptemp.pl')
  -> c2f($c)
  -> result,
  " F\n";

Note: this is old code, you should use warnings; use strict; There are 
lots of different ways of writing soap clients and soap servers using 
SOAP::Lite. There is a feature that lets you call remote subroutines 
exactly the way you would if they were local subroutines. There's no 
substitute for reading the documentation.

If you are new to Perl you may find the examples hard to understand. If 
this is so then you need to practice Perl on some simpler problems 
before you move onto SOAP.

I suggest this:

1) Write a simple Perl program with a subroutine,

2) Move the subroutine to a module. Alter the main program to use that 
module.

3) Move your module unchanged to your web server and write a generic 
SOAP dispatcher (designated by the proxy in the client) that hands off 
SOAP requests to modules (designated by the URI provided by the client) 
There's an example in the docs, it is 4 lines long plus shebang, 
comments and spacing.

Use autodispach in the client so that your client only needs a couple of 
lines adding to it.


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

Date: Mon, 23 Oct 2006 21:32:19 GMT
From: "Arved Sandstrom" <asandstrom@accesswave.ca>
Subject: Re: string substitution for a file, without replacing partial string?
Message-Id: <Dxa%g.30005$P7.1541@edtnps90>

<anno4000@radom.zrz.tu-berlin.de> wrote in message 
news:4q2400Fl66k4U1@news.dfncis.de...
> gavino <bootiack@yahoo.com> wrote in comp.lang.perl.misc:
>
>> Didn't work
>
> That's a pretty rude reply to a helpful message, don't you think?
> Not to mention the lack of any context.

Come, come, that's the standard initial reply from a disgruntled consumer. 
Have you never worked tech support for a software product? :-)

AHS 




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

Date: Mon, 23 Oct 2006 23:41:56 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: string substitution for a file, without replacing partial string?
Message-Id: <4q4r5bFlj0rpU1@individual.net>

Arved Sandstrom wrote:
> <anno4000@radom.zrz.tu-berlin.de> wrote:
>>gavino <bootiack@yahoo.com> wrote:
>>>
>>>Didn't work
>>
>>That's a pretty rude reply to a helpful message, don't you think?
>>Not to mention the lack of any context.
> 
> Come, come, that's the standard initial reply from a disgruntled consumer. 
> Have you never worked tech support for a software product? :-)

Since when does clpmisc provide tech support for software products?

-- 
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl


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

Date: Mon, 23 Oct 2006 17:11:55 GMT
From: "Mumia W. (reading news)" <paduille.4060.mumia.w@earthlink.net>
Subject: Re: Switch module misbehavior
Message-Id: <vJ6%g.11316$Lv3.5547@newsread1.news.pas.earthlink.net>

On 10/23/2006 09:39 AM, Berk Birand wrote:
> On Mon, 23 Oct 2006 07:14:21 +0000, Mumia W. (reading news) wrote:
>> [...]
>> My advice 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
> 

Read the perl documentation that's already installed onto your system. 
Open a command prompt and type this:

perldoc -q switch


-- 
paduille.4060.mumia.w@earthlink.net



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

Date: Mon, 23 Oct 2006 21:57:48 +0200
From: "Peter J. Holzer" <hjp-usenet2@hjp.at>
Subject: Re: Why I no longer use Perl
Message-Id: <slrnejq7lr.feu.hjp-usenet2@yoyo.hjp.at>

On 2006-10-23 13:40, strenholme.usenet@gmail.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 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 á | /usr/bin/perl -pe 's/á/aye/'
> á
> $ echo á | /usr/local/bin/perl -pe 's/á/aye/'
> aye
>
> So, is there any way to work around this problem? Nope.

You don't include enough information about your environment to be sure
where the bug is, but it is probably in perl 5.8.0 and was later fixed.
There were quite a few unicode-related bugs in 5.8.0. However, perl
5.8.0 is now more than 4 years old and was superceded by perl 5.8.1 more
than three years ago.

> You might think "use utf8" will fix this issue. It doesn't.

I'm not sure what "the issue" is, but I'm quite sure that you haven't
understood what "use utf8" does: It tells the perl compiler that the
source code is in UTF-8. It doesn't say anything about the encoding of
the files your script reads.


> $ cat unicode.char
> á
> $ cat unicode.script
> use utf8;
>
> open(A,"< unicode.char");

open(A, '<:utf8', 'unicode.char');


> while(<A>) {
>
>         $_ =~ s/á/aye/;
>         print;
>
> }
> $ /usr/bin/perl unicode.script
> aye
> $ /usr/local/bin/perl unicode.script
> á
>
> As you can see, "use utf8" just causes Perl 5.8.0 to do the right
> thing,

Er, no. Perl 5.8.0 still does the wrong thing, and Perl 5.8.8 does the
right thing. You just made another error which makes it look like it is
the other way round (sometimes two wrongs do make a right).

> 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.

If the scripts are buggy and depend on the bug being fixed, I'm sure
they will break in Python, too. If a bug fix doesn't change the
behaviour the bug isn't fixed.

	hp


-- 
   _  | Peter J. Holzer    | > Wieso sollte man etwas erfinden was nicht
|_|_) | Sysadmin WSR       | > ist?
| |   | hjp@hjp.at         | Was sonst wäre der Sinn des Erfindens?
__/   | http://www.hjp.at/ |	-- P. Einstein u. V. Gringmuth in desd


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

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


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