Re: use utf-8 results in error

2012-11-22 Thread Jim Gibson
On Nov 22, 2012, at 9:43 PM, boB Stepp wrote: > Win7-64bit. DWIM Perl, Strawberry Perl 5.14. Padre 0.96. > > I am using the 6th edition of Learning Perl. It recommends adding use > utf-8 to all programs. So I gave it my first try: > > #!/usr/bin/env perl > use utf-8; > > print "Hello world"; >

Re: use utf-8 results in error

2012-11-22 Thread boB Stepp
On Thu, Nov 22, 2012 at 11:54 PM, ranveer raghuwanshi wrote: > Its not utf-8 its utf8 without hyphen(-) > Thank you, Ranveer! Perhaps I should not do my Perl studies as the wee morning hours (here) approach. The obvious once again escapes me... boB -- To unsubscribe, e-mail: beginners-unsubscr.

use utf-8 results in error

2012-11-22 Thread boB Stepp
Win7-64bit. DWIM Perl, Strawberry Perl 5.14. Padre 0.96. I am using the 6th edition of Learning Perl. It recommends adding use utf-8 to all programs. So I gave it my first try: #!/usr/bin/env perl use utf-8; print "Hello world"; This gives the result: E:\Programs\Perl\LearningPerl>perl hello

Re: Fwd: Is this code which is using Switch.pm safe?

2012-11-22 Thread Chankey Pathak
Sorry Paul, I did that because I needed a quick reply, I won't do this again. On Thu, Nov 22, 2012 at 1:09 PM, Paul Johnson wrote: > You asked exactly this question in both stackoverflow > ( > http://stackoverflow.com/questions/13506511/is-this-code-which-is-using-switch-pm-safe > ) > and per

Re: Fwd: Is this code which is using Switch.pm safe?

2012-11-22 Thread Paul Johnson
You asked exactly this question in both stackoverflow (http://stackoverflow.com/questions/13506511/is-this-code-which-is-using-switch-pm-safe) and perlmonks (http://perlmonks.org/?node_id=1005070). Please don't do that. Or, if you think there is a good reason to do so, link to where you have prev

Re: last regex question (for the evening)

2012-11-22 Thread shawn wilson
i think i got it working correctly. thanks for your help: my ($ip, $ident, $userid, $time, $cgi, $url, $proto, $status, $size_tx, $ref, $ua, $size_rx, $re_time) = /^ ([-0-9\.]+)\# ip address (\S+)\ # i

Re: last regex question (for the evening)

2012-11-22 Thread Shawn H Corey
Oops, I found an error my parser. Here's version 1.0.2: DATA_LOOP: while( my $line = ){ print $line; my @captured = ( '' ); my $inside = 0; CAPTURE_LOOP: while( 1 ){ if( $line =~ m{ \G ( [^"\\]+ | \\ ["\\] ) }gcx ){ $captured[-1] .= $1 if $inside; }elsif( $line =~ m{ \G \

Re: last regex question (for the evening)

2012-11-22 Thread Shawn H Corey
On Wed, 21 Nov 2012 20:54:29 -0500 shawn wilson wrote: > how do i capture all quoted strings? OK, I rewrote it as a simple parser: DATA_LOOP: while( my $line = ){ print $line; my @captured = ( '' ); my $inside = 0; CAPTURE_LOOP: while( 1 ){ if( $line =~ m{ \G ( [^"\\]+ | \\ ["\\

Fwd: Is this code which is using Switch.pm safe?

2012-11-22 Thread Chankey Pathak
I discussed with the teammates and convinced them to go for 'dispatch table'. Just want to know will the 'dispatch table' allow regex? As you can see we're using regex in if-else part. I guess I'll have to use Tie::RegexHash. Regarding the Perl version: I don't know when are they (my company) gonn

Re: Is this code which is using Switch.pm safe?

2012-11-22 Thread Paul Johnson
On Thu, Nov 22, 2012 at 11:37:15AM +0530, Chankey Pathak wrote: > In our company we were using this code (given at the end) for about 10 > years and it worked fine. > > Some days ago we faced some issues and we had to re-code the complete > package, we decided to replace this code with Switch modu