Re: A better way

2003-04-03 Thread R. Joseph Newton
Rob Dixon wrote: > > Unless the $target variable was meant simply to decide on a return, it makes more > > sense to assign its value--one task, one line, and check it for validity--another > > task > > entirely, on a line of its own. > > So presumably you're against > > while ( my $line = )

Re: HASH PRINTING

2003-04-03 Thread R. Joseph Newton
Eric Walker wrote: > I have a HASH with a mixture of single, double and triple layers. > exampl hash of hash of array's etc > I try to dump and see values of the entire db but I get pointers and > memory addresses. Below is my code Please help. > > foreach my $item (keys %hData){ > print ("$

Re: SIGINT and SIGQUIT with system()

2003-04-03 Thread R. Joseph Newton
[EMAIL PROTECTED] wrote: > if (!$pid) { &player(); } > while (!-e "stop") { sleep(10); } > kill('QUIT', $pid); ... > Am I missing something here? Any idea how I could do this differently? > Yes. Braces. They may not be required here--are you using strict?--but they would certainl

Re: Syntatic sugar maybe - no 'continue' command

2003-04-03 Thread R. Joseph Newton
Tony Esposito wrote: > .. It is a matter of style, of course, but I think it would be nice to > have a 'continue' statement in Perl for readability. Hi Tony, I don't know that that would imply readability. If I saw continue in a conditional, I would look at the surrounding loop for implicatio

Re: Check for duplicate entires

2003-04-03 Thread Mike Blezien
Well after some serious head scratching and a few trial&error runs, I was finally able to get the results we needed. Appreciate the list's help ;) >> R. Joseph Newton wrote: Mike Blezien wrote: Hello all, working on creating a category/sub category data file, somthing like this: Animations

Re: Check for duplicate entires

2003-04-03 Thread R. Joseph Newton
Mike Blezien wrote: > Hello all, > > working on creating a category/sub category data file, somthing like this: > > Animations::Mini::3D-Miscellaneous > Clip_Art::People-Stick_People::Business::Household-Furniture > Icons::BMP-Computers::32x32icons-Computers > > the first field in each line is the

Re: How to measure Array or Hash's byte size ?

2003-04-03 Thread R. Joseph Newton
Li Ngok Lam wrote: > My method sounds stupid, but still works : > > my @array = ('123', 'abc', 'def', 1..9); > my $len_of_array = 0 ; > foreach my $elem(@array) > {$len_of_array += length($elem) } > print $len_of_array ; # I got '18' > > my %hash = (1=>2, 2=>3, 3=>4); > foreach my $key(keys

Re: A better way

2003-04-03 Thread Rob Dixon
R. Joseph Newton wrote: > Paul Johnson wrote: > > To my mind, > > return if $target eq "MAIN"; > > at the top of a sub is a lot more helpful than making me search all the > > way down to the botttom to see if there is anything after the conditional. > > > > And it's probably a lot less likely tha

Re: A better way

2003-04-03 Thread R. Joseph Newton
Paul Johnson wrote: > R. Joseph Newton said: > > >The only thing it > > lacked was a meaningful return value. Since the getTarget function > > provided enough information to decide in favor of an early exit, this > > information should proba

Re: Problem with XML::Parser

2003-04-03 Thread R. Joseph Newton
Keith Boynton wrote: > > This exact code works fine on another machine. Any ideas? > Did it touch a word-wrapping editor--the kind that is appropriate and SHOULD be used for discursive material only? I wonder because when I pated this into my interpreter, the only error I received was on the l

Re: How to measure Array or Hash's byte size ?

