possible improvement(s)

2003-01-10 Thread Yacketta, Ronald
Hello All, I am sure someone out their in Perl land can offer a better solution to the following. ### ### slurp in all the required data for the report ### open ($LOG,"cat $g_logdir/OrderServer-*.log|") or die ( "Unable to open $g_logdir/OrderSe

Re: Delimiter Question

2003-01-10 Thread John W. Krahn
Mark Goland wrote: > > From: "John W. Krahn" <[EMAIL PROTECTED]> > > > Mark Goland wrote: > > > > > > the way you did it, would need to use or operator > > > $answer =~ m/Y|y|N|n/ > > > you probebly want to check if thats the only thing entred, > > > > > > $answer =~ m/^yn$/i > > > > > > ^ begins

build an array from a pattern match?

2003-01-10 Thread David Nicely
Hello, I am a total beginner, so any help or a pointer to an appropriate doc will be appreciated. I am trying to read a file, and find all the lines that look like; "Finding 111" where "111" could be any number with any amount of digits. What I am trying to do now is to assign a variable to th

Re: Epoch midnight

2003-01-10 Thread Todd W
Deborah Scott wrote: I thought I understood the answer, but I need more details. What exactly would I enter if I want a program to find the epoch time for midnight each night? I know how to find "current" time and date in both "human" time and epoch time. I want to generate a report that displ

Re: sorting hash after deref

