[17998] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 158 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Jan 27 18:14:41 2001

Date: Sat, 27 Jan 2001 15:05:14 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <980636713-v10-i158@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Sat, 27 Jan 2001     Volume: 10 Number: 158

Today's topics:
    Re: Apple <jdf@pobox.com>
        dbi.pm <jtjohnston@courrier.usherb.ca>
    Re: dbi.pm tigra@sky.deep.ru
    Re: dbi.pm <comdog@panix.com>
    Re: FAQ status and reposts, was Re: FAQ 1.5:   What is  (Chris Fedde)
    Re: Finding a char in string <godzilla@stomp.stomp.tokyo>
    Re: Finding a char in string <james@NOSPAM.demon.co.uk>
    Re: Get/install ReadKey.pm from CPAN -- HowTo? <jdf@pobox.com>
    Re: Get/install ReadKey.pm from CPAN -- HowTo? (at)msn.(dot)(deletethis)
    Re: Get/install ReadKey.pm from CPAN -- HowTo? (at)msn.(dot)(deletethis)
        How to unload module from memory? tigra@sky.deep.ru
    Re: MS Access <jtjohnston@courrier.usherb.ca>
    Re: MS Access <jtjohnston@courrier.usherb.ca>
    Re: MS Access (Garry Williams)
    Re: MS Access (Garry Williams)
    Re: MS Access (Garry Williams)
    Re: MS Access <comdog@panix.com>
    Re: Perl is bad at (very) simple math! <feldspar@ix.netcom.com>
        Perl programmer wanted <lrw@uswest.net>
    Re: Quick RegExp Question <godzilla@stomp.stomp.tokyo>
    Re: Quick RegExp Question tigra@sky.deep.ru
        Reading/displaying a raw character (at)msn.(dot)(deletethis)
        Storable Module <david@habanero.chem.usu.edu>
    Re: Storable Module <comdog@panix.com>
    Re: Storable Module <david@habanero.chem.usu.edu>
        substition problem <anon@anon.com>
    Re: Text:CSV can't handle german characters tigra@sky.deep.ru
    Re: Text:CSV can't handle german characters <marc.beck@bigfoot.com>
        use of FreezeThaw w/ activestate on win32? psyshrike@my-deja.com
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: 27 Jan 2001 14:53:05 -0500
From: Jonathan Feinberg <jdf@pobox.com>
Subject: Re: Apple
Message-Id: <7l3ghivy.fsf@pobox.com>

"Jane Millson" <jane__millson@hotmail.com> writes:

> Is there a version of Perl for Apple computers?

The place to find out: http://www.perl.com/ .

-- 
Jonathan Feinberg   jdf@pobox.com   Sunny Brooklyn, NY
http://pobox.com/~jdf


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

Date: Sat, 27 Jan 2001 14:46:44 -0500
From: jtjohnston <jtjohnston@courrier.usherb.ca>
Subject: dbi.pm
Message-Id: <3A7325A4.CD694624@courrier.usherb.ca>

Where can I find/download the dbi.pm?
Can't locate dbi.pm in @INC (@INC contains:...)

an e-mail would be helpful,

Thanks

J



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

Date: Sat, 27 Jan 2001 20:51:00 GMT
From: tigra@sky.deep.ru
Subject: Re: dbi.pm
Message-Id: <94vcbh$bdh$1@nnrp1.deja.com>

In article <3A7325A4.CD694624@courrier.usherb.ca>,
  jtjohnston <jtjohnston@courrier.usherb.ca> wrote:
> Where can I find/download the dbi.pm?
> Can't locate dbi.pm in @INC (@INC contains:...)

