Re: quoted-printable characters

2007-06-22 Thread Tom Phoenix
On 6/22/07, Tom Allison <[EMAIL PROTECTED]> wrote: MIME::QuotedPrintable seems to only do conversions to ASCII which screws up the conversion. What's MIME::QuotedPrintable? I can't find it on CPAN. http://search.cpan.org When you find out how to do what you want, or if you can fix MIME::Q

quoted-printable characters

2007-06-22 Thread Tom Allison
OK, on to the next one... charset = iso-8859-9 Quoted-Printable MIME::QuotedPrintable seems to only do conversions to ASCII which screws up the conversion. I could do conversion to utf via: use Encode; decode('MIME-Header',$string) where $string is represented as a header: =?iso-8859-9?Q?

Re: Count co-occurrences

2007-06-22 Thread [EMAIL PROTECTED]
On Jun 22, 5:48 pm, [EMAIL PROTECTED] (Andrej Kastrin) wrote: > Dear all, > > I wrote a simple sql querry to count co-occurrences between words but it > performs very very slow on large datasets. So, it's time to do it with > Perl. I need just a short tip to start out: which structure to use to > c

Re: How can I compare Bytes in a Binary File?

2007-06-22 Thread Dustin Ho
Awesome, thanks to all! chr() and ord() were exactly what I was looking for. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: Uninstalling a PERL module

2007-06-22 Thread Mumia W.
On 06/22/2007 03:46 PM, a_arya2000 wrote: Hello, does anyone know what is the most effective way of uninstalling perl module? Thank you. As you know, going into the build directory for a module and executing "make uninstall" doesn't yet work for CPAN-installed modules :-) For most modules,

Re: Uninstalling a PERL module

2007-06-22 Thread oryann9
--- a_arya2000 <[EMAIL PROTECTED]> wrote: > Hello, does anyone know what is the most effective > way > of uninstalling perl module? Thank you. > Why would you want to do such a thing? Just take the path to this module out of @INC by editing your .profile and or PERL5LIB variable, unless you thi

Re: Uninstalling a PERL module

2007-06-22 Thread Chas Owens
On 6/22/07, Chas Owens <[EMAIL PROTECTED]> wrote: On 6/22/07, Chas Owens <[EMAIL PROTECTED]> wrote: snip > Why do you uninstall a module in the first place? This is something I > have never understood. I have tons of modules installed and the > everything in @INC (baring the current directory)

Re: Uninstalling a PERL module

2007-06-22 Thread Chas Owens
On 6/22/07, Chas Owens <[EMAIL PROTECTED]> wrote: snip Why do you uninstall a module in the first place? This is something I have never understood. I have tons of modules installed and the everything in @INC (baring the current directory) takes up less than 50 megs, so it can't be space issues.

Re: Uninstalling a PERL module

2007-06-22 Thread Chas Owens
On 6/22/07, a_arya2000 <[EMAIL PROTECTED]> wrote: Hello, does anyone know what is the most effective way of uninstalling perl module? Thank you. If you installed the module through your system's package manager then uninstall it the same way. If you installed it though CPAN, well, the most com

Re: Uninstalling a PERL module

2007-06-22 Thread Tom Phoenix
On 6/22/07, a_arya2000 <[EMAIL PROTECTED]> wrote: Hello, does anyone know what is the most effective way of uninstalling perl module? The most effective way is first to install the module into a temporary directory. When you're done using it, you can simply delete the directory and its content

Re: Redirecting file handler to STDOUT (SOLVED)

