[29143] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 387 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Apr 27 11:09:51 2007

Date: Fri, 27 Apr 2007 08:09:09 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Fri, 27 Apr 2007     Volume: 11 Number: 387

Today's topics:
        =?iso-8859-1?q?Help_installing_a_module=2E=2E=2E_:=ACS? <dp_pearce@hotmail.com>
        =?iso-8859-1?Q?Re:_Help_installing_a_module..._:=ACS?= <sisyphus1@nomail.afraid.org>
        ANNOUNCE: Google::Adwords v1.2.3 <arcofdescent@gmail.com>
    Re: Cant open a file with just a relative path <nikos1337@gmail.com>
    Re: Cant open a file with just a relative path <nikos1337@gmail.com>
    Re: Cat file a to *.xls files <grace.jim@gmail.com>
    Re: Cat file a to *.xls files <jurgenex@hotmail.com>
    Re: Correlating Data from same .csv, line by line shadkeene@hotmail.com
    Re: Could not find ParserDetails.ini... <sisyphus1@nomail.afraid.org>
    Re: Could not find ParserDetails.ini... <dp_pearce@hotmail.com>
    Re: Determining difference from Vista32 and Vista64 <sisyphus1@nomail.afraid.org>
    Re: FAQ 4.32 How do I strip blank space from the beginn <rvtol+news@isolution.nl>
        Font question <"v.niekerk at hccnet.nl">
        Passing a single hash to a sub <noone@here.invalid>
    Re: Passing a single hash to a sub <mritty@gmail.com>
    Re: Passing a single hash to a sub <noone@here.invalid>
    Re: Readable/writable database in Perl <rvtol+news@isolution.nl>
    Re: Relative path wont work when opening a file for wri <nikos1337@gmail.com>
    Re: SQL statement in Perl doesn't work <shay.rozen@gmail.com>
    Re: SQL statement in Perl doesn't work <"v.niekerk at hccnet.nl">
        translating MS Word codes using regexps <lynn.newton@gmail.com>
    Re: UTF8 European characters in MySQL <john1949@yahoo.com>
    Re: UTF8 European characters in MySQL <jurgenex@hotmail.com>
    Re: UTF8 European characters in MySQL <john1949@yahoo.com>
    Re: UTF8 European characters in MySQL <jurgenex@hotmail.com>
    Re: UTF8 European characters in MySQL <check.sig@for.email.invalid>
    Re: UTF8 European characters in MySQL <jurgenex@hotmail.com>
    Re: video lectures on C, C++, Java, Python  and other p <uri@stemsystems.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: 27 Apr 2007 05:36:46 -0700
From: Devon_Dan <dp_pearce@hotmail.com>
Subject: =?iso-8859-1?q?Help_installing_a_module=2E=2E=2E_:=ACS?=
Message-Id: <1177677405.753560.49270@r3g2000prh.googlegroups.com>

Hi there,

I'm a bit new to all this so please excuse my ignorance. I genuinely
have searched for how to do this with no success. I am using windows
ActiveState (no chance of changing).

I am trying to install VMS::Stdio [http://search.cpan.org/~tty/
kurila-0.1/vms/ext/Stdio/Stdio.pm] but I can't. There is no
makefile.pl like the majority of the modules I have used to date and
there seems to be a hell of a lot more files so I assume it needs
compiling? Perhaps I have the wrong version and there is a CPAN module
somewhere? Can anyone give me advice (something other than RTFM would
be appreciated).

Thanks

Dan



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

Date: Sat, 28 Apr 2007 00:28:23 +1000
From: "Sisyphus" <sisyphus1@nomail.afraid.org>
Subject: =?iso-8859-1?Q?Re:_Help_installing_a_module..._:=ACS?=
Message-Id: <46320864$0$5746$afc38c87@news.optusnet.com.au>