It's usually located at CPAN (www.cpan.org). Hmm, but it's called
DBI.pm, not dbi.pm (I don't know if it makes sense on Win32 systems)

Sergey


Sent via Deja.com
http://www.deja.com/


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

Date: Sat, 27 Jan 2001 16:45:55 -0500
From: brian d foy <comdog@panix.com>
Subject: Re: dbi.pm
Message-Id: <comdog-A11E5C.16455527012001@news.panix.com>

In article <3A7325A4.CD694624@courrier.usherb.ca>, jtjohnston 
<jtjohnston@courrier.usherb.ca> wrote:

> Where can I find/download the dbi.pm?
> Can't locate dbi.pm in @INC (@INC contains:...)

http://search.cpan.org

-- 
brian d foy <comdog@panix.com>
no longer for hire ;)


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

Date: Sat, 27 Jan 2001 22:24:25 GMT
From: cfedde@fedde.littleton.co.us (Chris Fedde)
Subject: Re: FAQ status and reposts, was Re: FAQ 1.5:   What is perl6?
Message-Id: <tUHc6.1363$B9.192883200@news.frii.net>

In article <Pine.LNX.4.30.0101252305540.16428-100000@lxplus003.cern.ch>,
Alan J. Flavell <flavell@mail.cern.ch> wrote:
>On Thu, 25 Jan 2001, Uri Guttman wrote:
>
>> >>>>> "PS" == PerlFAQ Server <faq@denver.pm.org> writes:
>
>[...]
>
>> well, this is highly out of date. topaz is defunct and there is a real
>> perl6 project in the works which has nothing to do with it (other than
>> to learn from it).
>
>Well, this is another symptom of a general problem.  AFAICS, our
>friend the FAQ-reposter is posting extracts from the FAQs that are
>distributed with a released version of Perl.  But those are out of
>date in a number of respects.
>

Nearly all the changes and recomendations that have been posted or
mailed to the Faq Server are being integrated into my copy of the
perlfaq?.pod files.  As the modifications come I'm also posting
patches to the perlfaq-suggestions@perl.com address.  Unless I hear
otherwise the next lap will be postings from my modified version
of the FAQ.  If you have any comments on this I'd love to hear
them.

chris
-- 
    This space intentionally left blank


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

Date: Sat, 27 Jan 2001 11:14:45 -0800
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: Finding a char in string
Message-Id: <3A731E25.51803F7F@stomp.stomp.tokyo>

Henrik Thostrup Jensen wrote:

(various snippage)

> I've need to find a certain char (";") in a string and remove all that
> is after the char.

Yours is another classic example of when substring
would be a better choice over a regex method.

For my test script below, if you wish to retain
your semicolon, add one to the index function inside
my substring function. This will grab your semicolon
along with your other preceding data:

 ... index ($string, ";") + 1));


Godzilla!
--

TEST SCRIPT:
____________


#!perl

print "Content-type: text/plain\n\n";

$string ="Save This Info; Toss This Info";

$new_string = substr ($string, 0, index ($string, ";"));

print $new_string;

exit;


PRINTED RESULTS:
________________

Save This Info


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

Date: Sat, 27 Jan 2001 21:56:30 +0000
From: James Taylor <james@NOSPAM.demon.co.uk>
Subject: Re: Finding a char in string
Message-Id: <ant27213072bfNdQ@oakseed.demon.co.uk>

In article <3A731E25.51803F7F@stomp.stomp.tokyo>, Godzilla!
<URL:mailto:godzilla@stomp.stomp.tokyo> wrote:
>
> Henrik Thostrup Jensen wrote:
> > I've need to find a certain char (";") in a string
> > and remove all that is after the char.
> 
> Yours is another classic example of when substring
> would be a better choice over a regex method.
>
  [snip]
>
> $new_string = substr ($string, 0, index ($string, ";"));

Is your reason for suggesting this substr-index combination
in preference to a regex solution simply that the former is
faster, or are there other benefits too?

-- 
James Taylor <james (at) oakseed demon co uk>
PGP key available ID: 3FBE1BF9
Fingerprint: F19D803624ED6FE8 370045159F66FD02



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

