Re: ignore first 9 lines...

2006-04-12 Thread tom arnall
the following code: #!/usr/bin/perl -w use strict; use POSIX qw(locale_h); my ($f,@f,$g); setlocale(LC_COLLATE, "es_ES.ISO-8859-1"); @f = qw(oval óvalo zurrir); print "before sort:@f "; @f = sort @f; $f = setlocale(LC_

Re: why is setlocale not working?

2006-04-12 Thread John W. Krahn
tom arnall wrote: > the following code: > > #!/usr/bin/perl -w > use strict; > use POSIX qw(locale_h); > my ($f,@f,$g); > setlocale(LC_COLLATE, "es_ES.ISO-8859-1"); > @f = qw(oval óvalo zurrir); > print "before sort:@f > "; > @f = sort @f; >

Re: why is setlocale not working?

2006-04-12 Thread tom arnall
thanks. your change makes the sort work. but the result of 'setlocale(LC_COLLATE)' in my code is still 'en_US'. thanks, tom On Wednesday 12 April 2006 12:06 am, John W. Krahn wrote: > tom arnall wrote: > > the following code: > > > > #!/usr/bin/perl -w > > use strict; > > use POS

Re: why is setlocale not working?

2006-04-12 Thread John W. Krahn
tom arnall wrote: > thanks. your change makes the sort work. but the result of > 'setlocale(LC_COLLATE)' in my code is still 'en_US'. I don't now what to tell you, it works fine on my system. John -- use Perl; program fulfillment -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional com

Re: Perl regular exp

2006-04-12 Thread Randal L. Schwartz
> ""Sonika" == "Sonika Sachdeva" <[EMAIL PROTECTED]> writes: "Sonika> Hi , "Sonika> print $line if ($line =~ /pattern1 && pattern2 && pattern3/); "Sonika> works .. but For what meaning of "works"? If you want to find the string "pattern1 && pattern2 && pattern3", I guess. That's been prett

extract values from hash