"Devon_Dan" <dp_pearce@hotmail.com> wrote in message 
news:1177677405.753560.49270@r3g2000prh.googlegroups.com...
> Hi there,
>
> I'm a bit new to all this so please excuse my ignorance. I genuinely
> have searched for how to do this with no success. I am using windows
> ActiveState (no chance of changing).

Maaan ... just how avant-garde are you ?  :-)

You're wanting to install kurila-0.1 (released yesterday) on ActivePerl ?

I thought I was reasonably up-to-date with recent perl developments, but I 
certainly don't know what "kurila" is.

Out of curiosity, I downloaded it and have tried to build it with both MinGW 
and MSVC++ 7.0. Both attempts failed.

>
> I am trying to install VMS::Stdio [http://search.cpan.org/~tty/
> kurila-0.1/vms/ext/Stdio/Stdio.pm] but I can't. There is no
> makefile.pl like the majority of the modules I have used to date and
> there seems to be a hell of a lot more files so I assume it needs
> compiling?

You'll find the Makefile in the kurial-0.1\win32 folder. (There's actually 2 
Makefiles - a 'Makefile' for MS compilers, and a 'makefile.mk' for the MinGW 
compiler.)

Just 'cd to the win32 folder, edit the configurable section of the 
appropriate makefile (which should involve editing only the installation 
location and the location/type of the compiler).

Then run '*make' (where '*' is either 'd' or 'n', depending upon which make 
utility you're using - I'm guessing it's 'nmake'), and sit back and watch it 
fail.

When I use 'dmake' I rename 'Makefile' to Makefile.nmake' and 'makefile.mk' 
to 'makefile' - then I know that 'dmake' will process the *correct* 
makefile. (This, faik, may not be a *necessary* step.) But if you're using a 
Microsoft compiler and nmake, there's certainly no need to rename any files.

Trying to build with MSVC++ 7.0 failed almost immediately. But trying to 
build with MinGW proceeded successfully for a few minutes. I didn't bother 
trying to work around the failures - faik it may not be difficult to build 
kurila on Win32. Instinctively, however, I feel it's not gunna be a trivial 
hack :-)

> Perhaps I have the wrong version and there is a CPAN module
> somewhere? Can anyone give me advice (something other than RTFM would
> be appreciated).

Are you sure you need to install this ?

Cheers,
Rob 



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

Date: Fri, 27 Apr 2007 13:17:01 GMT
From: "arcofdescent@gmail.com" <arcofdescent@gmail.com>
Subject: ANNOUNCE: Google::Adwords v1.2.3
Message-Id: <JH5t3x.Kqo@zorch.sf-bay.org>


Hi,

I've released v1.2.3 of the Google::Adwords Perl module. This release
has a bug fix for the getUnitCountForClients() method.

If you use Perl to access the Adwords API, you really should take a
look at this module.

What is Google::Adwords?
This is a collection of Perl modules that provide an easy to use
object oriented interface to the Google Adwords SOAP API. You don't
need to understand SOAP or web services to use this module.

You can visit
http://search.cpan.org/~rohan/Google-Adwords-v1.2.3/lib/Google/Adwords.pm#SYNOPSIS
to see it in action.

If you're on Linux, you can use cpan to install/upgrade, or else
download it from here -
http://search.cpan.org/CPAN/authors/id/R/RO/ROHAN/Google-Adwords-v1.2.3.tar.gz

Thanks,
Rohan




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

Date: 27 Apr 2007 04:25:27 -0700
From: skieros <nikos1337@gmail.com>
Subject: Re: Cant open a file with just a relative path
Message-Id: <1177673127.696837.306020@t38g2000prd.googlegroups.com>

On Apr 25, 5:57 am, Tad McClellan <t...@augustmail.com> wrote:
> skieros <nikos1...@gmail.com> wrote:

> > Wehn i try to use this relative path
>
> relative paths do not start with a directory separator character.
>
> They are relative to the current directory, hence the "relative"
> in "relative path".

Yes my bad.

i was trying to mention this
open(FILE, ">>somefolder/somesubfolder/digest.passwd") or die $!;