Date: 27 Jan 2001 14:52:34 -0500
From: Jonathan Feinberg <jdf@pobox.com>
Subject: Re: Get/install ReadKey.pm from CPAN -- HowTo?
Message-Id: <bssshiwt.fsf@pobox.com>

"Richard Muller" <rlmuller(at)msn.(dot)(deletethis).com> writes:

> I had looked at the ActiveState documentation (which, equivalently, I had
> started by double-clicking the Perl\Html\Index.html).  But I couldn't find
> any XML entries in it -- for one thing, there's no built-in search
> mechanism.  Could you suggest a path in it?

If PPM did not update the table of contents that appears in the
left-hand frame to include your newly-installed XML::DOM module, then
I'd guess you have an out-of-date installation of ActivePerl.  You
might consider upgrading.

I'm glad my followup was helpful!

As for searching, I'd suggest hacking up a cgi script to search the
<title> tags of all of the html docs.  Better yet, make an index.  If
I do it first, I'll post it here. :)

-- 
Jonathan Feinberg   jdf@pobox.com   Sunny Brooklyn, NY
http://pobox.com/~jdf


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

Date: Sat, 27 Jan 2001 16:10:00 -0500
From: "Richard Muller" <rlmuller(at)msn.(dot)(deletethis).com>
Subject: Re: Get/install ReadKey.pm from CPAN -- HowTo?
Message-Id: <u69FaUKiAHA.319@cpmsnbbsa09>

Thanks, again.




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

Date: Sat, 27 Jan 2001 16:14:43 -0500
From: "Richard Muller" <rlmuller(at)msn.(dot)(deletethis).com>
Subject: Re: Get/install ReadKey.pm from CPAN -- HowTo?
Message-Id: <eCgZDXKiAHA.291@cpmsnbbsa09>

Jonathan,

> If PPM did not update the table of contents

You're right.  It was there.  Your comment prompted me to double-check,
whereupon I came to realize that the top-level entries where in alphabetical
order.  So of coure, XML was at the end with a half dozen or so subentries.

Regards,
Richard




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

Date: Sat, 27 Jan 2001 19:04:32 GMT
From: tigra@sky.deep.ru
Subject: How to unload module from memory?
Message-Id: <94v63s$654$1@nnrp1.deja.com>

Hi.

I want to implement something akin Apache::Registry on my own. The
problem is that I want to unload modules when some time expires but
don't know how to do this. Reloading modules seems doesn't expose any
problems: just undef all module's functions and eval the source again.
But what about undefining the module itself in case I don't need it
anymore (but I do need the memory it consumes)? Do I really need this or
the black magic of garbage collection does this job?

Thanks in advance,
Sergey


Sent via Deja.com
http://www.deja.com/


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

Date: Sat, 27 Jan 2001 14:35:22 -0500
From: jtjohnston <jtjohnston@courrier.usherb.ca>
Subject: Re: MS Access
Message-Id: <3A7322FA.DA968B67@courrier.usherb.ca>

> perldoc dbi

I would Mike, if my sysadmin would let me anywhere near it! I can't
telnet on to my server.

Thanks,

John



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

Date: Sat, 27 Jan 2001 14:38:30 -0500
From: jtjohnston <jtjohnston@courrier.usherb.ca>
Subject: Re: MS Access
Message-Id: <3A7323B6.ACA44F94@courrier.usherb.ca>

I sooked and had it checked: "dbi" not available.

MSherrill@compuserve.com wrote:

> On Fri, 26 Jan 2001 19:36:32 -0500, jtjohnston
> <jtjohnston@courrier.usherb.ca> wrote:
>
> >I need enough code to be able to open and display a couple of
> >lines in a Microsoft Access file called db1.mdb, in a table called
> >QuizData, that looks a bit like this:
>
> perldoc dbi
>
> --
> Mike Sherrill
> Information Management Systems



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

