Re: More on basic classes

2005-04-24 Thread Randal L. Schwartz
> "Lawrence" == Lawrence Statton <[EMAIL PROTECTED]> writes: Lawrence> my $class = ref($ref) || $ref; You say "good class design", but then you do this. Shame on you. See the last few paragraphs of of why this is a REALLY REALLY b

Re: expanding Ranges

2005-04-24 Thread N. Ganesh Babu
Thanks John, I did not think this is this much easy. Thanks alot. Regards, Ganesh John W. Krahn wrote: N. Ganesh Babu wrote: Dear All, Hello, input: T 6 TC output T 6 TC How can it be achieved in regular expression?. Or any other means is easy. I am trying to put the coding of for loop inside sub

Re: Regular expression help

2005-04-24 Thread John W. Krahn
Owen wrote: I found a message from Randal Schwartz, Message-ID: <[EMAIL PROTECTED]>#1/1 which gave a regular expression for a valid Unix name, /^(?=.*?\D)[a-z\d]+$/ That works but why does it work? / ^ # Start of a string (?= # 0 or 1 instance of .*? # anything but a newl

Re: Sort multi referenced array/hash

2005-04-24 Thread Lawrence Statton
> Hello, > > I have created a multi-referenced hash /array doing the following: > > my $total; > my $machine; > my $serverdata; > > start of loop > > $serverdata->{$machine}->{day} = $total; > $serverdata->{$machine}->{hour} = $total / 24; > > ...end of loop > > I have a loop that

Re: Sort multi referenced array/hash

2005-04-24 Thread Michael Gale
Hello, I did create a new hash containing the machines and the day value, sorted it and used that sorted hash in my loop to print everything out. Please let me know if there is a better way. Michael Michael Gale wrote: Hello, I have created a multi-referenced hash /array doing the foll

Sort multi referenced array/hash

2005-04-24 Thread Michael Gale
Hello, I have created a multi-referenced hash /array doing the following: my $total; my $machine; my $serverdata; start of loop $serverdata->{$machine}->{day} = $total; $serverdata->{$machine}->{hour} = $total / 24; ...end of loop I have a loop that gets the data for each machine and s

RE: Regular expression help

2005-04-24 Thread Charles K. Clarkson
Owen wrote: : I found a message from Randal Schwartz, Message-ID: : <[EMAIL PROTECTED]>#1/1 : which gave a regular expression for a valid Unix name, : : /^(?=.*?\D)[a-z\d]+$/ : : That works but why does it work? : : / : ^ # Start of a string :(?=

RE: need help please

2005-04-24 Thread Charles K. Clarkson
[EMAIL PROTECTED] wrote: : I have the web page for the form. But the web page does not : receive the data from the cgi file. : I check my work in DOS. When I type perl -c bonus.cgi : I get a message tell me syntax ok. : But when I check with : perl -w bonus.cgi I ge

More on basic classes

2005-04-24 Thread Lawrence Statton
Well, I've receive a couple more questions, (and one typo correction) about my little rant, so let me expound some more on Good Class Design. By the way, there are several great inheritable base classes in CPAN, and there is a good chance you should be using one of them in production code. By cu

Re: Use Perl to extract keywords

2005-04-24 Thread Ezra Taylor
Robert: An example is below. #!/usr/bin/perl -w open(FILE,"/etc/passwd") || die "Cannot open file: $!"; while ( ) { if( /Ezra/ ) #I'm searching for strings with the word Ezra. { print $_; # Now I'm printing lines with the name Ezra } } close(FILE); On 4/24/

Re: need help please

2005-04-24 Thread Keith Worthington
[EMAIL PROTECTED] wrote: Hi My program is to send data using an online form. I have the web page for the form. But the web page does not receive the data from the cgi file. I check my work in DOS. When I type perl -c bonus.cgi I get a message tell me syntax ok. But when I check with : per

need help please

2005-04-24 Thread HOTFUNINTHACITY
Hi My program is to send data using an online form. I have the web page for the form. But the web page does not receive the data from the cgi file. I check my work in DOS. When I type perl -c bonus.cgi I get a message tell me syntax ok. But when I check with : perl -w bonus.cgi I get th

Use Perl to extract keywords