which is a relative path but still wont open th file.



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

Date: 27 Apr 2007 04:26:58 -0700
From: skieros <nikos1337@gmail.com>
Subject: Re: Cant open a file with just a relative path
Message-Id: <1177673218.406637.309650@t38g2000prd.googlegroups.com>

On Apr 25, 12:50 pm, mer...@stonehenge.com (Randal L. Schwartz) wrote:

> This question was asked and answered on perlmonks.  Please don't
> repeat the same thread here.
>
> And I find it annoying that someone posts the same question to multiple help
> forums without disclosing such.  It causes an unneeded waste of resources.

yes, Iam sorry, as i explained to pesonal mail i couldnt see those 2
thread on gougle groups up until today...dont know why....thats also
why i posted 2 times.




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

Date: 27 Apr 2007 06:28:56 -0700
From: Jim <grace.jim@gmail.com>
Subject: Re: Cat file a to *.xls files
Message-Id: <1177680536.461519.291620@n35g2000prd.googlegroups.com>

On Apr 26, 6:54 pm, Tad McClellan <t...@augustmail.com> wrote:
> Jim <grace....@gmail.com> wrote:
> > Hi I'm trying to get a perl script to work without much luck.
>
> > What I'm trying to do is to:
>
> > cat filea.txt to all .xls files in a directory
>
> > your help would be appreciated
>
> No Perl needed, just use the shell!
>
> # untested
> for file in *.xls; do
> cat filea.txt >>$file
> done
>
> --
>     Tad McClellan                          SGML consulting
>     t...@augustmail.com                   Perl programming
>     Fort Worth, Texas

Thanks Tad, it worked nicely but, what I need is to have the contents
of filea.txt at the start of the .xls files. Is this possible to do?



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

Date: Fri, 27 Apr 2007 13:56:30 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: Cat file a to *.xls files
Message-Id: <iinYh.9$kg1.1@trndny04>

Jim wrote:
> what I need is to have the contents
> of filea.txt at the start of the .xls files.

Just for clarification: you want to prepend the content of filea.txt to 
every *.xls file in a given directory.
Is this correct?

Your original question was anything but clear.

jue 




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

Date: 27 Apr 2007 06:25:58 -0700
From: shadkeene@hotmail.com
Subject: Re: Correlating Data from same .csv, line by line
Message-Id: <1177680358.247958.140830@b40g2000prd.googlegroups.com>

Thanks for the oh-so candid comments.  It is a CGI program I'm
writing...not trying to hide that from the world...but trying to
expand upon with some statistics output.  I started HTML/CGI three
months ago to write meteorology applications with and I'll be the
first to say this stuff is foreign to me and perhaps always will be.
I'm reading a CGI programming 101 book and just ordered
another...getting hung up on writing effective loops and how to
correlate data in a single line of .csv data.  I suppose I'll look for
the CGI group to post in once I study a bit more and tinker around a
bit.  Your input is appreciated, though your tact leaves something to
be desired.  I'll try to post more completely.
Shad



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

Date: Fri, 27 Apr 2007 22:45:43 +1000
From: "Sisyphus" <sisyphus1@nomail.afraid.org>
Subject: Re: Could not find ParserDetails.ini...
Message-Id: <4631f04c$0$16555$afc38c87@news.optusnet.com.au>


"Devon_Dan" <dp_pearce@hotmail.com> wrote in message 
news:1177593419.267574.299460@t39g2000prd.googlegroups.com...
> Hello.
>
> I am having a bit of a problem using Perl2exe and was wondering if
> anyone can throw some light on how to resolve it.