2003-01-10 Thread Mark Goland
(B> foreach my $i ( sort { $a <=> $b } (keys (%hash))) { (B>print "$i => $hash{$i}\n" if ( defined $hash{$i} ); (B> } (B> } (B> (B (Bhow about (B (B foreach my $i ( sort ( keys(%hash) ) ) { (Bprint "$i => $hash{$i}\n"

RE: hash sorting

2003-01-10 Thread Timothy Johnson
Yup. I guess I shouldn't answer questions on the last hour of a busy work week, but I'll give it another shot. I suppose you could try something along these lines: foreach(sort keys %$i){ push(@sorted,$_) unless /^I\d+$/; } foreach(sort keys %$i){ push(@sorted,$_) if /^I\d+$/; } now @sorte

Re: Delimiter Question

2003-01-10 Thread Mark Goland
Whoops. $answer =~ m/^y|n$/i :O) - Original Message - From: "John W. Krahn" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, January 10, 2003 2:38 PM Subject: Re: Delimiter Question > Mark Goland wrote: > > > > > How do I challenege more than one variable like I want to >

Re: hash sorting

2003-01-10 Thread david
Ronald Yacketta wrote: > Can some please help here :) > > I have the following > > > sub dbMonthlySelect() { > my $query; > my $result; > > $query = "select * from mbstats_se where > STATDATE=TO_DATE('12/30/02','MM/DD/YY')"; $result = > &doQuery($query,'

Re: hash sorting

2003-01-10 Thread Wiggins d'Anconia
Timothy Johnson wrote: Try using 'cmp' instead of '<=>' in your sort. Then it will sort alphanumerically. This does not appear to help, perldoc perlop says: "Binary "cmp" returns -1, 0, or 1 depending on whether the left argument is stringwise less than, equal to, or greater than the right a

RE: hash sorting

2003-01-10 Thread Timothy Johnson
Try using 'cmp' instead of '<=>' in your sort. Then it will sort alphanumerically. -Original Message- From: Yacketta, Ronald [mailto:[EMAIL PROTECTED]] Sent: Friday, January 10, 2003 4:43 PM To: [EMAIL PROTECTED] Subject: hash sorting Can some please help here :) I have the following

hash sorting

2003-01-10 Thread Yacketta, Ronald
Can some please help here :) I have the following sub dbMonthlySelect() { my $query; my $result; $query = "select * from mbstats_se where STATDATE=TO_DATE('12/30/02','MM/DD/YY')"; $result = &doQuery($query,'dbMonthlySelect'); my $i = $result->fetchrow_h

Re: Remove some, not all \n from a text block

2003-01-10 Thread R. Joseph Newton
"perldoc -f continue" Paul Johnson - [EMAIL PROTECTED] Hmm, okay, it's there, I see. I'm not sure I would be in a hurry to use it, though. I think a well-construction flow within a block should obviate any need for it. The next statement, though, is very useful, and I think that was the us

CGI sessions and Client's OS

2003-01-10 Thread aman raheja
Hello I am using Perl/CGI on Linux (with Apache). Some users have cookies disabled in their browsers and some are using the old ones, which cause problems, along with Netscape. Anyhow, I am looking for following solutions 1. How do we know the Operating System of the Client's system? 2. Where can I

RE: Epoch midnight

2003-01-10 Thread Mark Anderson
> What exactly would I enter if I want a program to find the epoch time for > midnight each night? I know how to find "current" time and date in both > "human" time and epoch time. I can't give you code, because I haven't worked with perl's various time functions, but logically, I would get the

Epoch midnight

2003-01-10 Thread Scott, Deborah
I thought I understood the answer, but I need more details. What exactly would I enter if I want a program to find the epoch time for midnight each night? I know how to find "current" time and date in both "human" time and epoch time. I want to generate a report that displays the events that are

RE: Formfeed in html (perl/cgi)

2003-01-10 Thread Bob Showalter
dhoubrechts wrote: > Can I put a formfeed in a perl cgi ? > I've tried print "\f" or something like but I can't force a new page. > Can someone help me ? This is not a Perl issue. See: -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands

Formfeed in html (perl/cgi)

2003-01-10 Thread dhoubrechts
Can I put a formfeed in a perl cgi ? I've tried print "\f" or something like but I can't force a new page. Can someone help me ? -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Formfeed in html (perl/cgi)

2003-01-10 Thread dhoubrechts
Can I put a formfeed in a perl cgi ? I've tried print "\f" or something like but I can't force a new page. Can someone help me ? -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Remove some, not all \n from a text block

2003-01-10 Thread Paul Johnson
On Fri, Jan 10, 2003 at 09:34:18AM -0600, Dan Muey wrote: > Just to note I wasn't the one that said : > > > Hi Alan, > > > > Apparently, continue is not supported in Perl, but a conditional next > > seems to perform the same function. > > > > Joseph > > > :) No. But unfortunately your mailer d

sorting hash after deref

2003-01-10 Thread Yacketta, Ronald
Folks, (B (BCan some one kindly slap me silly and show me where I went south? (B (B (Bsub dbMonthlySelect() { (Bmy $query; (Bmy $result; (B (B$query = "select * from mbstats_se where (BSTATDATE=TO_DATE('12/30/02','MM/DD/YY')"; (B$result = &doQuery($query,'

Re: Delimiter Question

2003-01-10 Thread John W. Krahn
Mark Goland wrote: > > > How do I challenege more than one variable like I want to > > check for the input of Y N y or n for a yes no question. I > > put until $answer =~ m/YyNn/ that did not work. Anybody have > > any solutions? > > the way you did it, would need to use or operator > $answer =

Re: Remove some, not all \n from a text block

2003-01-10 Thread John W. Krahn
"Alan C." wrote: > > John W. Krahn wrote: > > "Alan C." wrote: > > > Here is one way to do it: > > > > #!/perl/bin/perl -w > > use strict; > > > > my $text = do { local $/; <> }; > > $text =~ s/\n(?!\.|\z)/ /g; > > print $text; > > > Your code does the job just super! Thanks! > The (|) parenthesi

Re: Top Posting Preferences (was navigate the directories)

2003-01-10 Thread Kegs
On Fri, 2003-01-10 at 01:23, R. Joseph Newton wrote: > Hi James, > > You had one good point there. I have now turned "automatically quote reply" > off in my m,ailer preferences. Now my replies should include only such part > of the originals as is necessary to make the connection to the prior p

Re: checking if a file is empty

2003-01-10 Thread John W. Krahn
Pradeep Goel wrote: > > Hi all Hello, > /// > if($TYPE eq "HP-UX") > { `/usr/sbin/swlist | grep "OV NNM" |cut -f1> RF1 `;} > else > { `find /system/ -name deins_patch |cut -f3 -d / > RF1`; } > > # > how to check if the new

Re: Best way to return largest of 3 Vars?

2003-01-10 Thread Paul Johnson
On Fri, Jan 10, 2003 at 11:53:15AM -0600, Jensen Kenneth B SrA AFPC/DPDMPQ wrote: > From: Tim Musson [mailto:[EMAIL PROTECTED]] > > > > JKBSAD> $one = 1; > > > > JKBSAD> ($one == 1) ? (print "\$one equals", print "$one") : (print > > JKBSAD> "\$one does not ", print "equal 1"); > > > > Why the

RE: menu

2003-01-10 Thread Dylan Boudreau
Thanks everyone, for some reason a regexpr never came to mind. Good thing its Friday, Dylan -Original Message- From: Dan Muey [mailto:[EMAIL PROTECTED]] Sent: January 10, 2003 1:35 PM To: Dylan Boudreau; [EMAIL PROTECTED] Subject: RE: menu You need a regular expression like Until ($

RE: Best way to return largest of 3 Vars?

2003-01-10 Thread Jensen Kenneth B SrA AFPC/DPDMPQ
The two print statements were there for the sake of having 2 commands. Most of the time I have in statements I have more than one statement to execute in the block. (Condition) ? (if condition true statements) : (if condition false statements); Seems to me that multiple commands are executed in r

Re: Best way to return largest of 3 Vars?

2003-01-10 Thread Tim Musson
Hey Jensen, My MUA believes you used Internet Mail Service (5.5.2653.19) to write the following on Friday, January 10, 2003 at 11:23:43 AM. JKBSAD> $one = 1; JKBSAD> ($one == 1) ? (print "\$one equals", print "$one") : (print "\$one does not ", print "equal 1"); Why the double print s

Re: Best way to return largest of 3 Vars?

2003-01-10 Thread Tim Musson
Hey Jensen, My MUA believes you used Internet Mail Service (5.5.2653.19) to write the following on Friday, January 10, 2003 at 11:23:43 AM. JKBSAD> my $max = (sort {$b<=>$a} ($x, $y, $z))[0]; JKBSAD> What is the "[0]" doing? It is putting the largest value in $max. Try changing it to -

RE: Sybase DBlib & CGI issue

2003-01-10 Thread Dan Muey
Have it print $dbh->errstr to see what the database says is wrong. At least that'd work with DBI not sure about Sybase::Dblib. Regardless have it print the problem instead of just , 'sorry' Not sure also but it sounds like apache may not have permission to access the database. Ie you 'userbob'

RE: menu

2003-01-10 Thread Dan Muey
You need a regular expression like Until ($selection =~ m/^1$|^2$|^9$/) { Do some stuff } The ^ and $ keep them from enterin say '12' or '109' or 'I love 1 monkey'. Remove them if you only care that they at least type the digit and don't care if there's extra stuff Dan -Original Message--

RE: menu

2003-01-10 Thread Paul Kraus
this worked for me. #!/usr/bin/perl -w until ($selection=~/[129]/){ print "Hello\n"; $selection = 1; } I tried 1239. 129 print "hello" once. 3 is endless hello loop. Or you can do until (($selection==1)||($selection==2)||($selection==9)){ code; } hope that helps. > -Origin

RE: menu

2003-01-10 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Dylan Boudreau wrote: > I am trying to make a small menu for a script and the options are 1 > or 2 or 9. I have it written like this > > until ($selection == '1|2|9'){ > do some stuff > } > > > and it wont work. I know it is something simple but I am a little > simple myself today and don

menu

2003-01-10 Thread Dylan Boudreau
I am trying to make a small menu for a script and the options are 1 or 2 or 9. I have it written like this until ($selection == '1|2|9'){ do some stuff } and it wont work. I know it is something simple but I am a little simple myself today and don't know what I am doing wrong. Than

RE: one liner replace / with \

2003-01-10 Thread Bob Showalter
Paul Kraus wrote: > Now I wanted to replace any white space with a single space. > > I used this command > > perl -pi.bak -w -e "s/\s+/ /g" map.bat > > That worked correctly but it removed all of my new lines. Because new lines are whitespace. Adding -l (ell) to the perl command is the easiest

Sybase DBlib & CGI issue

2003-01-10 Thread Andy Bridger
I have a perl cgi script that needs to access a database using Sybase::DBlib. The CGI bit is working - am able to display text, forms etc correctly, but when try to connect to the database it fails to connect. Oddly the same db connection script works in a different script - and the db connectio

RE: one liner replace / with \

2003-01-10 Thread Paul Kraus
that worked. Now I wanted to replace any white space with a single space. I used this command perl -pi.bak -w -e "s/\s+/ /g" map.bat That worked correctly but it removed all of my new lines. Why should I use tr instead? > -Original Message- > From: Bob Showalter [mailto:[EMAIL PROTECT

RE: one liner replace / with \

2003-01-10 Thread Bob Showalter
Paul Kraus wrote: > I want to replace all forward slashes with back slashes is a file. > Using a one liner I tried > > perl -I -i.bak -w -e 's!/!\\!g' map.bat 1) You don't need -I 2) You do need -p 3) You probably need to use double-quotes instead of single, due to Windows shell brain damage.

one liner replace / with \

2003-01-10 Thread Paul Kraus
I want to replace all forward slashes with back slashes is a file. Using a one liner I tried perl -I -i.bak -w -e 's!/!\\!g' map.bat I get this error useless use of a constant in void context at -e line 1. this is on a windows xp machine. Paul Kraus Network Administrator PEL Supply Company 216.

RE: Best way to return largest of 3 Vars?

2003-01-10 Thread Jensen Kenneth B SrA AFPC/DPDMPQ
In the line my $max = (sort {$b<=>$a} ($x, $y, $z))[0]; What is the "[0]" doing? Also another question. While messing around with the compact version of if statements I tried these. $one = 1; ($one == 1) ? (print "\$one equals", print "$one") : (print "\$one does not ", print "equal 1"); Return

Re: Best way to return largest of 3 Vars?

2003-01-10 Thread Tim Musson
Hey Jenda, My MUA believes you used Pegasus Mail for Windows (v4.02a) to write the following on Friday, January 10, 2003 at 11:04:07 AM. JK> According to the benchmarks this one was slightly better JK> my ($max) = sort {$b<=>$a} ($x, $y, $z); I thought "Bob2" was the better one

Re: Best way to return largest of 3 Vars?

2003-01-10 Thread Jenda Krynicky
From: Tim Musson <[EMAIL PROTECTED]> > Hey Jenda, > > My MUA believes you used Pegasus Mail for Windows (v4.02a) > to write the following on Friday, January 10, 2003 at 10:04:23 AM. > > Thanks all! I know I can always count on this list! :-) > Looks like we are going with this one. >

Re: Best way to return largest of 3 Vars?

2003-01-10 Thread Tim Musson
Hey Jenda, My MUA believes you used Pegasus Mail for Windows (v4.02a) to write the following on Friday, January 10, 2003 at 10:04:23 AM. Thanks all! I know I can always count on this list! Looks like we are going with this one. JK> sub Bob { JK> my $max = (sort {$b<=>$a} ($x, $

RE: Remove some, not all \n from a text block

2003-01-10 Thread Dan Muey
Like I said, typed wrong. Didn't have time to go look for it but I thought it had to do with that -q. Just to note I wasn't the one that said : > Hi Alan, > > Apparently, continue is not supported in Perl, but a conditional next > seems to perform the same function. > > Joseph > :) Dan -Or

RE: Remove some, not all \n from a text block

2003-01-10 Thread Paul Johnson
Dan Muey said: > -Original Message- > From: R. Joseph Newton [mailto:[EMAIL PROTECTED]] > Sent: Friday, January 10, 2003 8:26 AM > To: Alan C. > Cc: [EMAIL PROTECTED] > Subject: Re: Remove some, not all \n from a text block > > > Hi Alan, > > Apparently, continue is not supported in Perl,

Re: perl monger needed asap...

2003-01-10 Thread Jenda Krynicky
From: Benjamin Jurado <[EMAIL PROTECTED]> Subject:perl monger needed asap... Please read "How To Ask Questions The Smart Way" (http://www.tuxedo.org/~esr/faqs/smart-questions.html#bespecific) ASAP. > how can i store the results in a array,hash,reference... > >

RE: Perl Subroutines

2003-01-10 Thread Jenda Krynicky
From: "Scott, Joshua" <[EMAIL PROTECTED]> > Let me add a little more info regarding my question. The subroutines > are already setup and can't be modified easily. The basic task of all > the different subs is to print to STDOUT. I'd really like to be able > to call this sub from another script a

RE: Best way to return largest of 3 Vars?

2003-01-10 Thread Jenda Krynicky
From: Bob Showalter <[EMAIL PROTECTED]> > Tim Musson wrote: > > Hey all, > > > > I need to return the largest of 3 vars. Is there a better way than > > nested IF statements? Maybe put them in an array and sort it? > > You can write the sort without needing a separate array:

RE: bandwidth restricting

2003-01-10 Thread Dan Muey
If you really want to get into it you can parse the apache log and calculate bandwidth loosley o ntht althoug hh that won't include ftp, pop, smtp, etc.. Traffic. There's a module to help called Apache::ParseLog or something like that. -Original Message- From: Victor Tsang [mailto:[EM

RE: Perl Subroutines

2003-01-10 Thread Dan Muey
If you are on unix and index.cgi prints all of the html that you'd like in index.html then eithe command line or backtick in a script : ./index.cgi > index.html Dan -Original Message- From: Bob X [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 09, 2003 7:12 PM To: [EMAIL PROTECTED]

RE: Why can't use SQL "GROUP BY..."?

2003-01-10 Thread Dan Muey
I apologize if this has already been covered to but... Can you run that command by hand and does it work? Do this to see is both $Table has a value and if the generated code is actaully a valid sql command. $query = "SELECT page FROM $Table GROUP BY page"; print " QUERY -$query- \n" $value2 =

RE: Remove some, not all \n from a text block

2003-01-10 Thread Dan Muey
Not sure specifically about continue but just because perldoc doesn't turn up anything doesn't mean perl doesn't support it. It means that you either typed it wrong or your perl doc doesn't have that for some reason. Just fyi -Original Message- From: R. Joseph Newton [mailto:[EMAIL PROTE

Re: Remove some, not all \n from a text block

2003-01-10 Thread R. Joseph Newton
Hi Alan, Apparently, continue is not supported in Perl, but a conditional next seems to perform the same function. Joseph ...perldoc -q continue turned up nothing. ...providing condition met, "next" makes it skip to the next iteration? -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additio

RE: Best way to return largest of 3 Vars?

2003-01-10 Thread Bob Showalter
Tim Musson wrote: > Hey all, > > I need to return the largest of 3 vars. Is there a better way than > nested IF statements? Maybe put them in an array and sort it? You can write the sort without needing a separate array: $max = (sort {$b<=>$a} ($x, $y, $z))[0]; Or, you can do something l

Re: Delimiter Question

2003-01-10 Thread Mark Goland
> How do I challenege more than one variable like I want to > check for the input of Y N y or n for a yes no question. I > put until $answer =~ m/YyNn/ that did not work. Anybody have > any solutions? the way you did it, would need to use or operator $answer =~ m/Y|y|N|n/ you probebly want to

Re: Removing a specific value from a hash whose keys contains multiple values

2003-01-10 Thread Tim Musson
Hey Sophia, My MUA believes you used to write the following on Thursday, January 9, 2003 at 6:48:42 PM. SC> I am not sure how to delete a specific value from a hash whose SC> keys contains multiple values. SC> Could anyone advice, please? Does this help? perldoc -q delete -- Tim Mu

Re: Why can't use SQL "GROUP BY..."?

2003-01-10 Thread Philip Newton
On Thu, 9 Jan 2003 22:59:03 +0800 (CST), [EMAIL PROTECTED] (Gary fung) wrote: > My coding is similar as: > > $value2 = $dbh->prepare("SELECT page FROM $Table > > GROUP BY page") || die "Couldn't add record, ".$dbh->errstr(); > > Whenever I use "GROUP BY.." , an error statement will go out : >

Re: Remove some, not all \n from a text block

2003-01-10 Thread Alan C.
Rob Dixon wrote: my $last = undef; while (<>) { next unless defined $last; chomp $last unless /^\./; print $last; } continue { $last = $_; } print $last; Your code works super for the job! I had thought of chomp and unless. But I'm too

Re: Remove some, not all \n from a text block

2003-01-10 Thread Alan C.
John W. Krahn wrote: "Alan C." wrote: Here is one way to do it: #!/perl/bin/perl -w use strict; my $text = do { local $/; <> }; $text =~ s/\n(?!\.|\z)/ /g; print $text; Your code does the job just super! Thanks! The (|) parenthesis "group" with left side | right side sandwiched between the

Re: Extracting Info from a websource

2003-01-10 Thread Kieren Diment
On Fri, Jan 10, 2003 at 12:51:45AM +0530, Sukrit wrote: > Problem Overview > - > Somewhere on the world wide web, exists an asp page with the following > form - > > > On entering a valid roll number and pressing enter, results for that number > are displayed. Currently this has

Re: Top Posting Preferences (was navigate the directories)

2003-01-10 Thread Bob X
"R. Joseph Newton" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Having perused a few newsgroups I would say that 99.9% of them post to the bottom of the e-mail. Question at the top...answers at the end. Bob -- To unsubscribe, e-mail: [EMAIL PROTECTED] For

Re: Perl Subroutines

2003-01-10 Thread Bob X
"Joshua Scott" <[EMAIL PROTECTED]> wrote in message 5D23931127B7EB409640001B7E8A6E32014A2AFA@PASNT32">news:5D23931127B7EB409640001B7E8A6E32014A2AFA@PASNT32... > I've created a group of Perl subroutines to handle the creation and layout > of my web pages. These subs are used when browsing to my we

Best way to return largest of 3 Vars?

2003-01-10 Thread Tim Musson
Hey all, I need to return the largest of 3 vars. Is there a better way than nested IF statements? Maybe put them in an array and sort it? -- Tim Musson Flying with The Bat! eMail v1.62 Christmas Edition Windows 2000 5.0.2195 (Service Pack 2) Why isn't there mouse-flavored cat food? -- To

Removing a specific value from a hash whose keys contains multiple values

2003-01-10 Thread Sophia Corwell
I am not sure how to delete a specific value from a hash whose keys contains multiple values. Could anyone advice, please? Thanks, Sophia __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com -- To uns

RE: regular expressions

2003-01-10 Thread Kehayias, Evan N Mr NISO/Lockheed Martin
What I posted earlier is pretty much it. I basically want to change the contents of a sudoers file for sudo. I make almost all of the other modifications in another script. In the current script I want to find the line that says User_AliasACLPUSHER in the sudoers file and replace it with it

Re: CRLF vs LF questions

2003-01-10 Thread David Eason
HTML-Kit will do that, too. It's just that I have been known to open up lesser editors from time to time, such as Notepad. I'll check with my ISP to see if the Perl on the Cobalt Raq's can be upgraded. It doesn't matter that much, though. Thanks for the replies. -- To unsubscribe, e-mail: [

RE: regular expressions

2003-01-10 Thread Kehayias, Evan N Mr NISO/Lockheed Martin
At this point could a user still input something like 7mary3. Ideally a user can enter a name or several separated by commas but *nothing* else. Convention would be lowercase firstinitiallastname It seems like Rob's is really close but I don't understand all of the code. I am a little shy with a

Re: checking if a file is empty

2003-01-10 Thread Sudarshan Raghavan
# how to check if the newly made file RF1 is empty or not ? # perldoc -f -x check the -z operator -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

checking if a file is empty

2003-01-10 Thread PRADEEP GOEL
Hi all /// if($TYPE eq "HP-UX") { `/usr/sbin/swlist | grep "OV NNM" |cut -f1> RF1 `;} else { `find /system/ -name deins_patch |cut -f3 -d / > RF1`; } # how to check if the newly made file RF1 is empty or not ? ###

Re: Extracting Info from a websource

2003-01-10 Thread Sukrit
> "Rob" == Rob Dixon <[EMAIL PROTECTED]> writes: Rob> Well, I'm not sure what to do here. It's quite possible - I Rob> would use modules LWP, HTTP::Request::Form and Rob> HTML::TreeBuilder - but if you've only just read LP then I Rob> doubt you would understand how to do it. I

Re: Removing a specific value from a hash whose keys contains multiple values

2003-01-10 Thread John W. Krahn
Sophia Corwell wrote: > > Sorry about that... > > Here is an example: > > Here is what my hash looks like: > > %compilers = ( >system1 => ['compiler_a'], >system2 => ['compiler_b', > 'compiler_c','compiler_d'], >system3 => ['compiler_e'], > ); > > Now, if I want to delete just the

Re: Help with end-time start-time sorting problem

2003-01-10 Thread John W. Krahn
Deborah Scott wrote: > > I have a txt data file that has several fields. Two of the fields are start > time and end time (listed in epoch time). > > I need to write a perl program that finds (and prints) events that occur > between midnight "last night" and "midnight tonight." > > First problem:

Re: Check if a hash is empty

2003-01-10 Thread Rob Dixon
Hi I'm wondering why you want another way, as this is slower than it needs to be but shouldn't cause any problems, but you can just do: if (%hash) { : } which is neater. HTH, Rob "Nyimi Jose" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]..

Re: Check if a hash is empty

2003-01-10 Thread Victor Tsang
if (%hash){ $ do } Tor. "NYIMI Jose (BMB)" wrote: > > Hello, > > If(keys %hash){ > #do ... > } > > Could you suggest an other way, please ? > > Thanks in advance. > > José. > > DISCLAIMER > > "This e-mail and any attachment thereto may contain information which

Check if a hash is empty

2003-01-10 Thread NYIMI Jose (BMB)
Hello, If(keys %hash){ #do ... } Could you suggest an other way, please ? Thanks in advance. José. DISCLAIMER "This e-mail and any attachment thereto may contain information which is confidential and/or protected by intellectual property rights and are intended for the sol

Re: suppress STDIN from user

2003-01-10 Thread Rob Dixon
That's right. It's: use Term::ReadKey; : ReadMode 2; $pass = ReadLine 0; ReadMode 0; /R "Simran" <[EMAIL PROTECTED]> wrote in message 1042162674.10277.43.camel@pingu">news:1042162674.10277.43.camel@pingu... > Have a look at Term::ReadKey ... > > You need to set noecho (i

Re: Top Posting Preferences (was navigate the directories)

2003-01-10 Thread John W. Krahn
Rob Dixon wrote: > > Hi John, all Hello, > "John W. Krahn" <[EMAIL PROTECTED]> wrote in message > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > > > > [ top-posting fixed ] > > I'm wondering how much of an error, if any, people think this is? I > personally choose to top-post so that anybody re

Re: regular expressions

2003-01-10 Thread John W. Krahn
Evan N Mr Niso/Lockheed Martin Kehayias wrote: > > Greetings, Hello, > I am attempting to limit entries a user could make when inputting names into > one of my scripts. I prompt the user to enter one or more names. One name > is easy to isolate but when there are more I want to support commas.

Re: Top Posting Preferences (was navigate the directories)

2003-01-10 Thread Randal L. Schwartz
> "Wiggins" == Wiggins D'Anconia <[EMAIL PROTECTED]> writes: Wiggins> How about top posting where it makes sense, aka the argument has Wiggins> shifted substantially, the original poster had no clue what they were Wiggins> talking about :-), etc. In that case, it's a new thread. Don't even h