Date: Sat, 27 Jan 2001 20:21:22 GMT
From: garry@zvolve.com (Garry Williams)
Subject: Re: MS Access
Message-Id: <65Gc6.1081$GF2.37229@eagle.america.net>

On Sat, 27 Jan 2001 16:53:41 GMT, MSherrill@compuserve.com
<MSherrill@compuserve.com> wrote:
>On Fri, 26 Jan 2001 19:36:32 -0500, jtjohnston
><jtjohnston@courrier.usherb.ca> wrote:
>
>>I need enough code to be able to open and display a couple of
>>lines in a Microsoft Access file called db1.mdb, in a table called
>>QuizData, that looks a bit like this:
>
>perldoc dbi

 perldoc DBI

But that still isn't going to help much.  I might be a good start,
though.  

-- 
Garry Williams


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

Date: Sat, 27 Jan 2001 20:22:31 GMT
From: garry@zvolve.com (Garry Williams)
Subject: Re: MS Access
Message-Id: <b6Gc6.1083$GF2.37229@eagle.america.net>

On Sat, 27 Jan 2001 14:35:22 -0500, jtjohnston
<jtjohnston@courrier.usherb.ca> wrote:
>> perldoc dbi
>
>I would Mike, if my sysadmin would let me anywhere near it! I can't
>telnet on to my server.

Of course you could just type the command on your own computer.  

-- 
Garry Williams


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

Date: Sat, 27 Jan 2001 20:24:04 GMT
From: garry@zvolve.com (Garry Williams)
Subject: Re: MS Access
Message-Id: <E7Gc6.1085$GF2.37229@eagle.america.net>

On Sat, 27 Jan 2001 14:38:30 -0500, jtjohnston
<jtjohnston@courrier.usherb.ca> wrote:
>MSherrill@compuserve.com wrote:
>
>> On Fri, 26 Jan 2001 19:36:32 -0500, jtjohnston
>> <jtjohnston@courrier.usherb.ca> wrote:
>>
>> >I need enough code to be able to open and display a couple of
>> >lines in a Microsoft Access file called db1.mdb, in a table called
>> >QuizData, that looks a bit like this:
>>
>> perldoc dbi
>>
>I sooked and had it checked: "dbi" not available.