"Perl2exe" is the IndigoStar utility ... right ?
If so, it might be best to ask on a forum that deals with that utility 
(assuming such exists).
If, otoh, "Perl2exe" is the ActiveState utility that ships with their PDK, 
then you'd be best to ask about it on their PDK mailing list 
(http://listserv.activestate.com/mailman/mysubs ) .

>
> My script runs perfectly from the command line so I know it works.
> However when I try perl2exe myscript.pl I get the following
>
> Warning: Can't locate VMS/Stdio.pm
>    at D:\Perl\lib\File\Temp line 139
>    @INC D:\Perl\lib , d:\Perl\Site
>
>>From what I can see, the VMS::Stdio warning is only used on the VMS
> platform and can be safely ignored.

Seems likely to me, too :-)

> The .exe is still created but when
> it is run, half way through execution I get this
>
> could not find ParserDetails.ini in PERL_STORAGE/XML/SAX
> can't locate object method 'new' via XML::SAX::PurePerl at
> PERL_STORAGE/XML/SAX/ParserFactory.pm line 43
>
> A bit of hunting turned up this 
> http://johnbokma.com/perl/installing-xml-sax.html
> but having tried both fixes, the problem persists. Has anyone had this
> problem before? Perhaps I am missing something blindingly obvious?
>