2006-04-12 Thread Dermot Paikkos
Hi, I am trying to retrieve a list (of users) from an array of hashes. I have a structure like this: $VAR59 = { 'lc_surname' => 'anderson', 'first' => 'Angela', 'file' => 'angela_anderson.clk', 'name' => 'Angela Anderson', 'id' => 69,

Re: Perl regular exp

2006-04-12 Thread Randal L. Schwartz
> ""Ankur" == "Ankur Gupta" <[EMAIL PROTECTED]> writes: "Ankur> Sonika Sachdeva scribbled on Tuesday, "Ankur> April 11, 2006 4:27 PM: >> Actually I am looking for AND and OR combinations..and the number of >> words are not fixed. >> ie @words is the variable and I

Re: why is setlocale not working?

2006-04-12 Thread Mr. Shawn H. Corey
On Wed, 2006-12-04 at 02:24 -0700, John W. Krahn wrote: > tom arnall wrote: > > thanks. your change makes the sort work. but the result of > > 'setlocale(LC_COLLATE)' in my code is still 'en_US'. > > I don't now what to tell you, it works fine on my system. > > John > -- > use Perl; > program >

Re: extract values from hash

2006-04-12 Thread Mr. Shawn H. Corey
On Wed, 2006-12-04 at 13:55 +0100, Dermot Paikkos wrote: > What I want to to find all users, say with the lc_surname =~ anderson > and ideally I'd like all the details for that user. > use strict; > use warnings; > use diagnostics; > ... > ... > .. > > sub check_surname { > #

Re: extract values from hash

2006-04-12 Thread Dermot Paikkos
On 12 Apr 2006 at 9:28, Mr. Shawn H. Corey wrote: if (defined($ary_users->[$i]->{$lc_surname}) ) { > > if( defiend( $ary_users->[$i]{lc_surname} ) && > $ary_users->[$i]{lc_surname} eq 'anderson' ){ > Thanx, it works (typo defiend). So there isn't a way to grep all the surnames out of the a

Re: ignore first 9 lines...

2006-04-12 Thread Jay Savage
On 10 Apr 2006 17:55:24 -0700, Randal L. Schwartz wrote: > > ""Charles" == "Charles K Clarkson" <[EMAIL PROTECTED]> writes: > > "Charles> Dr.Ruud wrote: > "Charles> : Bryan R Harris schreef: > "Charles> : > "Charles> :: for (1..9) { <>; } > "Charles> : > "Charles> : while (<>) > "Charles>

Re: ignore first 9 lines...

2006-04-12 Thread Randal L. Schwartz
> ""Jay" == "Jay Savage" <[EMAIL PROTECTED]> writes: >> There. Happy? No more tests. And now you'll complain about the >> subroutine call. :) "Jay> Just to muddy the waters a little more (and hopefully answer a "Jay> question I've had for a while): how does the "flip-flop" operator "Jay> f

Re: Perl regular exp

2006-04-12 Thread Sonika Sachdeva
Thanks all. On 12 Apr 2006 06:23:53 -0700, Randal L. Schwartz wrote: > > > ""Ankur" == "Ankur Gupta" <[EMAIL PROTECTED]> writes: > > "Ankur> Sonika Sachdeva scribbled on > Tuesday, > "Ankur> April 11, 2006 4:27 PM: > > >> Actually I am looking for AND and OR combin

Re: Perl regular exp

2006-04-12 Thread Randal L. Schwartz
> "Sonika" == Sonika Sachdeva <[EMAIL PROTECTED]> writes: >> You could instead keep in mind that: >> >> /^(?=.*foo)(?=.*bar)/ Ooops. that should be (?=.*?foo) for efficiency. >> my $regex = "^" . join "", map "(?=.*\Q$_\E)", @words; change .* to .*? there. -- Randal L. Schwartz - Stoneh

Re: extract values from hash

2006-04-12 Thread Mr. Shawn H. Corey
On Wed, 2006-12-04 at 14:58 +0100, Dermot Paikkos wrote: > On 12 Apr 2006 at 9:28, Mr. Shawn H. Corey wrote: > >if (defined($ary_users->[$i]->{$lc_surname}) ) { > > > > if( defiend( $ary_users->[$i]{lc_surname} ) && > > $ary_users->[$i]{lc_surname} eq 'anderson' ){ > > > Thanx, it works (t

Re: ignore first 9 lines...

2006-04-12 Thread Bryan R Harris
> "Jay> while (<>) { > "Jay> next if 1..9; > "Jay> # the rest of the code > "Jay> } Huh? I think I missed something here... Does the "next if 1..9" do something interesting? To me it seems like it'd evaluate "1..9" as "true" and do a next every time... - B -- To

Re: ignore first 9 lines...

2006-04-12 Thread Tom Phoenix
On 4/12/06, Bryan R Harris <[EMAIL PROTECTED]> wrote: > Does the "next if 1..9" do something interesting? In scalar context, the ".." ("dotdot") operator does indeed do something quite interesting. And the fact that its operands are constants matters, too. See perlop for the full and somewhat com

Class, inheritance, virtual function in Perl???!!

2006-04-12 Thread Monomachus
I wanted to ask if Perl have smth like class, inheritance, virtual function,etc in C++. -- Thanks, Monomachus Don't worry, Be Happy -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Class, inheritance, virtual function in Perl???!!

2006-04-12 Thread Monomachus
I wanted to ask if Perl have smth like class, inheritance, virtual function,etc in C++. -- Thanks, Monomachus Don't worry, Be Happy -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Class, inheritance, virtual function in Perl???!!

2006-04-12 Thread Mr. Shawn H. Corey
On Wed, 2006-12-04 at 22:08 +0400, Monomachus wrote: > I wanted to ask if Perl have smth like class, inheritance, virtual > function,etc in C++. See: perldoc perlboot perldoc perltoot perldoc perltooc perldoc perlbot -- __END__ Just my 0.0002 million dollars worth, --- Shawn "For

Re: Scraping Data Behind a Form

2006-04-12 Thread kc68
On Tue, 11 Apr 2006 18:12:16 -0400, <[EMAIL PROTECTED]> wrote: I am slowly making my way through the process of scraping the data behind a form and can now get five results plus a series of links using the script below. I need help in doing the following: 1) Eliminating all material on the

Re: ignore first 9 lines...

2006-04-12 Thread Alan_C
Hi, > Just to muddy the waters a little more (and hopefully answer a > question I've had for a while): how does the "flip-flop" operator > function here: > > while (<>) { > next if 1..9; > # the rest of the code > } Since I (used to) try to turn stuff into Rocket Science, I

Re: question on Terminal I/O

2006-04-12 Thread Jay Savage
On 4/11/06, Mr. Shawn H. Corey <[EMAIL PROTECTED]> wrote: > On Tue, 2006-11-04 at 11:01 -0700, Gavin Bowlby wrote: > > Short of learning Perl-curses or writing a full-blown TK-Perl app, are > > there any simple techniques - (read: minimum learning time) that I can > > use to implement a "protect co

Re: Scraping Data Behind a Form

2006-04-12 Thread Alan_C
On Wednesday 12 April 2006 12:20, [EMAIL PROTECTED] wrote: [ . . ] lynx -source http://www.theblackchurchpage.com/modules.php?name=Locator > tsthtmsource.htm That gets it the page's markup/source on my Slackware. There's javascript in that page but I don't know much about this. It appears you