2005-04-24 Thread Robert Kerry
I want to use Perl to extract keywords from plaintext, don't know whether there are some exsiting package / algorithm for doing that? Thank you. Regards, Robert. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Regular expression help

2005-04-24 Thread Owen
I found a message from Randal Schwartz, Message-ID: <[EMAIL PROTECTED]>#1/1 which gave a regular expression for a valid Unix name, /^(?=.*?\D)[a-z\d]+$/ That works but why does it work? / ^ # Start of a string (?=# 0 or 1 instance of

RE: basic class problem

2005-04-24 Thread Charles K. Clarkson
[EMAIL PROTECTED] wrote: : A better constructor might be (assuming you're going to represent : your object as a hash-reference, which is the most popular, but : not only way to do it. (read and reread perltoot until you : understand all of it). : : sub new { : my

Re: expanding Ranges

2005-04-24 Thread John W. Krahn
N. Ganesh Babu wrote: Dear All, Hello, input: T 6 TC output T 6 TC How can it be achieved in regular expression?. Or any other means is easy. I am trying to put the coding of for loop inside substitution string with (?{...}) but it is not working. $ perl -le' $_ = q/6/; print; s/(\d+)-(\d+)/join

Re: basic class problem

2005-04-24 Thread Lawrence Statton
> Hi all I'm trying to write a basic class that will contain some > configuration details, unfortunately it bombs out and doesn't do anything. > > ### start of class ### > #configuration.pm > package configuration; > use strict; > > > sub new{ > my $c

RE : basic class problem

2005-04-24 Thread Jose Nyimi
> -Message d'origine- > De : Graeme McLaren [mailto:[EMAIL PROTECTED] > Envoyé : dimanche 24 avril 2005 19:01 > À : beginners@perl.org > Objet : basic class problem > > > Hi all I'm trying to write a basic class that will contain some > configuration details, unfortunately it bombs ou

basic class problem

2005-04-24 Thread Graeme McLaren
Hi all I'm trying to write a basic class that will contain some configuration details, unfortunately it bombs out and doesn't do anything. ### start of class ### #configuration.pm package configuration; use strict; sub new{ my $class=shift; my $self=s

I canot install xml::libxml

2005-04-24 Thread marcos rebelo
When I try to do perl Makefile.PL I have this output ### enable native perl UTF8 running xml2-config...untested WARNING! The installed version of libxml2 was not tested with this version of XML::LibXML. XML::LibXML may fail building or so

RE: Lines Interchange

2005-04-24 Thread Charles K. Clarkson
N. Ganesh Babu wrote: [snip] : How the above input should be fomated as output. Please help me. What are the rules? Charles K. Clarkson -- Mobile Homes Specialist 254 968-8328 -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL

Configuration File generator

2005-04-24 Thread Tommy Nordgren
I wan't links to any useful tools for generating configure scripts in perl. That is, tools to automatically generate the configure script for open-source C/C++ projects. "Home is not where you are born, but where your heart finds peace" - Tommy Nordgren, "The dying old crone" -- To unsubscribe,

Re: expanding Ranges

2005-04-24 Thread Randy W. Sims
N. Ganesh Babu wrote: Dear All, input: T 6 TC output T 6 TC How can it be achieved in regular expression?. Or any other means is easy. use Set::IntSpan; my $set = Set::IntSpan->new('1-3,4,5,6-10'); my @elems = $set->elements; print join( ',', @elems ), "\n"; __END__ -- To unsubscribe, e-mail: [EMA

Lines Interchange

2005-04-24 Thread N. Ganesh Babu
Input: 11543 Floris Bks GBR BkSource GBR SteinerBooks Inc USA Lindisfarne USA BkSource GBR Floris Books New Books January-June 2005 Output: Floris Bks 11543cat Floris Bks Floris Books New Books January-June 2005 Floris Bks GBR BkSource GBR SteinerBooks Inc USA Lindisfarne USA BkSource GBR H

expanding Ranges

2005-04-24 Thread N. Ganesh Babu
Dear All, input: T 6 TC output T 6 TC How can it be achieved in regular expression?. Or any other means is easy. I am trying to put the coding of for loop inside substitution string with (?{...}) but it is not working. Please help. Regards, Ganesh -- To unsubscribe, e-mail: [EMAIL PROTECTED] For