2003-04-03 Thread Li Ngok Lam
> I don't know if it is "better" or faster, but it is shorter. :-) > > $ perl -le' > my @array = ( "123", "abc", "def", 1 .. 9 ); > my $len_of_array = do { local $"; length "@array" }; > print $len_of_array; > ' > 18 > > $ perl -le' > my %hash = ( 1 => 2, 2 => 3, 3 => 4 ); > my $len_of_hash = do

Re: php mySQL question

2003-04-03 Thread George Schlossnagle
Why are you posting this to a perl list? Try [EMAIL PROTECTED] On Thursday, April 3, 2003, at 06:06 PM, Robbie Staufer wrote: Hi, I have a php form that takes in data for a mysql query. The script that processes the form takes the variables from the form and submits them to the db. What if

Re: Syntatic sugar maybe - no 'continue' command

2003-04-03 Thread Paul Johnson
On Thu, Apr 03, 2003 at 01:28:55PM -0500, Tony Esposito wrote: > When you have an if-elsif-else situation like below, where there is no > action taken on the final 'else', is there a way to just say 'continue' - > like one would do in C - or is it considered 'ok' to just leave off the > final 'els

php mySQL question

2003-04-03 Thread Robbie Staufer
Hi, I have a php form that takes in data for a mysql query. The script that processes the form takes the variables from the form and submits them to the db. What if the field after LIKE needs to be imprecise? The variable somehow needs to be converted to a regular expression like /'%expr%'/

Re: matching patterns - - - EXPLANATION

2003-04-03 Thread R. Joseph Newton
Diego Riano wrote: > I am trying to put it in a better way, (I hope :-)) > > What I am trying to do is check if two patterns could recognize the same > string, for example: > $pattern1=[ag]oprs[cd]x9; > $pattern2=[agpr]oprs; > > these two patterns would recognize, both, a set of strings. howe

Re: HASH PRINTING