Try `DBI'.  It does make a difference on many computers.  

-- 
Garry Williams


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

Date: Sat, 27 Jan 2001 16:45:29 -0500
From: brian d foy <comdog@panix.com>
Subject: Re: MS Access
Message-Id: <comdog-0E7171.16452927012001@news.panix.com>

In article <3A7322FA.DA968B67@courrier.usherb.ca>, jtjohnston 
<jtjohnston@courrier.usherb.ca> wrote:

> > perldoc dbi
> 
> I would Mike, if my sysadmin would let me anywhere near it! I can't
> telnet on to my server.

then use http://search.cpan.org which has been mentioned several
times in this group.

-- 
brian d foy <comdog@panix.com>
no longer for hire ;)


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

Date: Sat, 27 Jan 2001 15:39:43 -0400
From: Antaeus Feldspar <feldspar@ix.netcom.com>
Subject: Re: Perl is bad at (very) simple math!
Message-Id: <3A7323FF.5FFA7CE3@ix.netcom.com>

michal@gortel.phys.ualberta.ca wrote:
> 
> philhibbs@my-deja.com wrote:
> > abigail@foad.org wrote:
> >> get rid of the idea that doing floating point
> >> arithmetic using binary computers that consist of
> >> a finite amount of atoms is actually feasible.
> 
> > I disagree - there's even an IEEE format for BCD floating point, and
> > IIRC the x87 FPU supports it. I may be wrong about that. It's an option
> > that my father and I were considering implementing in a Basic
> > interpreter that we wrote in the 80s.
> 
> And how that would help you with with numbers not representable in a
> decimal notation or with a representation too long for capacities of
> your format?  Or you are an accountant which habitually rounds
> everything to two decimal places in a fraction?  Mind you, this is still
> rounding but maybe you are so used to it that you stopped notice that?
> 
>   Michal

A single place after the decimal is not representable by a finite
number of atoms?

I know the original poster should have read the FAQ but some of the
responses have been unbelievable.

	-jc


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

Date: Sat, 27 Jan 2001 12:29:29 -0700
From: "WmSon Family" <lrw@uswest.net>
Subject: Perl programmer wanted
Message-Id: <rlFc6.1315$5X5.238176@news.uswest.net>

One simple task, $30 or less. Possible admin or mod allowances at a UBB, the
Poketavern as a reward also.




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

Date: Sat, 27 Jan 2001 11:42:08 -0800
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: Quick RegExp Question
Message-Id: <3A732490.7EC0A572@stomp.stomp.tokyo>

Paul Burney wrote:

(significant snippage)
 
> I'm trying to write a small filter that will take an HTML file and
> remove the top and bottom.  That is, everything until the end of the
> <body> tag and everything after the last </body> tag.

Using Perl's substring function will accomplish
this quicker and more efficiently with very
good reliability.

Your wording is somewhat unclear. My presumption is you
want everything 'between' an opening body tag and
a closing body tag rather than including the closing
body tag as you indicate.

If you want the closing body tag included, make this
change by adding seven to $stop:

$stop = rindex ($string, "</body>") + 7;

Godzilla!
--

TEST SCRIPT:
____________


#!perl

print "Content-type: text/plain\n\n";

$string ="<html><head><title>toss this
<body>save all this<a tag>stuff here
</a tag>and save this too</body></html>";

$start = index ($string, "<body>") + 6;
$stop = rindex ($string, "</body>");

$new_string = substr ($string, $start, $stop - $start);

print $new_string;

exit;


PRINTED RESULTS:
________________

save all this<a tag>stuff here
</a tag>and save this too


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

Date: Sat, 27 Jan 2001 20:42:55 GMT
From: tigra@sky.deep.ru
Subject: Re: Quick RegExp Question
Message-Id: <94vbse$avl$1@nnrp1.deja.com>

In article <94uuaa$710$1@carroll.library.ucla.edu>,
  "Paul Burney" <nospam@nospam.edu> wrote:
> I'm trying to write a small filter that will take an HTML file and
> remove the top and bottom.  That is, everything until the end of the
> <body> tag and everything after the last </body> tag.
>
> Here's what I was trying:
>
> > #!/usr/local/bin/perl -i.old -p -w
> >
> > use diagnostics;
> > use strict;
> >
> > $/ = '';
> > s/(.*?)(<body)([^>]+)(>)(.*)(<\/body)(.*?)/$5/gims;

The problem is in the '?' quantifier at the end of the regexp. It's
side-effect is that after matching all you need including the '</body'
string the regexp stops. So probably the rest of the text goes as-is.
The resulting regexp should look like this:
s/(.*?)(<body)([^>]+)(>)(.*)(<\/body)(.*)/$5/gims;

Next. To reduce penalty for saving $1, $2, $3, ... It's better to use:
s/.*?<body[^>]+>(.*)<\/body.*/$1/gims;

After that. If all you want is contained between first occurences
'<body>' and '</body>' it'd be better to write this (note '-0' at
command line and the absence of 'g' at regexp modfier):

=cut
#!/usr/bin/perl -0 -i.old -p -w

use diagnostics;
use strict;

/<body[^>]+>(.*?)<\/body/ims;
$_ = $1;
=cut

But in real life the problem you're trying to solve may just not be as
simple as you think. "The Perl Cookbook" and HTML::* modules will help
then.

Good luck!
Sergey


Sent via Deja.com
http://www.deja.com/


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

Date: Sat, 27 Jan 2001 15:01:20 -0500
From: "Richard Muller" <rlmuller(at)msn.(dot)(deletethis).com>
Subject: Reading/displaying a raw character
Message-Id: <eP8GDuJiAHA.340@cpmsnbbsa09>

Hi all,

I wrote:

  ReadMode('cbreak');
  while(1)
  {
     my $c = ReadKey(0);
     last unless defined $c;
     print  "\nGot response \"" . $c . \"\"\n";
     printf("\n             Decimal:%d\tHex: %X String:%s\n", ord($c),
ord($c), $c);
  }
  ReadMode('normal');

typed 'y' when prompted, and got:

  Continue (Y/N)
  Got response "ySCALAR(0x1ab7abc)
               Decimal:121        Hex: 79 String:y

What do I have to do to plain $c in the "Got response" line to avoid the
"corruption" of "SCALAR..."?

TIA,
Richard




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

Date: Sat, 27 Jan 2001 14:36:04 -0700
From: david farrelly <david@habanero.chem.usu.edu>
Subject: Storable Module
Message-Id: <3A733F44.287C3B2A@habanero.chem.usu.edu>

Hello,

I'm unable to install the Storable module on an SGI (IRIX) Origin 200.
The Storable.c module won't compile. Anyone experienced this problem
and/or know of a fix?

Thanks

David FArrelly



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

Date: Sat, 27 Jan 2001 17:10:11 -0500
From: brian d foy <comdog@panix.com>
Subject: Re: Storable Module
Message-Id: <comdog-64A229.17101127012001@news.panix.com>

In article <3A733F44.287C3B2A@habanero.chem.usu.edu>, david farrelly 
<david@habanero.chem.usu.edu> wrote:

> I'm unable to install the Storable module on an SGI (IRIX) Origin 200.
> The Storable.c module won't compile. Anyone experienced this problem
> and/or know of a fix?

perhaps you could show everyone the compilation error messages?

-- 
brian d foy <comdog@panix.com>
no longer for hire ;)


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

Date: Sat, 27 Jan 2001 15:27:50 -0700
From: david farrelly <david@habanero.chem.usu.edu>
Subject: Re: Storable Module
Message-Id: <3A734B66.2F8ECE01@habanero.chem.usu.edu>



brian d foy wrote:

> In article <3A733F44.287C3B2A@habanero.chem.usu.edu>, david farrelly
> <david@habanero.chem.usu.edu> wrote:
>
> > I'm unable to install the Storable module on an SGI (IRIX) Origin 200.
> > The Storable.c module won't compile. Anyone experienced this problem
> > and/or know of a fix?
>
> perhaps you could show everyone the compilation error messages?
>

Sure,


>
> make
>         cc -n32 -mips3 -c  -DBSD_TYPES -D_BSD_SIGNALS -D_BSD_TIME -DL
> ANGUAGE_C -woff 1009 -O2 -OPT:Olimit=0     -DVERSION=\"1.006\"  -DXS_
> VERSION=\"1.006\"  -I/usr/share/lib/perl5/irix-n32/5.003/CORE  Storab
> le.c
> "Storable.c", line 1012: error(1133): expression must be a modifiable
>  lvalue
>                 HeVAL(he) = &PL_sv_undef;
>                 ^
>
> "Storable.c", line 1016: error(1133): expression must be a modifiable
>  lvalue
>                 HeVAL(he) = &PL_sv_undef;
>                 ^
>
> "Storable.c", line 1237: error(1515): a value of type "int" cannot be
>  assigned
>           to an entity of type "GV *"
>         gv = gv_fetchmethod_autoload(pkg, method, FALSE);
>            ^
>
> "Storable.c", line 1788: error(1140): a value of type "int" cannot be
>  used to
>           initialize an entity of type "SV *"
>                         SV *key = hv_iterkeysv(he);
>                                   ^
>
> "Storable.c", line 1798: error(1140): a value of type "int" cannot be
>  used to
>           initialize an entity of type "HE *"
>                         HE *he  = hv_fetch_ent(hv, key, 0, 0);
>                                   ^
>
> "Storable.c", line 1799: error(1140): a value of type "int" cannot be
>  used to
>           initialize an entity of type "SV *"
>                         SV *val = HeVAL(he);
>                                   ^
>
> "Storable.c", line 3511: error(1020): identifier "HEf_SVKEY" is undef
> ined
>         sv_magic(tv, sv, 'p', (char *)key, HEf_SVKEY);
>                                            ^
>
> 7 errors detected in the compilation of "Storable.c".
> *** Error code 2 (bu21)



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

Date: Sat, 27 Jan 2001 14:12:48 -0800
From: Peter <anon@anon.com>
Subject: substition problem
Message-Id: <MPG.14dce7beb995b3e59896a6@news.supernews.com>

I'm having trouble substituting these two strings using the substitution 
operator. I'm getting syntax errors, I don't know what needs a backslash 
and what doesn't.

old: <EM>HTML created by <A HREF="http://www.gendex.com/ged2html/">
GED2HTML v3.5e-WIN95-UNREGISTERED (Sep 26 1998)</A> on 05/08/99 06:02:56 
</EM>.

new: <!--#include virtual="/george/george.cgi"-->

Can anyone help?


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

Date: Sat, 27 Jan 2001 19:46:36 GMT
From: tigra@sky.deep.ru
Subject: Re: Text:CSV can't handle german characters
Message-Id: <94v8ir$85p$1@nnrp1.deja.com>

In article <94v2rf$f4kl8$1@ID-23826.news.dfncis.de>,
  "Marc Beck" <marc.beck@bigfoot.com> wrote:
> Hello,
>
> I just integrated the Text::CSV::parse method into my Script to
convert =
> a CSV to a SQL-Table.
> The Problem with this module is that it won't handle any strings =
> containing =E4, =F6, =FC or any other special german characters.
> How can does the CSV module have to be modified so it will work?
>

If you peer into the CSV.pm, you'll see something like this in the
internals:
      if ($column =~ /[^\t\040-\176]/) {

        # an argument contained an invalid character...
        $self->{'_ERROR_INPUT'} = $column;
        return $self->{'_STATUS'};
      }
This prevents from texts with german, russian, etc. chars to be treated
as corrupted. I've just replaced it by:
      if ($column =~ /[^\t\040-\255]/) {
         ...
      }

There are two places where you should do this. After the hack CSV.pm
works rather fine except for it parses only fields separated by "," and
enclosed into "'" (that's about v0.01) But this is another feature of
CSV.pm.

Sergey


Sent via Deja.com
http://www.deja.com/


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

Date: Sat, 27 Jan 2001 22:01:11 +0100
From: "Marc Beck" <marc.beck@bigfoot.com>
Subject: Re: Text:CSV can't handle german characters
Message-Id: <94vcui$ek653$1@ID-23826.news.dfncis.de>

> > The Problem with this module is that it won't handle any strings =3D
> > containing =3DE4, =3DF6, =3DFC or any other special german =
characters.
> > How does the CSV module have to be modified so it will work?
> >
>=20
> If you peer into the CSV.pm, you'll see something like this in the
> internals:
>       if ($column =3D~ /[^\t\040-\176]/) {
>=20
Yeah, right but this appears within the combine method and hasn't any =
effect on the parse method that I'm using.

cu Marc




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

Date: Sat, 27 Jan 2001 19:49:07 GMT
From: psyshrike@my-deja.com
Subject: use of FreezeThaw w/ activestate on win32?
Message-Id: <94v8nh$8dr$1@nnrp1.deja.com>

Hello,

I want to save a bunch of configuration data from a perltk interface
to a local file. I want portability between win32 and UNIX. I have
used FreezeThaw to do this on UNIX, but am wondering whether anybody
has any experience on using FreezeThaw on win32 and whether it works
dependably. Any problems or caveats etc.


-Thanks in Advance
-Matt


Sent via Deja.com
http://www.deja.com/


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

Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 16 Sep 99)
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: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.

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


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