2007-06-22 Thread Paul Lalli
On Jun 22, 1:43 pm, [EMAIL PROTECTED] (Ben Edwards) wrote: > Cool, the * is by reference. If you re-read my post, you will see the word "reference" no where in it. This has nothing to do with references. It involves typeglobs. By the way, this is now the third time (that I've noticed) that you'

Uninstalling a PERL module

2007-06-22 Thread a_arya2000
Hello, does anyone know what is the most effective way of uninstalling perl module? Thank you. Ready for the edge of your seat? Check out tonight's top picks on Yahoo! TV. http://tv.yahoo.com/ -- To u

Re: How can I compare Bytes in a Binary File?

2007-06-22 Thread Tom Phoenix
On 6/22/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: I've got a binary file here that I'm reading byte by byte and I'm trying to compare the raw binary data... but I'm running into problems with bytes without an ASCII representation. For example, if I'm looking for hex value 58 its fine, bec

Re: How can I compare Bytes in a Binary File?

2007-06-22 Thread Chas Owens
On 6/22/07, Bob McConnell <[EMAIL PROTECTED]> wrote: snip The function you need is 'ord $byte'. snip And make sure you use the bytes pragma. If you don't then you might be surprised by characters that take up more than one byte. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional comm

Re: Count co-occurrences

2007-06-22 Thread Andrej Kastrin
Paul Lalli wrote: On Jun 22, 12:48 pm, [EMAIL PROTECTED] (Andrej Kastrin) wrote: I wrote a simple sql querry to count co-occurrences between words but it performs very very slow on large datasets. So, it's time to do it with Perl. I need just a short tip to start out: which structure to use

RE: How can I compare Bytes in a Binary File?

2007-06-22 Thread Bob McConnell
> -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > Sent: Friday, June 22, 2007 12:04 PM > To: beginners@perl.org > Subject: How can I compare Bytes in a Binary File? > > Hi guys/gals, I'm having a bit of a problem and wondering if anyone > can help. > > I've got a

Re: Redirecting file handler to STDOUT (SOLVED)

2007-06-22 Thread Chas Owens
On 6/22/07, Ben Edwards <[EMAIL PROTECTED]> wrote: Cool, the * is by reference. snip It is a lot more complicated than that. Typeglobs allow you access to the symbol table. You can do some really cool things like *hw = sub { print "Hello, ", shift, "\n" }; hw("bork") -- To unsubscribe, e-ma

Re: Count co-occurrences

2007-06-22 Thread Paul Lalli
On Jun 22, 12:48 pm, [EMAIL PROTECTED] (Andrej Kastrin) wrote: > I wrote a simple sql querry to count co-occurrences between words but it > performs very very slow on large datasets. So, it's time to do it with > Perl. I need just a short tip to start out: which structure to use to > count all pos

How can I compare Bytes in a Binary File?

2007-06-22 Thread dustin . ho
Hi guys/gals, I'm having a bit of a problem and wondering if anyone can help. I've got a binary file here that I'm reading byte by byte and I'm trying to compare the raw binary data... but I'm running into problems with bytes without an ASCII representation. For example, if I'm looking for hex val

Re: Redirecting file handler to STDOUT (SOLVED)

2007-06-22 Thread Ben Edwards
Cool, the * is by reference. Thanks, Ben On 22/06/07, Paul Lalli <[EMAIL PROTECTED]> wrote: On Jun 22, 5:57 am, [EMAIL PROTECTED] (Ben Edwards) wrote: > I am opening a log file: > > open( LOGFILE, ">>cronlog.txt" ); > > This is being written to in lots of places. > > I have been asked to chang

Re: Count co-occurrences

2007-06-22 Thread Chas Owens
On 6/22/07, Andrej Kastrin <[EMAIL PROTECTED]> wrote: Dear all, I wrote a simple sql querry to count co-occurrences between words but it performs very very slow on large datasets. So, it's time to do it with Perl. I need just a short tip to start out: which structure to use to count all possible

Count co-occurrences

2007-06-22 Thread Andrej Kastrin
Dear all, I wrote a simple sql querry to count co-occurrences between words but it performs very very slow on large datasets. So, it's time to do it with Perl. I need just a short tip to start out: which structure to use to count all possible occurrences between letters (e.g. A, B and C) under

Re: Proper class setup?

2007-06-22 Thread Chas Owens
On 6/22/07, Mathew Snyder <[EMAIL PROTECTED]> wrote: snip I'm not sure what you mean by "Change your new() in a new() and init()". snip What do you mean by "set/get approach"? snip Some people believe that new should just create a new blank object and call an init method to do setup. There a

Re: Database connection using cfg file

2007-06-22 Thread Chas Owens
On 6/22/07, Alma <[EMAIL PROTECTED]> wrote: Hi All, I wanted to make a database connection using the values provided in .cfg file snip Don't roll your own config parser. There are many in CPAN. I would suggest using YAML* or YAML::Syck*. The latter is a faster implementation, but it require

RE: Database connection using cfg file

2007-06-22 Thread Andrew Curry
One thing could be [EMAIL PROTECTED]; $usr = @arr[1]; $pwd ||= @arr[2]; They should be $arr[n..] If you turn on strict you can get rid of these as it wont compile until you do. If you take your readcfg. readcfg($cfgpath,\%cfgvalues); sub readcfg { my($cfgpath,$

Database connection using cfg file

2007-06-22 Thread Alma
Hi All, I wanted to make a database connection using the values provided in .cfg file my.cfg *** dbname=xyz user=abc passwd=abc123 *** my perl package which need to read the my.cfg file & make the connection mypackage sub new(){ my @arr=(); readcfg();

RE: still working with utf8

2007-06-22 Thread Bob McConnell
> -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > Sent: Friday, June 22, 2007 8:36 AM > To: [EMAIL PROTECTED]; beginners@perl.org; > Mumia W.; Beginners List > Subject: Re: still working with utf8 > > > >Yes, be prepared for the fact that not all foreign languag

Re: still working with utf8

2007-06-22 Thread tom
On 6/22/2007, "Tom Phoenix" <[EMAIL PROTECTED]> wrote: > >On 6/21/07, Tom Allison <[EMAIL PROTECTED]> wrote: > >> I guess my question is, for CJK languages, should I expect the notion >> of using a regex like \w+ to pick up entire strings of text instead >> of discrete words like latin bas

Re: still working with utf8

2007-06-22 Thread tom
>Yes, be prepared for the fact that not all foreign languages will >support the concept of spaces between words. I don't know anything about >Japanese, but I do vaguely remember from high school that, for Chinese >texts, there are often no spaces between words and the reader's >knowledge of th

Re: writung to file

2007-06-22 Thread Chas Owens
On 6/21/07, Vahid Moghaddasi <[EMAIL PROTECTED]> wrote: On 6/21/07, Chas Owens <[EMAIL PROTECTED]> wrote: > > Well, first you don't use awk inside of Perl. This is about as useful > as riding a bike on a bus. > Thanks, that worked very well for me. Beside the force of habit, awk was the only way

Re: Redirecting file handler to STDOUT

2007-06-22 Thread Paul Lalli
On Jun 22, 5:57 am, [EMAIL PROTECTED] (Ben Edwards) wrote: > I am opening a log file: > > open( LOGFILE, ">>cronlog.txt" ); > > This is being written to in lots of places. > > I have been asked to change the program so if -m (manual) flag is > passed the stuff that goes to the log file is send to

Re: Command line usage [solved]

2007-06-22 Thread Brad Baxter
On Jun 18, 5:54 pm, [EMAIL PROTECTED] (John Degen) wrote: > >- Original Message > >From: Paul Lalli <[EMAIL PROTECTED]> > >To: [EMAIL PROTECTED] > >Sent: Monday, June 18, 2007 6:47:05 PM > >Subject: Re: Command line usage > > >On Jun 18, 10:50 am, [EMAIL PROTECTED] (John Degen) wrote: > >

Re: Redirecting file handler to STDOUT

2007-06-22 Thread Xavier Noria
On Jun 22, 2007, at 11:57 AM, Ben Edwards wrote: I am opening a log file: open( LOGFILE, ">>cronlog.txt" ); This is being written to in lots of places. I have been asked to change the program so if -m (manual) flag is passed the stuff that goes to the log file is send to standard out instead

Re: Proper class setup?

2007-06-22 Thread Mathew Snyder
Dr.Ruud wrote: > Mathew Snyder schreef: > >> I'm presently learning OOP as Perl does it using online resources and >> and Programming Perl as my tutors. I'm not certain I have it right >> though. Is this correct for the package: > > [whitespace is cheap] Duly noted :D > >> package Report; >>

Redirecting file handler to STDOUT

2007-06-22 Thread Ben Edwards
I am opening a log file: open( LOGFILE, ">>cronlog.txt" ); This is being written to in lots of places. I have been asked to change the program so if -m (manual) flag is passed the stuff that goes to the log file is send to standard out instead. Is it possible to change the above command to re

Re: Proper class setup?

2007-06-22 Thread Dr.Ruud
Mathew Snyder schreef: > I'm presently learning OOP as Perl does it using online resources and > and Programming Perl as my tutors. I'm not certain I have it right > though. Is this correct for the package: [whitespace is cheap] > package Report; > > require Exporter; > use strict; > > our @IS

Re: still working with utf8

2007-06-22 Thread Dr.Ruud
Tom Allison schreef: > I have a string: > =?iso-2022-jp?B?Rlc6IBskQjxkJDckNSRHJE8kSiQvJEYzWiQ3JF8kPyQkGyhC?= > That is a MIME::Base64 encoded string of iso-2022-jp characters. > > After I decode_base64 them and decode($text,'iso-2022-jp',utf8') them > I can print out something that looks exactly l

Proper class setup?

2007-06-22 Thread Mathew Snyder
I'm presently learning OOP as Perl does it using online resources and and Programming Perl as my tutors. I'm not certain I have it right though. Is this correct for the package: package Report; require Exporter; use strict; our @ISA = qw(Exporter); our @EXPORT= qw(new); sub new {