2003-04-03 Thread Eric Walker
Jenda Krynicky wrote: > From: Eric Walker <[EMAIL PROTECTED]> > > David Olbersen wrote: > > > > From: Eric Walker [mailto:[EMAIL PROTECTED] > > > > > > > > I have a HASH with a mixture of single, double and triple layers. > > > > exampl hash of hash of array's etc I try to dump and see > > > >

RE: Syntatic sugar maybe - no 'continue' command

2003-04-03 Thread Tony Esposito
Well, it is "pointless" by definition - there's a condition that exists where you do nothing. Take the example of checking the properties of a file that I sent along. If the file checks out 'ok' - i.e., passes all the if's and elsif's - then you are at the end of your if-eslif-else construct and y

Installing Curses.pm on Red Hat 8.0

2003-04-03 Thread Bruno Negrao - Perl List
Hi, I tried to install the Curses.pm module on my redhat linux 8.0 but I didn't compile. Does someone did it successfully? Any trick? Thank you, - -- Bruno Negrão -- Suporte -- Plugway Acesso Internet Ltda. -- (31)34812311 -- bnegrao at plugway d

Re: HASH PRINTING

2003-04-03 Thread Jenda Krynicky
From: Eric Walker <[EMAIL PROTECTED]> > David Olbersen wrote: > > > From: Eric Walker [mailto:[EMAIL PROTECTED] > > > > > > I have a HASH with a mixture of single, double and triple layers. > > > exampl hash of hash of array's etc I try to dump and see > > > values of the entire db but I get po

Re: HASH PRINTING

2003-04-03 Thread Pete Emerson
Data::Dumper works for me. You don't need to provide a list of the hash keys. #!/usr/bin/perl -w use strict; use Data::Dumper; my %hash; $hash{one}=1; $hash{two}{one}=2.1; $hash{three}{one}{one}=3.11; print Dumper(%hash); ### $VAR1 = 'one'; $VAR2 = 1; $VAR3 = 'three'; $V

Re: looking for help with Net::IRC

2003-04-03 Thread dan
Net::IRC isn't the best way in the world of creating an IRC bot. I just use IO::Socket, and establish & maintain the connection to IRC myself within my own source. Personally that's the better option. I've never played with IRC, but a friend of mine has, and said it wasn't the easiest of modules to

Re: HASH PRINTING

2003-04-03 Thread Eric Walker
David Olbersen wrote: > Eric, > > Use Data::Dumper, it'll do this very well if it's just for debugging purposes. > > Check out the documentation on cpan.org: > > http://search.cpan.org/author/JHI/perl-5.8.0/ext/Data/Dumper/Dumper.pm > > or `man Data::Dumper` if you're on a UNIX machine. > > --

RE: SIGINT and SIGQUIT with system()

2003-04-03 Thread Bob Showalter
[EMAIL PROTECTED] wrote: > Hi there > > I'm stuck with system(). According to some posts, system() is passing > SIGINT and SIGQUIT to it's child, yet this doesn't seem to work. No, I don't think that's correct. A terminal driver will catch ^C and ^\ and send the appropriate signals to all the pr

RE: HASH PRINTING

2003-04-03 Thread David Olbersen
Eric, Use Data::Dumper, it'll do this very well if it's just for debugging purposes. Check out the documentation on cpan.org: http://search.cpan.org/author/JHI/perl-5.8.0/ext/Data/Dumper/Dumper.pm or `man Data::Dumper` if you're on a UNIX machine. -- David Olbersen iGu

HASH PRINTING

2003-04-03 Thread Eric Walker
I have a HASH with a mixture of single, double and triple layers. exampl hash of hash of array's etc I try to dump and see values of the entire db but I get pointers and memory addresses. Below is my code Please help. foreach my $item (keys %hData){ print ("$item: $hData{$item}\n"); } Thank

RE: Check for duplicate entires

2003-04-03 Thread Chris Rogers
There are many ways to do this but one comes to mind that may shorten the code as well as speed things up just a little (REGEX's are usually very efficient). Try this out: sub update_categories { my($maincat,$subcat) = @_; my $process = 0; my @scats= (); $subcat =~ s!(.*?

looking for help with Net::IRC

2003-04-03 Thread Oliver Schaedlich
Greetings, I'm trying to put up a simple IRC bot using the Net::IRC module. Connecting and joining the test channel works quite fine, but I do not quite understand how to make the bot - for example - realize and react when its mode is changed. Is there a good tutorial or in depth documentation cov

Re: how to access certain values in hashes

2003-04-03 Thread John W. Krahn
Joseph Paish wrote: > > On Thursday 03 April 2003 08:53, Joseph Paish wrote: > > > > i have a hash that looks like this : > > > > abc => 123 456 789 246 346 8765 > > deh => 123 456 258 246 346 8765 > > nyx => 123 456 149 246 346 8765 > > pob => 123 456 354 246 346 8765 > > syt => 123 456 924 246 3

SIGINT and SIGQUIT with system()

2003-04-03 Thread shrotty
Hi there I'm stuck with system(). According to some posts, system() is passing SIGINT and SIGQUIT to it's child, yet this doesn't seem to work. I've boiled the code down to the following lines. (Please note that 'alsaplayer' is a console soundfile player that honors SIGINT and SIGQUIT by immediate

RE: Syntatic sugar maybe - no 'continue' command

2003-04-03 Thread Jeff Westman
It's a matter of style, I suppose, but seems kind of pointless to me. To each their own... But to answer your question, you can use a ';' on a line by itself, such as #!/usr/bin/perl -w $a = localtime(); if ($a =~ /Mar/) { print "March\n"; } elsif ($a =~ /Feb/) { print "February\n"; } el

Re: printing

2003-04-03 Thread John W. Krahn
Eric Walker wrote: > > I can't remember how to setup a print statement to say print 60 "#"; > I think its something like > > print ("\*",40); Use the x operator to multipy strings: print '*' x 40; John -- use Perl; program fulfillment -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additi

Re: Syntatic sugar maybe - no 'continue' command

2003-04-03 Thread Phil Schaechter
I always put an error message in my unneeded elses, even if it is "impossible" They've helped me to catch bugs quite a few times. -Phil On Thursday 03 April 2003 10:28 am, Tony Esposito wrote: > When you have an if-elsif-else situation like below, where there is no > action taken on the final 'e

RE: Syntatic sugar maybe - no 'continue' command

2003-04-03 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Tony Esposito wrote: > When you have an if-elsif-else situation like below, where there is no > action taken on the final 'else', is there a way to just say > 'continue' - like one would do in C - or is it considered 'ok' to > just leave off the final 'else'? > My experience has taught me to includ

Re: Check for duplicate entires

2003-04-03 Thread david
Mike Blezien wrote: > David, > > Not quiet... but appreciate the feedback... it did give an idea to another > more easier approach to the process and it seems to be working,... so far. > > thanks, > great. just curious, which portion is the "Not quiet" referring to? :-) david -- To unsubsc

Re: Check for duplicate entires

2003-04-03 Thread Mike Blezien
David, Not quiet... but appreciate the feedback... it did give an idea to another more easier approach to the process and it seems to be working,... so far. thanks, >> david wrote: David wrote: does the following do what you want: sub update_categories{ my $data_files = shift;

Syntatic sugar maybe - no 'continue' command

2003-04-03 Thread Tony Esposito
When you have an if-elsif-else situation like below, where there is no action taken on the final 'else', is there a way to just say 'continue' - like one would do in C - or is it considered 'ok' to just leave off the final 'else'? My experience has taught me to include the final 'else' but just add

Re: How to measure Array or Hash's byte size ?

2003-04-03 Thread John W. Krahn
Li Ngok Lam wrote: > > My method sounds stupid, but still works : > > my @array = ('123', 'abc', 'def', 1..9); > my $len_of_array = 0 ; > foreach my $elem(@array) > {$len_of_array += length($elem) } > print $len_of_array ; # I got '18' > > my %hash = (1=>2, 2=>3, 3=>4); > foreach my $key(

Re: Check for duplicate entires

2003-04-03 Thread david
David wrote: > > does the following do what you want: > > sub update_categories{ > my $data_files = shift; > my $main_cat = shift; > my $sub_cat= shift; > open(CAT,$data_files) || die $!; > while(){ > close(CAT) and return if(/$main_c

Re: Check for duplicate entires

2003-04-03 Thread david
Mike Blezien wrote: > Hello all, > > working on creating a category/sub category data file, somthing like this: > > Animations::Mini::3D-Miscellaneous > Clip_Art::People-Stick_People::Business::Household-Furniture > Icons::BMP-Computers::32x32icons-Computers > > the first field in each line is

Re: How to measure Array or Hash's byte size ?

2003-04-03 Thread Paul Johnson
Rob Dixon said: > Li Ngok Lam wrote: >> My method sounds stupid, but still works : >> >> my @array = ('123', 'abc', 'def', 1..9); >> my $len_of_array = 0 ; >> foreach my $elem(@array) >> {$len_of_array += length($elem) } >> print $len_of_array ; # I got '18' >> >> my %hash = (1=>2, 2=>3, 3

Re: how to access certain values in hashes

2003-04-03 Thread Stefan Lidman
> foreach my $key (sort keys %last) { > # %last is the name of the hash ... now it is sorted by key > my @temp_array = split / /, $last{$key} ; > print $temp_array[2] ; # prints out the 3rd field > } > > now, how to do math on it? in other words, i guess i am asking how to

Re: A better way

2003-04-03 Thread Paul Johnson
R. Joseph Newton said: >The only thing it > lacked was a meaningful return value. Since the getTarget function > provided enough information to decide in favor of an early exit, this > information should probably be passed on more explicitly

Re: how to access certain values in hashes

2003-04-03 Thread Joseph Paish
On Thursday 03 April 2003 08:53, Joseph Paish wrote: > i have a hash that looks like this : > > abc => 123 456 789 246 346 8765 > deh => 123 456 258 246 346 8765 > nyx => 123 456 149 246 346 8765 > pob => 123 456 354 246 346 8765 > syt => 123 456 924 246 346 8765 > > already sorted by the key (the

RE: Help with this!

2003-04-03 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Adriano Allora wrote: Dispursed amongst the code are my comments. > Hi to all, > I need to delete in a list of files, and in each file of newsgroups, > all the posts which contents quoted lines. ONLY IF these lines are > effectively repeating the non quoted text. > I'm actually working on

Re: A better way

2003-04-03 Thread R. Joseph Newton
Paul Johnson wrote: > To my mind, > return if $target eq "MAIN"; > at the top of a sub is a lot more helpful than making me search all the > way down to the botttom to see if there is anything after the conditional. > > And it's probably a lot less likely that the next person to edit that sub >

RE: printing

2003-04-03 Thread Paul Kraus
print "#"x60; -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Thursday, April 03, 2003 11:43 AM To: [EMAIL PROTECTED] Subject: printing I can't remember how to setup a print statement to say print 60 "#"; I think its something like print ("\*",40); please h

Re: A better way

2003-04-03 Thread R. Joseph Newton
Rob Richardson wrote: > Stefan, > > Personally, I'd prefer: > > if (target ne "MAIN") > { >#do lots of other stuff > } > > I think general programming practice discourages multiple return points > in subroutines. > > RobR I disagree. While one should certainly exercise care when making an ea

printing

2003-04-03 Thread Eric Walker
I can't remember how to setup a print statement to say print 60 "#"; I think its something like print ("\*",40); please help Eric -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Check for duplicate entires

2003-04-03 Thread Mike Blezien
Hello all, working on creating a category/sub category data file, somthing like this: Animations::Mini::3D-Miscellaneous Clip_Art::People-Stick_People::Business::Household-Furniture Icons::BMP-Computers::32x32icons-Computers the first field in each line is the main category, followed by their res

Re: Net::FTP in Passive mode hangs and fails (really frustrating)

2003-04-03 Thread R. Joseph Newton
[EMAIL PROTECTED] wrote: > Hi All, > > I'm unsure what to do next. I hope someone has beaten this before and > hears my cry for help. > > I've implemented a script to transfer files to a client, and to pick files > up. There is a firewall, though I don't know much about it. I instantiate > the

Re: matching patterns - - - EXPLANATION

2003-04-03 Thread Diego Riano
I am trying to put it in a better way, (I hope :-)) What I am trying to do is check if two patterns could recognize the same string, for example: $pattern1=[ag]oprs[cd]x9; $pattern2=[agpr]oprs; these two patterns would recognize, both, a set of strings. however there will be some strings tha

Re: A better way

2003-04-03 Thread Rob Dixon
Paul Johnson wrote: > Rob Dixon said: > > "Rob Richardson" <[EMAIL PROTECTED]> wrote in message > > news:[EMAIL PROTECTED] > > > Stefan, > > > > > > Personally, I'd prefer: > > > > > > if (target ne "MAIN") > > > { > > >#do lots of other stuff > > > } > > > > > > I think general programming pra

RE: Which Perl is used to run the script???

2003-04-03 Thread Tony Esposito
Thank you...I'll make a note of that. > Anthony (Tony) Esposito > Senior Technical Consultant > Inovis(tm), formerly Harbinger and Extricity > 2425 N. Central Expressway, Suite 900 > Richardson, TX 75080 > (972) 643-3115 > [EMAIL PROTECTED] > -Original Message- From: Wiggins d'Anc

Re: Php perl?

2003-04-03 Thread George Schlossnagle
On Thursday, April 3, 2003, at 11:04 AM, Bob Showalter wrote: But can you write a "stand-alone" script using PHP and run it from a shell prompt, for example? Yes. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: How to measure Array or Hash's byte size ?

2003-04-03 Thread Rob Dixon
Li Ngok Lam wrote: > My method sounds stupid, but still works : > > my @array = ('123', 'abc', 'def', 1..9); > my $len_of_array = 0 ; > foreach my $elem(@array) > {$len_of_array += length($elem) } > print $len_of_array ; # I got '18' > > my %hash = (1=>2, 2=>3, 3=>4); > foreach my $key(keys(

RE: Php perl?

2003-04-03 Thread Bob Showalter
R. Joseph Newton wrote: > Bob Showalter wrote: > > > [EMAIL PROTECTED] wrote: > > > I have a PHP vs. Perl question for a hobby project of mine. Which > > > would be the better language to use if I wanted to go out to a > > > particular web page and parse the table that's there? How about if > > >

Re: A better way

2003-04-03 Thread Paul Johnson
Rob Dixon said: > > "Rob Richardson" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] >> Stefan, >> >> Personally, I'd prefer: >> >> if (target ne "MAIN") >> { >>#do lots of other stuff >> } >> >> I think general programming practice discourages multiple return points >> in subro

how to access certain values in hashes

2003-04-03 Thread Joseph Paish
i have a hash that looks like this : abc => 123 456 789 246 346 8765 deh => 123 456 258 246 346 8765 nyx => 123 456 149 246 346 8765 pob => 123 456 354 246 346 8765 syt => 123 456 924 246 346 8765 already sorted by the key (the first field above). i want to do some simple math based on the value

RE: Lanman???

2003-04-03 Thread Jenda Krynicky
From: Timothy Johnson <[EMAIL PROTECTED]> > Jenda- > Which version do you have in your repository? The last time I > looked > it was one revision behind the CPAN version. Of course, I haven't > checked in a while... I have 1.0.9.2 and there seems to be 1.0.10 on CPAN. I'll see what I c

Re: How conver decimal num. to bin. mum.

2003-04-03 Thread Rob Dixon
Radovan Petrikí wrote: > Hi , > > how I conver decimal number to binary number in perl? my $decnum = 789; my $binnum = sprintf "%b", $decnum; print $binnum, "\n"; output 1100010101 Cheers, Rob -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [

Re: A better way

2003-04-03 Thread Rob Dixon
Brian Ling wrote: > Thanks for that, I had not released you could effectively use the > getTarget() return value twice :-) > > > well this works: > > return if 'MAIN' eq (my $target = getTarget()); > > > /Stefan Personally, I prefer: ( my $target = getTarget() ) eq 'MAIN' and return; as I b

Re: A better way

2003-04-03 Thread Rob Dixon
"Rob Richardson" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Stefan, > > Personally, I'd prefer: > > if (target ne "MAIN") > { >#do lots of other stuff > } > > I think general programming practice discourages multiple return points > in subroutines. Yes, and it's no more dan

RE: Lanman???

2003-04-03 Thread Timothy Johnson
Jenda- Which version do you have in your repository? The last time I looked it was one revision behind the CPAN version. Of course, I haven't checked in a while... -Original Message- From: Jenda Krynicky To: [EMAIL PROTECTED] Sent: 4/3/03 6:28 AM Subject: Re: Lanman??? From: Leon

RE: A better way

2003-04-03 Thread Brian Ling
Thanks for that, I had not released you could effectively use the getTarget() return value twice :-) >well this works: >return if 'MAIN' eq (my $target = getTarget()); >/Stefan BBCi at http://www.bbc.co.uk/ This e-mail (and any attachments) is confidential and may contain personal views wh

How to measure Array or Hash's byte size ?

2003-04-03 Thread Li Ngok Lam
My method sounds stupid, but still works : my @array = ('123', 'abc', 'def', 1..9); my $len_of_array = 0 ; foreach my $elem(@array) {$len_of_array += length($elem) } print $len_of_array ; # I got '18' my %hash = (1=>2, 2=>3, 3=>4); foreach my $key(keys(%hash)) {$len_of_hash += length($

Re: Lanman???

2003-04-03 Thread Jenda Krynicky
From: Leon <[EMAIL PROTECTED]> > Does anyone know where I can find this module? It seems important for > win32 admining yet I cant find it on cpan. Any suggestions? I have it in my PPM repository at http://Jenda.Krynicky.cz/perl ppm install http://Jenda.Krynicky.cz/perl/Win32-Lanman.ppd And it

Re: Net::FTP in Passive mode hangs and fails (really frustrating)

2003-04-03 Thread Peter_Farrar
Hi David, I'm using Active State 5.6.1 build 631 on NT 4. This problem appears to be connected to the level of network traffic. But two things stand out. The files are on average only 12K, and the previous process had it's problems, but not this one. It was running on the same box, but was us

Re: matching patterns

2003-04-03 Thread Stefan Lidman
Diego Riano wrote: > > Hello All > > I am having problem figuring out how to match two patterns. I have two > pattern and I would like to now if they are the same or if one of them > is a sub pattern of the other. Ej: > $pattern1=[agpr]oprs[cd]x9; > $pattern2=[agpr]oprs; > $pattern3=aors; >

Re: A better way

2003-04-03 Thread Rob Richardson
Stefan, Personally, I'd prefer: if (target ne "MAIN") { #do lots of other stuff } I think general programming practice discourages multiple return points in subroutines. RobR __ Do you Yahoo!? Yahoo! Tax Center - File online, calculators, fo

matching patterns

2003-04-03 Thread Diego Riano
Hello All I am having problem figuring out how to match two patterns. I have two pattern and I would like to now if they are the same or if one of them is a sub pattern of the other. Ej: $pattern1=[agpr]oprs[cd]x9; $pattern2=[agpr]oprs; $pattern3=aors; $pattern2 is a "subpattern" of $patter

Re: use of "?" operator instead of "if"

2003-04-03 Thread Rob Dixon
Scott R. Godin wrote: > Jeff Westman wrote: > > > It's called the ternary operator, and works like this: > > > > $VAL ? $VAL = "$VAL:$expr" : $VAL = "$expr"; > > > > couldn't this be written as > > $VAL = $VAL ? "$VAL:$expr" : $expr; Exactly Scott. See my post in this thread. Rob -- To unsub

Re: A better way

2003-04-03 Thread Stefan Lidman
Brian Ling wrote: > > Hi List, > > I have the following bit of code, that works but doesn't feel like the > best way, can anyone think of a better neater answer maybe a one liner? > > my $target = getTarget(); > If ( target eq "MAIN" ) { return } > #do lots of other stuff with value of target w

How conver decimal num. to bin. mum.

2003-04-03 Thread Radovan Petrikí
Hi , how I conver decimal number to binary number in perl? Rado. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Problem with XML::Parser

2003-04-03 Thread Keith Boynton
Yeah it knows its not "technically" valid xml but XML::Parser does not care about that. XML::Checker::Parser would. The versions of XML::Parser of the same, I have an idea it may be Expat chucking out the results in a different format but I cannot be sure. "Wiggins D'Anconia" <[EMAIL PROTECTED]>

Re: Command line argurments to perl program

2003-04-03 Thread Scott R. Godin
Madhu Reddy wrote: > Hi, > I want to pass command line arguements to perl > program ? > How to do this ? There's Getopt::Std and Getopt::Long. IMHO the Getopt::Long interface and how it accesses the command line options is superior to Getopt::Std and supports both short (-t) and long (--type

RE: Problems with TEXT::CSV_XS

2003-04-03 Thread Scott R. Godin
Bk Good wrote: > Can Text::CSV handle other types of delimited files besides comma? You could also look into AnyData.pm (and DBD::AnyData if you're more familiar with DBI) which has some interesting ways of parsing various files and treating them like databases ;o) -- To unsubscribe, e-mail

Re: use of "?" operator instead of "if"

2003-04-03 Thread Scott R. Godin
Jeff Westman wrote: > It's called the ternary operator, and works like this: > > $VAL ? $VAL = "$VAL:$expr" : $VAL = "$expr"; > couldn't this be written as $VAL = $VAL ? "$VAL:$expr" : $expr; -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Which Perl is used to run the script???

2003-04-03 Thread Steve Grazzini
Tony Esposito <[EMAIL PROTECTED]> wrote: > So if I understand you correctly, if the line > > #!/usr/bin/perl > > exists in your Perl program, then that Perl is used regardless. > > And if it is missing, then > > perl -e myperl > > will use the first Perl environment that is

Lanman???

2003-04-03 Thread Leon
Hi everyone, Does anyone know where I can find this module? It seems important for win32 admining yet I cant find it on cpan. Any suggestions? Thx, Leon - Do you Yahoo!? Yahoo! Tax Center - File online, calculators, forms, and more

Re: Php perl?

2003-04-03 Thread Steve Grazzini
Dan Muey <[EMAIL PROTECTED]> wrote: > > If you want it to run like mod_php use mod_perl. Someone said that > not using mod_perl "increases dramatically the startup". Yeah by like > zillionth of a second. Hi Dan, There are a number of benchmarks at And some pe

A better way

2003-04-03 Thread Brian Ling
Hi List, I have the following bit of code, that works but doesn't feel like the best way, can anyone think of a better neater answer maybe a one liner? my $target = getTarget(); If ( target eq "MAIN" ) { return } #do lots of other stuff with value of target Thanks Brian BBCi at http://ww

Help with this!

2003-04-03 Thread Adriano Allora
Hi to all, I need to delete in a list of files, and in each file of newsgroups, all the posts which contents quoted lines. ONLY IF these lines are effectively repeating the non quoted text. I'm actually working on a single file in the directory, but the moment in which I have to work on a multi-fil

Re: DBI:mysql

2003-04-03 Thread Janek Schleicher
Jaws wrote at Thu, 03 Apr 2003 14:47:02 +0800: > I tried using the following: > > my $sth = $dbh->prepare(q{INSERT INTO MYTABLE (USERNAME,PASSWORD) VALUES (?, ?) > }) or die $dbh->errstr; > $sth->execute($username,PASSWORD('$pass')) or die $dbh->errstr; > $dbh->disconnect; >