John's advice is usually sound. Does following his advice lead to the 
creation of ParserDetails.ini ?
If so, did you then re-build the executable ? Did the problem then persist ? 
If so, then perhaps perl2exe is failing to pack it into the executable. If 
so, then perhaps you could package it, yourself, along with the 
perl2exe-built executable. (I'm thinking that if ParserDetails.ini was to be 
found in the same folder as the perl2exe-built executable, then things might 
work .... but I have *no* idea whether it's *really* as simple as that :-)

Have you tried the freely available PAR (with its pp utility) from CPAN ? 
There's certainly good advice available regarding it on the PAR mailing list 
( http://lists.cpan.org/ ).

Cheers,
Rob 



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

Date: 27 Apr 2007 06:46:16 -0700
From: Devon_Dan <dp_pearce@hotmail.com>
Subject: Re: Could not find ParserDetails.ini...
Message-Id: <1177681575.968464.17410@n35g2000prd.googlegroups.com>

Hi Rob,

Thanks for taking the time to respond. Its greatly appreciated.

> "Perl2exe" is the IndigoStar utility ... right ? If so, it might be best to ask on a forum that deals with that utility (assuming such exists).

There doesn't seem to be one. Most of the Perl2exe questions I can
find are here.

> Does following his advice lead to the creation of ParserDetails.ini?

Yes it does, in D:\Perl\site\lib\XML\SAX but having recompiled the
exe, there I still get the same warning

could not find ParserDetails.ini in PERL_STORAGE/XML/SAX
can't locate object method 'new' via XML::SAX::PurePerl at
PERL_STORAGE/XML/SAX/ParserFactory.pm line 43

> If so, then perhaps you could package it yourself

Shall give it a go, and PAR. Thanks for the advice

Dan



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

Date: Fri, 27 Apr 2007 17:10:28 +1000
From: "Sisyphus" <sisyphus1@nomail.afraid.org>
Subject: Re: Determining difference from Vista32 and Vista64
Message-Id: <4631a1b7$0$22073$afc38c87@news.optusnet.com.au>

----- Original Message ----- 
From: <mpetersrx7@gmail.com>
Newsgroups: comp.lang.perl.misc
Sent: Friday, April 27, 2007 2:56 AM
Subject: Determining difference from Vista32 and Vista64


> Is ther any way to determine in the running code the type of OS and
> distinguish from 32-bit vs 64-bit Vista or XP.  I know the
> Win32::GetOSVersion call but both the 32-bit and 64-bit of Vista
> return the same thing for $major, $minor and $id.
>

Ok - so you've worked out how to determine whether it's Vista or not.
(Actually, I'd probably use Win32::GetOSName instead.)

If it's a 64 bit operating system (both XP and Vista, I think) there'll be a
C:\Windows\SysWOW64\ folder - otherwise that folder won't exist.

Actually, faik, there may be a way of installing Windows in such a way that
the system files don't go into the C drive at all .... which would
complicate matters a little.

Anyway, on my Vista64 box:

C:\_32>perl -MWin32 -e "print Win32::GetOSName"
WinVista
C:\_32>perl -e "print -e 'C:/Windows/SysWOW64/cmd.exe'"
1

And that's the same irrespective of whether it's run in the
C:\Windows\System32\cmd.exe shell or the C:/Windows/SysWOW64/cmd.exe shell
 ... and irrespective of whether I run ActiveState's 32-bit build of perl or
their 64-bit build.

Cheers,
Rob 



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

Date: Fri, 27 Apr 2007 11:55:07 +0200
From: "Dr.Ruud" <rvtol+news@isolution.nl>
Subject: Re: FAQ 4.32 How do I strip blank space from the beginning/end of a string?
Message-Id: <f0soib.194.1@news.isolution.nl>

anno4000@radom.zrz.tu-berlin.de schreef:

>     sub normalize_string {
>            my $string = shift;
>            $string =~ tr/ \t\r\n\f\0xa0/ /s;
>            $string =~ s/^ //;
>            $string =~ s/ $//;
>            return $string;
>    }

Variant:

     sub normalize_string {
            my $string = shift;

            tr/ \t\r\n\f\0xa0/ /s,
            s/^ //, 
            s/ $// for $string;

            return $string;
     }

-- 
Affijn, Ruud

"Gewoon is een tijger."


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

Date: Fri, 27 Apr 2007 16:59:59 +0200
From: Huub <"v.niekerk at hccnet.nl">
Subject: Font question
Message-Id: <46320fe8$0$6043$e4fe514c@dreader27.news.xs4all.nl>

Hi,

I'm trying to get plain text printed in Courier font. When looking at 
CPAN, I find about 39 modules for handling fonts, but none for plain 
text. Is there a module for that? BTW, I used font+courier as a search 
string in CPAN.

Thanks,

Huub


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

Date: Fri, 27 Apr 2007 07:17:01 -0800
From: darius <noone@here.invalid>
Subject: Passing a single hash to a sub
Message-Id: <30348857789.8554256396.39199@news.newsguy.com>

Hi

This looks correct, yet isn't

%h = ();
test('hello','there',%h);
print( $h{'hello'});

sub test
{
	my ($k,$v,%h) = @_;
	$h{$k} = $v;	
}

perl says unse of uninit. value in print.

I tried passing by ref

%h = ();
test('hello','there',\%h);
print( $h{'hello'});

sub test
{
	my ($k,$v,$ref) = @_;
    	my (%h) = %$ref;
	$h{$k} = $v;	
}

doesn't work either.

sorry for the newbie Q, but I'm stumped.


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

Date: 27 Apr 2007 07:37:58 -0700
From: Paul Lalli <mritty@gmail.com>
Subject: Re: Passing a single hash to a sub
Message-Id: <1177684678.694915.190460@c18g2000prb.googlegroups.com>

On Apr 27, 11:17 am, darius <n...@here.invalid> wrote:
> Hi
>
> This looks correct, yet isn't
>
> %h = ();
> test('hello','there',%h);
> print( $h{'hello'});
>
> sub test
> {
>         my ($k,$v,%h) = @_;
>         $h{$k} = $v;    
>
> }
>
> perl says unse of uninit. value in print.
>
> I tried passing by ref
>
> %h = ();
> test('hello','there',\%h);
> print( $h{'hello'});
>
> sub test
> {
>         my ($k,$v,$ref) = @_;
>         my (%h) = %$ref;
>         $h{$k} = $v;    
>
> }
>
> doesn't work either.
>
> sorry for the newbie Q, but I'm stumped.

In both cases, you're making copies of the hash.  The keys/values are
copied over into a brand new hash that has nothing at all to do with
the old one.

You want to directly modify the existing hash.  To do this, like your
second case, you need to use a reference.  But then you can't create a
new hash using the values of the old hash.  You have to directly
modify the hash that $ref references:

$ref->{$k} = $v;

For more info, please see:
perldoc perlreftut

Paul Lalli



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

Date: Fri, 27 Apr 2007 07:56:07 -0800
From: darius <noone@here.invalid>
Subject: Re: Passing a single hash to a sub
Message-Id: <33063844584.8554256396.39199@news.newsguy.com>

Paul Lalli <mritty@gmail.com> wrote in 
news:1177684678.694915.190460@c18g2000prb.googlegroups.com...

> You want to directly modify the existing hash.  To do this, like your
> second case, you need to use a reference.  But then you can't create a
> new hash using the values of the old hash.  You have to directly
> modify the hash that $ref references:
> 
> $ref->{$k} = $v;
> 
> For more info, please see:
> perldoc perlreftut
> 


Thank you :)


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

Date: Fri, 27 Apr 2007 12:11:49 +0200
From: "Dr.Ruud" <rvtol+news@isolution.nl>
Subject: Re: Readable/writable database in Perl
Message-Id: <f0spei.qs.1@news.isolution.nl>

Eric schreef:

> In the past I have been criticized for posting to this group without
> including all of the code.

Impossible. You should only share a complete (meaning compilable AND
runnable, so with test data, and using warnings AND strictures) script,
never "all of the code".

-- 
Affijn, Ruud

"Gewoon is een tijger."



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

Date: 27 Apr 2007 04:21:11 -0700
From: skieros <nikos1337@gmail.com>
Subject: Re: Relative path wont work when opening a file for writing
Message-Id: <1177672871.748834.43510@o40g2000prh.googlegroups.com>

On Apr 24, 11:11 pm, "J. Gleixner" <glex_no-s...@qwest-spam-
no.invalid> wrote:
> Mark Clements wrote:
> > skieros wrote:

> >> Hello i have the above code that i have changed from absolute hdd path
> >> to a relative to a web server path, but after the change the file
> >> cannot be opened.
>
> Why not?  What's the error?

Perl cannot find the file to open.



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

Date: 27 Apr 2007 00:41:47 -0700
From: ikeon <shay.rozen@gmail.com>
Subject: Re: SQL statement in Perl doesn't work
Message-Id: <1177659707.143785.291270@r3g2000prh.googlegroups.com>

On Apr 26, 9:44 pm, "J. Gleixner" <glex_no-s...@qwest-spam-no.invalid>
wrote:
> Huub wrote:
>
> [...]
>
> > $betaald2006 = "select betaald2006 from hvw where lidnr = $record and
> > naam != ' ' and kenmerk2006 is null";
>
> You don't show the value of $record.
>
> print "SQL=$betaald2006\n";
>
> Actually I'd suggest using a more descriptive variable name..
> $betaald2006_sql, or something like that.
>
> > $sth = $dbh->prepare($betaald2006);
>
> my $sth = $dbh->prepare($betaald2006);
>
> > $sth->execute or die "SQL Error: $DBI::errstr\n";
> > @betaald2006 = $sth->fetchrow_array;
>
> my @betaald2006 = $sth->fetchrow_array;
>
> Verify the results are what you expect:
>
> use Data::Dumper;
> print Dumper(  @betaald2006 );
>
> or maybe simply:
>
> print join( "\n", @betaald2006, '');
>
> Using Dumper might make possible data issue more visible.
>
> FYI: That's only the first row, you'll need a loop to iterate
> through the other rows, if there are more than one.
>
> Using a more descriptive variable name might be useful too. e.g.
> @results, or @betaald2006_results.
>
> > $betaald2006 = @betaald2006;
> > $betaald2006 = $betaald2006[0];
>
> That's pointless, just use $betaald2006[0].
>
> > $vergelijk = "N";
> > if ($betaald2006 eq $vergelijk)
> > {
>
> my $vergelijk = 'N';
> print "Does $betaald2006[0] eq $vergelijk?\n";
> if ( $betaald2006[0] eq $vergelijk) {
>         print "Yes\n";
>
> }
>
> Also, if you're only after the first row, use 'limit 1' in your SQL.
>
>
>
> > And the warning I posted does point to the "if" line. And yes: without
> > the last AND in $betaald2006 the result is fine. With it, I do get that
> > warning about 20 times.
>
> Using a few print statements should show you/us what's going on.

Maybe the problem is in the quote inside. maybe try:

$betaald2006 = "select betaald2006 from hvw where lidnr = $record and
naam != \' \' and kenmerk2006 is null";



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

Date: Fri, 27 Apr 2007 10:33:47 +0200
From: Huub <"v.niekerk at hccnet.nl">
Subject: Re: SQL statement in Perl doesn't work
Message-Id: <4631b56c$0$30478$e4fe514c@dreader30.news.xs4all.nl>

Thank you for your comments. The last answer by Brian McCauley made me 
look again at the query result from the database. It turns out no rows 
were fetched indeed, so the script does work. By changing the range of 
records I got the results I expected in the first place, so I apparently 
misinterpreted the warning.

Huub


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

Date: 27 Apr 2007 05:05:57 -0700
From: neologist <lynn.newton@gmail.com>
Subject: translating MS Word codes using regexps
Message-Id: <1177675557.496447.78550@t38g2000prd.googlegroups.com>

We have a Web form where the input on certain textarea boxes
is filled in by some of our users by cutting and pasting
text from MS Word documents. They think it's plain text, but
it's not. We would like to parse that input before saving it
to the database, e.g., to translate the funny Word quotes to
plain double and single quotes using regexps such as by

s/$Some_MS_Word_Code/"/g;

I'm sure there's a table of standard codes and some examples
of how to make typical substitutions somewhere, possibly
even a CPAN package to assist with this, but I'm not able to
find it because I don't know exactly what I'm looking for.

Can someone point me in the right direction?



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

Date: Fri, 27 Apr 2007 12:58:38 +0100
From: "John" <john1949@yahoo.com>
Subject: Re: UTF8 European characters in MySQL
Message-Id: <4eCdnUDcJ6D2eKzbRVnygQA@eclipse.net.uk>


"Alex" <check.sig@for.email.invalid> wrote in message 
news:AfhYh.44643$bu6.43143@reader1.news.saunalahti.fi...
> John wrote:
>
>> I have created a table with
>>
>> DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci
>>
>> However, the European accented characters appear incorrectly.
>
> A little more information would be helpful. What do they look like? How
> do you view them? ( in mysql's cli, in html, etc.?) What are your locale
> settings? Do you 'use utf8' in you perl script? What system are you
> running your script on?
>
>> What is the standard accepted way to read/write European accented 
>> characters
>> in Perl using  MySql database?
>
> Utf-8 is the new one. ISO-8859-1 (or ISO-8859-15) is the old one and
> still works, but is restricted to western characters.
>
> -- 
> Alex
> e-mail: Domain is iki dot fi. Local-part is alext.
>        local-part at domain

Many thanks.  No, I don't have "use utf8" so I need to look at this package.
It probably is the answer.  Thanks

Regards
John




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

Date: Fri, 27 Apr 2007 13:28:11 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: UTF8 European characters in MySQL
Message-Id: <LTmYh.2$kg1.1@trndny04>

John wrote:
> "Alex" <check.sig@for.email.invalid> wrote in message
>> John wrote:
>>> What is the standard accepted way to read/write European accented
>>> characters
>>> in Perl using  MySql database?
>>
>> Utf-8 is the new one. ISO-8859-1 (or ISO-8859-15) is the old one and
>> still works, but is restricted to western characters.
>
> Many thanks.  No, I don't have "use utf8" so I need to look at this
> package. It probably is the answer.

No, it isn't and you don't.

perldoc utf8:
    utf8 - Perl pragma to enable/disable UTF-8 in source code


Do you want to use e.g. variable names that are non-ASCII? If yes, then use 
utf8 is a good idea.

But it has nothing to do with the _data_ that is processed by the Perl 
program.

jue 




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

Date: Fri, 27 Apr 2007 14:38:18 +0100
From: "John" <john1949@yahoo.com>
Subject: Re: UTF8 European characters in MySQL
Message-Id: <Y4OdnauWSqBaYazbRVnysAA@eclipse.net.uk>


"Jürgen Exner" <jurgenex@hotmail.com> wrote in message 
news:LTmYh.2$kg1.1@trndny04...
> John wrote:
>> "Alex" <check.sig@for.email.invalid> wrote in message
>>> John wrote:
>>>> What is the standard accepted way to read/write European accented
>>>> characters
>>>> in Perl using  MySql database?
>>>
>>> Utf-8 is the new one. ISO-8859-1 (or ISO-8859-15) is the old one and
>>> still works, but is restricted to western characters.
>>
>> Many thanks.  No, I don't have "use utf8" so I need to look at this
>> package. It probably is the answer.
>
> No, it isn't and you don't.
>
> perldoc utf8:
>    utf8 - Perl pragma to enable/disable UTF-8 in source code
>
>
> Do you want to use e.g. variable names that are non-ASCII? If yes, then 
> use utf8 is a good idea.
>
> But it has nothing to do with the _data_ that is processed by the Perl 
> program.
>
> jue
>
Grussgott!

I am now making a little progress with decode_utf8.
I think I am almost there.

Viel spass.
John




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

Date: Fri, 27 Apr 2007 13:57:53 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: UTF8 European characters in MySQL
Message-Id: <BjnYh.1$%f7.0@trndny03>

John wrote:
> Grussgott!

If I ever meet him which is higly unlikely

jue 




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

Date: Fri, 27 Apr 2007 17:07:55 +0300
From: Alex <check.sig@for.email.invalid>
Subject: Re: UTF8 European characters in MySQL
Message-Id: <7tnYh.44776$pC1.21266@reader1.news.saunalahti.fi>

J=FCrgen Exner wrote:

> perldoc utf8:
>     utf8 - Perl pragma to enable/disable UTF-8 in source code

> Do you want to use e.g. variable names that are non-ASCII? If yes, then=
 use=20
> utf8 is a good idea.

Or string literals, yes?
$string =3D 'Gr=FC=DF Gott';
=2E..or am I mistaken?

--=20
Alex
e-mail: Domain is iki dot fi. Local-part is alext.
        local-part at domain


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

Date: Fri, 27 Apr 2007 14:48:09 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: UTF8 European characters in MySQL
Message-Id: <J2oYh.9$r77.2@trndny08>

Alex wrote:
> Jürgen Exner wrote:
>
>> perldoc utf8:
>>     utf8 - Perl pragma to enable/disable UTF-8 in source code
>
>> Do you want to use e.g. variable names that are non-ASCII? If yes,
>> then use utf8 is a good idea.
>
> Or string literals, yes?

No.

> $string = 'Grüß Gott';
> ...or am I mistaken?

Yes, you are. Just give it a try.

jue 




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

Date: Fri, 27 Apr 2007 03:25:18 -0400
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: video lectures on C, C++, Java, Python  and other programming and Computer science.
Message-Id: <x7slam2s9t.fsf@mail.sysarch.com>

>>>>> "A" == AK444  <Arao44@gmail.com> writes:

  A> Check here http://freevideolectures.com/computerscience.html  for
  A> video lectures on Programming languages like C, C++, Java, COBOL
  A> etc.., OS, Algorithms, Data Structures, RDBMS,
  A> Web designing, etc..........

why no perl mention? you spammed us!

  A> It also has amazing collection of video lectures and animations on all
  A> Engineering and Medical Sciences. I am sure you will be surprised to
  A> see such great collection.

  A> Do you like it???

no. no way you could do a good lecture on perl or any programming
language. spammers never do these well.

now please FOAD like a mating mayfly.

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: 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 387
**************************************


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