Re: \w regular expressions unicode

2009-04-22 Thread Chas. Owens
On Wed, Apr 22, 2009 at 18:12, Chas. Owens wrote: > On Wed, Apr 22, 2009 at 17:54, Gunnar Hjalmarsson wrote: >> Chas. Owens wrote: >>> >>> On Wed, Apr 22, 2009 at 15:25, Gunnar Hjalmarsson >>> wrote: >>> snip > > Yeah, it looks so. With "use utf8" (http://perldoc.perl.org/utf8.html)

Re: \w regular expressions unicode

2009-04-22 Thread Chas. Owens
On Wed, Apr 22, 2009 at 17:54, Gunnar Hjalmarsson wrote: > Chas. Owens wrote: >> >> On Wed, Apr 22, 2009 at 15:25, Gunnar Hjalmarsson >> wrote: >> snip Yeah, it looks so. With "use utf8" (http://perldoc.perl.org/utf8.html) one can however make them parsed (decoded) (provided t

Re: \w regular expressions unicode

2009-04-22 Thread Gunnar Hjalmarsson
Chas. Owens wrote: On Wed, Apr 22, 2009 at 15:25, Gunnar Hjalmarsson wrote: snip Yeah, it looks so. With "use utf8" (http://perldoc.perl.org/utf8.html) one can however make them parsed (decoded) (provided they are valid UTF-8). No. The utf8 pragma is about allowing UTF-8 encoded *symbols*, e.g

Re: \w regular expressions unicode

2009-04-22 Thread Gunnar Hjalmarsson
Stanisław T. Findeisen wrote: I mean this: #!/usr/bin/perl use warnings; use strict; # use utf8; use Encode; my $utf8_encoded = "smörgåsbord"; print('is_utf8: ' . (Encode::is_utf8($utf8_encoded) ? 'TRUE' : 'FALSE') . "\n"); This outputs "FALSE" here, but uncomment "use utf8" and it gets "TR

Re: \w regular expressions unicode

2009-04-22 Thread Chas. Owens
On Wed, Apr 22, 2009 at 15:25, Gunnar Hjalmarsson wrote: snip >> Yeah, it looks so. With "use utf8" (http://perldoc.perl.org/utf8.html) one >> can however make them parsed (decoded) (provided they are valid UTF-8). > > No. The utf8 pragma is about allowing UTF-8 encoded *symbols*, e.g. variable >

Re: \w regular expressions unicode

2009-04-22 Thread Stanisław T. Findeisen
Gunnar Hjalmarsson wrote: Or did you possibly mean the utf8::decode() function? I mean this: #!/usr/bin/perl use warnings; use strict; # use utf8; use Encode; my $utf8_encoded = "smörgåsbord"; print('is_utf8: ' . (Encode::is_utf8($utf8_encoded) ? 'TRUE' : 'FALSE') . "\n"); This outputs "F

Re: \w regular expressions unicode

2009-04-22 Thread Gunnar Hjalmarsson
Gunnar Hjalmarsson wrote: Stanisław T. Findeisen wrote: With "use utf8" (http://perldoc.perl.org/utf8.html) one can however make them parsed (decoded) (provided they are valid UTF-8). No. The utf8 pragma is about allowing UTF-8 encoded *symbols*, e.g. variable names or subroutine names. Or

Re: \w regular expressions unicode

2009-04-22 Thread Gunnar Hjalmarsson
Stanisław T. Findeisen wrote: Gunnar Hjalmarsson wrote: What assumptions does Perl make regarding input file (i.e., the program/script file) encoding? AFAIK, it just converts the bytes into Perl's internal format, but it does not assume anything (at least not by default) with respect to the

Re: sleep exactly after n seconds (sleep finishing longer than specified)

2009-04-22 Thread John W. Krahn
Michael Alipio wrote: Hi, Hello, I have a script that forks a child. at the parent, i have a line that tells it to sleep for n seconds. Once the 3 seconds have passed, it will kill the child process. I noticed that most of the time, sleep doesn't count exact seconds.. most of the time it's l

Having problems using HTML::HashTable and HTML::TableContentParser together.

2009-04-22 Thread Richard Cross
Hi, I'm trying to read an HTML table from JBoss's Destination Manager, strip out only the table rows I'm interested in and then write it back out as an HTML table. What I've done so far (see Fig 1 below) is to grab every table off the page (although there is in fact only one) into $table

Re: \w regular expressions unicode

2009-04-22 Thread Stanisław T. Findeisen
Gunnar Hjalmarsson wrote: What assumptions does Perl make regarding input file (i.e., the program/script file) encoding? AFAIK, it just converts the bytes into Perl's internal format, but it does not assume anything (at least not by default) with respect to the character encoding. Is it so

Re: libwww-perl library

2009-04-22 Thread Gunnar Hjalmarsson
hOURS wrote: The get function in the libwww-perl library would be really useful to me, but I'm having problems making it work. When I use it in a cgi script (it's ultimate destination) it fails. My browser displays a generic error message which isn't very helpful. Unless you don't have access

Re: \w regular expressions unicode

2009-04-22 Thread Gunnar Hjalmarsson
Stanisław T. Findeisen wrote: Gunnar Hjalmarsson wrote: Stanisław T. Findeisen wrote: Hi how to write regular expressions matching against Unicode (eg., UTF-8) strings? For instance, in my regexp: qr/^([.<>@ \w])*$/ Decode the UTF-8 encoded strings before applying the regex on them. $ per

RE: Controlling screen output. Print something then afterwards replace it

2009-04-22 Thread Bob McConnell
From: Michael Alipio > > Is it possible to print something and then replace what you > have printed with a different value? > > Say I have a program that watches a logfile and prints the > current number of lines. > > after sleeping for n seconds, it will print the number of > lines again. But i

Controlling screen output. Print something then afterwards replace it

2009-04-22 Thread Michael Alipio
Hi, Is it possible to print something and then replace what you have printed with a different value? Say I have a program that watches a logfile and prints the current number of lines. after sleeping for n seconds, it will print the number of lines again. But i don't want to print it below t

Re: Aliasing functions

2009-04-22 Thread Jenda Krynicky
From: "Chas. Owens" > On Tue, Apr 21, 2009 at 21:15, John W. Krahn wrote: > > Kelly Jones wrote: > >> > >> I want foo() and bar() to do the same thing. One way to do this: > >> > >> sub foo {return bar(@_);} > >> > >> Is there a more clever way using \&bar and things like that? > > > > $ perl -le

Re: sleep exactly after n seconds (sleep finishing longer than specified)

2009-04-22 Thread Chas. Owens
On Wed, Apr 22, 2009 at 09:27, Michael Alipio wrote: > > Hi, > > I have a script that forks a child. at the parent, i have a line that tells > it to sleep for n seconds. Once the 3 seconds have passed, it will kill the > child process. > > I noticed that most of the time, sleep doesn't count exa

sleep exactly after n seconds (sleep finishing longer than specified)

2009-04-22 Thread Michael Alipio
Hi, I have a script that forks a child. at the parent, i have a line that tells it to sleep for n seconds. Once the 3 seconds have passed, it will kill the child process. I noticed that most of the time, sleep doesn't count exact seconds.. most of the time it's longer. Is there any way to sle

Re: \w regular expressions unicode

2009-04-22 Thread Stanisław T. Findeisen
Gunnar Hjalmarsson wrote: Stanisław T. Findeisen wrote: Hi how to write regular expressions matching against Unicode (eg., UTF-8) strings? For instance, in my regexp: qr/^([.<>@ \w])*$/ Decode the UTF-8 encoded strings before applying the regex on them. $ perl -MEncode -le ' $utf8_encoded

RE: String manipulation question

2009-04-22 Thread Wagner, David --- Senior Programmer Analyst --- CFS
> -Original Message- > From: Grant [mailto:emailgr...@gmail.com] > Sent: Tuesday, April 21, 2009 12:55 > To: Perl Beginners List > Subject: Re: String manipulation question > > >> >> >> Thanks guys.  With some help I've come up with this: > >> >> >> > >> >> >> $string = 'abc def ghi jkl

RE: String manipulation question

2009-04-22 Thread Wagner, David --- Senior Programmer Analyst --- CFS
> -Original Message- > From: Grant [mailto:emailgr...@gmail.com] > Sent: Tuesday, April 21, 2009 12:43 > To: Perl Beginners List > Subject: Re: String manipulation question > > >> >> Thanks guys.  With some help I've come up with this: > >> >> > >> >> $string = 'abc def ghi jkl mno pqr st

RE: String manipulation question

2009-04-22 Thread Wagner, David --- Senior Programmer Analyst --- CFS
> -Original Message- > From: Grant [mailto:emailgr...@gmail.com] > Sent: Tuesday, April 21, 2009 12:16 > To: Perl Beginners List > Subject: Re: String manipulation question > > >> Thanks guys.  With some help I've come up with this: > >> > >> $string = 'abc def ghi jkl mno pqr stu vwx yz'

RE: String manipulation question

2009-04-22 Thread Wagner, David --- Senior Programmer Analyst --- CFS
> -Original Message- > From: Grant [mailto:emailgr...@gmail.com] > Sent: Tuesday, April 21, 2009 11:47 > To: Perl Beginners List > Subject: Re: String manipulation question > > >> I'd like to take a string and manipulate it in a few ways. > >> > >> If the string is 34 characters or less,

RE: String manipulation question

2009-04-22 Thread Wagner, David --- Senior Programmer Analyst --- CFS
> -Original Message- > From: Grant [mailto:emailgr...@gmail.com] > Sent: Tuesday, April 21, 2009 09:58 > To: Perl Beginners List > Subject: String manipulation question > > I'd like to take a string and manipulate it in a few ways. > > If the string is 34 characters or less, I'd like to

Re: libwww-perl library ==> Off Topic

2009-04-22 Thread Greg Eldridge
Hello, Quoting hOURS : ...  They are something of a lame outfit, but not ridiculously so.  They have sendmail and let me telnet and stuff.  Thanks much! Fred Kittelmann hOURS 215-551-1490 www.hoursystem.net What is this "telnet" you speak of ? Do they not allow ssh/scp