RE: next if statement....

2004-03-18 Thread Bill Tribley
-Original Message- From: Greg Schiedler [mailto:[EMAIL PROTECTED] Sent: Thursday, March 18, 2004 2:16 PM To: [EMAIL PROTECTED] Subject: next if statement OK I'm trying to modify the code below to recognize an additional next if statement. I have included a snip of the file

FW: next if statement....

2004-03-18 Thread Bill Tribley
may separate the text from the equal sign on both sides. Bill -Original Message- From: Greg Schiedler [mailto:[EMAIL PROTECTED] Sent: Thursday, March 18, 2004 2:16 PM To: [EMAIL PROTECTED] Subject: next if statement OK I'm trying to modify the code below to recognize an additional

Re: is next implied in a set of if elsifs?

2003-10-20 Thread Steve Grazzini
On Sun, Oct 19, 2003 at 08:02:34PM -0700, R. Joseph Newton wrote: I think your formatting may reflect a misconception about if and elsif staements. while ($foo) { if ($condition_1) { do_1(); } elsif ($condition_2) { do_2(); } # ... } Should be: Wait a minute!

Re: is next implied in a set of if elsifs?

2003-10-19 Thread R. Joseph Newton
Dan Anderson wrote: But what's the speed concerns here? This is negligable. I just double checked and each if statement takes roughly 9.8 microseconds more to execute then an elsif. That may not seem like a lot but over a program spanning several files (perhaps as much as a meg in code

is next implied in a set of if elsifs?

2003-10-15 Thread Dan Anderson
(); } # ... } 3) using a series of if elsifs and calling next: i.e. while ($foo) { if ($condition_1) { do_1(); next; } elsif ($condition_2) { do_2(); next; } # ... } For readability, I prefer 1 over 2. But I figured 2 would be faster then 1. For readability I prefer 2

Re: is next implied in a set of if elsifs?

2003-10-15 Thread James Edward Gray II
++; } # $x == 11 2) Using a series of if elsifs i.e. while ($foo) { if ($condition_1) { do_1(); } elsif ($condition_2) { do_2(); } # ... } 3) using a series of if elsifs and calling next: i.e. while ($foo) { if ($condition_1) { do_1(); next

Re: is next implied in a set of if elsifs?

2003-10-15 Thread Jeff 'japhy' Pinyan
($condition_2) { do_2(); } } while ($foo) { if ($condition_1) { do_1(); next; } elsif ($condition_2) { do_2(); next; } } These are, in your case, identical. An if-elsif-else block skips all the remaining conditionals when it reaches a true one. So you don't need 'next

Re: is next implied in a set of if elsifs?

2003-10-15 Thread Dan Anderson
But what's the speed concerns here? This is negligable. Well until applied across the entire program. The program I am working with is significantly longer then the example. -Dan -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: is next implied in a set of if elsifs?

2003-10-15 Thread Dan Anderson
thousands of if statements there is a huge difference in the amount of time taken, esp. if it's a web program being used by a number of users simultaneously. I also triple checked with next statements and I got a really bizarre result, they were actually slower then just using if elsifs by 17

Re: is next implied in a set of if elsifs?

2003-10-15 Thread Paul Johnson
On Wed, Oct 15, 2003 at 06:25:45PM -0400, Dan Anderson wrote: But what's the speed concerns here? This is negligable. Well until applied across the entire program. The program I am working with is significantly longer then the example. Just a few random quotes, attached to this message

Re: is next implied in a set of if elsifs?

2003-10-15 Thread James Edward Gray II
, Damn Lies and Benchmarks? ;) Careful, here be dragons! I also triple checked with next statements and I got a really bizarre result, they were actually slower then just using if elsifs by 17 microseconds. :: shrugs :: I guess it makes sense -- next involves extra overhead. Yes, executing a next

Re: is next implied in a set of if elsifs?

2003-10-15 Thread Dan Anderson
2: elsif ($condition) { print TRUE; } # condition is never reached #test 3: elsif ($condition) { print TRUE; next; } # condition is never reached Now this is not actually reflective of the code in my program. I just needed a clean, controlled environment to compare different things. You both make

Re: is next implied in a set of if elsifs?

2003-10-15 Thread James Edward Gray II
On Wednesday, October 15, 2003, at 07:30 PM, Dan Anderson wrote: Now this is not actually reflective of the code in my program. I just needed a clean, controlled environment to compare different things. Do you have a large if/else decision tree? We might be able to provides some ideas there

Re: is next implied in a set of if elsifs?

2003-10-15 Thread Tore Aursand
On Wed, 15 Oct 2003 17:34:33 -0400, Dan Anderson wrote: How is speed affected in the following scenarios: [...] Why don't you find out? Take a look at the Benchmark module. There is also a 'SWITCH' module out there, I think. You might look at that one, too. -- Tore Aursand [EMAIL

next if........ a cleaner way?

2003-03-20 Thread chad kellerman
/\|/, $userInfo; # get rig of the header info from repquota next if ( ( $name =~ /Block/ ) or ( $name =~ /nobody/ ) or ( $name =~ /User/ ) or ( $name =~ /^\d/ ) or ( $name =~ /www/ ) or ( $name =~ /backup/ ) or ( $name =~ /ftp/ ) or ( $name =~ /httpd/ ) or ( $name =~ /root

RE: next if........ a cleaner way?

2003-03-20 Thread Hanson, Rob
This should work... next if $name =~ /Block|nobody|User|www|backup|ftp|httpd|root|netop|sysop|users|bill/; next if $name =~ /^(?:\d|#)/; next if $quota !~ /\d+/; next if $quota = 8; You should also be able to combine the two (just make sure you test my syntax)... next if $name =~ /(?:^(?:\d

Re: next if........ a cleaner way?

2003-03-20 Thread Rob Dixon
of the header info from repquota I hope you have used 'strict' and 'warnings'? I haven't seen any declarations! next if ( ( $name =~ /Block/ ) or ( $name =~ /nobody/ ) or ( $name =~ /User/ ) or ( $name =~ /^\d/ ) or ( $name =~ /www/ ) or ( $name =~ /backup/ ) or ( $name =~ /ftp/ ) or ( $name

Re: next if........ a cleaner way?

2003-03-20 Thread R. Joseph Newton
the likelihood of error. next if ( ( $name =~ /Block/ ) or ( $name =~ /nobody/ ) or ( $name =~ /User/ ) or ( $name =~ /^\d/ ) or ( $name =~ /www/ ) or ( $name =~ /backup/ ) or ( $name =~ /ftp/ ) or ( $name =~ /httpd/ ) or ( $name =~ /root/ ) or ( $name =~ /netop/ ) or ( $name =~ /sysop

Re: Previous and Next

2003-03-13 Thread Octavian Rasnita
You need to use Javascript. a href=javascript:history.back()Back/a Teddy, Teddy's Center: http://teddy.fcc.ro/ Email: [EMAIL PROTECTED] - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, March 13, 2003 10:42 AM Subject: Previous and Next Hi List, How

Re: Previous and Next

2003-03-13 Thread Randal L. Schwartz
that, how in the world are they going to click on a link that could do the same thing? The biggest problem here is in the original question: Octavian How can i write a PERL Script to simulate the Previous (-) and Next (-) Octavian Links Octavian (like in IE or Netscape). As in, what could

Re: Match pattern and print next line

2002-11-25 Thread david
Joshua Kaufman wrote: Bob - Thanks, I'll investigate that. I'm also hoping that the list will tell me how to do it by incrementing the proper special variable. I could swear that I've done that before, and have found it useful in other contexts. -- Josh The $. variable won't do

Re: Match pattern and print next line

2002-11-24 Thread badchoice
an alternative: $print, /- Student Id|$/ for LOG; -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Match pattern and print next line

2002-11-23 Thread Joshua Kaufman
Hi All; I'm trying to match a pattern in a text file and then print out the next line in that file. I could swear that I've done this before by incrementing $. to move to the next line. However, the code below is printing out the matched line rather than the next line. #!/usr/bin/perl open

Re: Match pattern and print next line

2002-11-23 Thread Wiggins d'Anconia
You could always say LOG again inside your if to print the next line. Realize that you will not then be able to check that line for the string, but if that is ok which it sounds like it is then it should work. See below. Joshua Kaufman wrote: Hi All; I'm trying to match a pattern in a text

Re: Match pattern and print next line

2002-11-23 Thread Joshua Kaufman
your if to print the next line. Realize that you will not then be able to check that line for the string, but if that is ok which it sounds like it is then it should work. See below. Joshua Kaufman wrote: Hi All; I'm trying to match a pattern in a text file and then print out the next

Re: Match pattern and print next line

2002-11-23 Thread Paul Johnson
;-) Altering $. has no effect on the position of a filehandle. On 11/23/02 8:44 AM, Wiggins d'Anconia [EMAIL PROTECTED] wrote: You could always say LOG again inside your if to print the next line. Realize that you will not then be able to check that line for the string, but if that is ok

Re: Match pattern and print next line

2002-11-23 Thread Joshua Kaufman
that I'm not crazy and have done it this way before. I'm sorry to report that you may be crazy ;-) Altering $. has no effect on the position of a filehandle. On 11/23/02 8:44 AM, Wiggins d'Anconia [EMAIL PROTECTED] wrote: You could always say LOG again inside your if to print the next

Re: Match pattern and print next line

2002-11-23 Thread Wiggins d'Anconia
. I'm sorry to report that you may be crazy ;-) Altering $. has no effect on the position of a filehandle. On 11/23/02 8:44 AM, Wiggins d'Anconia [EMAIL PROTECTED] wrote: You could always say LOG again inside your if to print the next line. Realize that you will not then be able to check

Re: Match pattern and print next line

2002-11-23 Thread John W. Krahn
Joshua Kaufman wrote: Hi All; Hello, I'm trying to match a pattern in a text file and then print out the next line in that file. I could swear that I've done this before by incrementing $. to move to the next line. However, the code below is printing out the matched line rather than

Net Daemon Next Result Issue

2002-09-19 Thread Darryl Schnell
I am working on a User Search Page that uses Net Daemon to connect to another system and gather username information. Everything appears to be working fine except the user search next results option (Code included below). Basically the program goes out connects to a daemon on another system

Net Daemon Next Result Issue

2002-09-19 Thread Darryl Schnell
I am working on a User Search Page that uses Net Daemon to connect to another system and gather username information. Everything appears to be working fine except the user search next results option (Code included below). Basically the program goes out connects to a daemon on another system

Re: Net Daemon Next Result Issue

2002-09-19 Thread Janek Schleicher
Darryl Schnell wrote at Thu, 19 Sep 2002 16:09:06 +0200: The problem is it's giving me a illegal division by zero error for the following line: if ($result_count !=0) { $pagecount = int($result_count / $limit); ^^ Seems like $limit is 0 :-)

Re: go to next file

2002-09-12 Thread Harry Putnam
George Schlossnagle [EMAIL PROTECTED] writes: I think you need to stop programming C. :) 'last' is the token you want to use for breaking out of a loop in perl. In the script I posted `last' used in place of next, doesn't work like I wanted. It just stops the script on the first file

RE: go to next file

2002-09-12 Thread Bob Showalter
-Original Message- From: Harry Putnam [mailto:[EMAIL PROTECTED]] Sent: Wednesday, September 11, 2002 10:25 PM To: [EMAIL PROTECTED] Subject: go to next file I know its possible to force perl to read the next file but have forgotten how to do it. The simple script below

Re: go to next file

2002-09-12 Thread Harry Putnam
Dharmender Rai [EMAIL PROTECTED] writes: you are not reading the files properly. use 2 while loops. the outer for traversing the command line args while the inner for reading and checking the file contents. use break in the inner while loop when you get a blank line to go to the outer

Re: go to next file

2002-09-12 Thread Harry Putnam
ARGV;' right here. next; } } Yup, that did it and its majorly faster than using the two while loops as suggested. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: go to next file

2002-09-12 Thread david
Harry Putnam wrote: #!/usr/local/bin/perl -w $regex = shift; while(){ $cnt++; if($cnt == 1){ print $ARGV\n; } if(/$regex/){ printf %-3d %s, $cnt, $_; }elsif(/^$/){ $cnt = 0; next; } } you are feeding reg directly

Re: go to next file

2002-09-12 Thread Harry Putnam
; ## IMPORTANT (From Bob Showalter on perl beginner list ## If we don't close ARGV here we just skip to next blank line ## not next file. close(ARGV); next; } } print $tcnt\n; sub usage{ print EOM; Purpose: scan and print individual mail headers or all mail headers Usage: \`$myscript 'REGEX

Re: go to next file

2002-09-12 Thread david
Harry Putnam wrote: Excuse my skull bone density... not sure I follow this. Not sure I see how `chop' does anything to `\' [...] assume your program is named scan.pl, what happen is you call it: scan.pl '\' your script always assume user will be entering a valid reg to use. i am

Re: go to next file

2002-09-12 Thread Harry Putnam
david [EMAIL PROTECTED] writes: Harry Putnam wrote: Excuse my skull bone density... not sure I follow this. Not sure I see how `chop' does anything to `\' [...] assume your program is named scan.pl, what happen is you call it: scan.pl '\' It will wait for input since files are

Re: go to next file

2002-09-12 Thread david
Harry Putnam wrote: david [EMAIL PROTECTED] writes: Won't is still quite even with the eval, in the above case? passing it to Perl Can you give an example of this? no it doesn't. if you put it inside an eval{}, it won't quit. consider: #!/usr/bin/perl -w use strict; my $reg = shift;

Re: go to next file

2002-09-12 Thread Harry Putnam
david [EMAIL PROTECTED] writes: Harry Putnam wrote: david [EMAIL PROTECTED] writes: Won't is still quite even with the eval, in the above case? passing it to Perl Can you give an example of this? no it doesn't. if you put it inside an eval{}, it won't quit. consider:

Re: go to next file

2002-09-12 Thread david
Harry Putnam wrote: david [EMAIL PROTECTED] writes: Harry Putnam wrote: david [EMAIL PROTECTED] writes: Won't is still quite even with the eval, in the above case? passing it to Perl Can you give an example of this? no it doesn't. if you put it inside an eval{}, it won't quit.

Re: go to next file

2002-09-12 Thread Michael Fowler
On Thu, Sep 12, 2002 at 05:04:20PM -0700, Harry Putnam wrote: david [EMAIL PROTECTED] writes: I must be a real dunce, but I still don't get the point. If a bad regex is given, I want the program to stop. Your script above doesn't spit an error, it just fails and gives some other error.

go to next file

2002-09-11 Thread Harry Putnam
I know its possible to force perl to read the next file but have forgotten how to do it. The simple script below is supposed to read message files that are on disk one message per file. I want to go to the next file when the first blank line is seen. I don't see how $cnt can equal one more than

Re: go to next file

2002-09-11 Thread Dharmender Rai
PROTECTED] wrote: I know its possible to force perl to read the next file but have forgotten how to do it. The simple script below is supposed to read message files that are on disk one message per file. I want to go to the next file when the first blank line is seen. I don't see how $cnt

Re: go to next file

2002-09-11 Thread George Schlossnagle
use break in the inner while loop when you get a blank line to go to the outer while loop. I think you need to stop programming C. :) 'last' is the token you want to use for breaking out of a loop in perl. George -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands,

Re: Form.pm (next installment of code review)

2002-07-05 Thread Ovid
Hi David, While I raise quite a few issues here, I have to say that I've rarely seen anyone present a CGI.pm alternative that supports uploads. I'm quite impressed, so keep that in mind while I pick it apart :) I'll ignore anything I may have covered in my discussion about the previous

How to match next line?

2002-05-22 Thread Scot Robnett
/) # Compare this line w/next line { next; # If it matches, skip it } else { print Address = $sorted[$i] \n; } } Scot Robnett inSite Internet Solutions [EMAIL PROTECTED] [EMAIL PROTECTED] --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http

Re: How to match next line?

2002-05-22 Thread Tagore Smith
if ($sorted[$i] =~ /$j/) # Compare this line w/next line { next; # If it matches, skip it } else { print Address = $sorted[$i] \n; } } Tagore Smith -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: How to match next line?

2002-05-22 Thread Tagore Smith
BTW, one thing you might consider is that there may be duplicate email addresses that differ only in case. You might want to check for that. Tagore Smith -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: How to match next line?

2002-05-22 Thread Scot Robnett
PROTECTED] [EMAIL PROTECTED] -Original Message- From: Tagore Smith [mailto:[EMAIL PROTECTED]] Sent: Wednesday, May 22, 2002 1:16 PM To: cgi Subject: Re: How to match next line? BTW, one thing you might consider is that there may be duplicate email addresses that differ only in case. You might

Parsing formdata from one CGI script to the next.

2002-04-08 Thread Daniel Falkenberg
Hello All, Is it possible to parse form data from one CGI script to another one. What I want to do is have a user login to a page. From their I the user to select on a link then that link will take them to another CGI script. In this new CGI script I need that to contain some information of

Answer to my own question -- Re: Parsing formdata from one CGIscript to the next.

2002-04-08 Thread Daniel Falkenberg
Hey all, For any one that cares... :) I simply told the hyperlink/submit button to point to the new CGI script and parse on the data I wanted it to like so... /cgi-bin/newcgi.cgi?data=$data Very very easy! Cheers, Dan On Tue, 2002-04-09 at 10:52, Daniel Falkenberg wrote: Hello All, Is

Re: Parsing formdata from one CGI script to the next.

2002-04-08 Thread Tagore Smith
Daniel Falkenberg wrote: Hello All, Is it possible to parse form data from one CGI script to another one. What I want to do is have a user login to a page. From their I the user to select on a link then that link will take them to another CGI script. In this new CGI script I need that

what if or next if...?

2002-03-10 Thread Daniel Falkenberg
G'day all, Just wondering if some one can help me with the folloing problem...? Basically I have a variable that will change at regular intervals. The varible may look like this... $var = Crud Crud Call Distance: UNfasdfasdfasdfasdfasdn alternative. (fasdfsda) SuperZone region: Gawler Call

Re: Next 10 Results Help Needed

2001-12-07 Thread Scott R. Godin
In article [EMAIL PROTECTED], [EMAIL PROTECTED] (Randal L. Schwartz) wrote: One of my very first WT columns... http://www.stonehenge.com/merlyn/WebTechniques/col02.html .. too bad I've already written my *last* WT column, to appear in Feb 2002, because the magazine is terminating. :(

Re: next step

2001-12-07 Thread Jenda Krynicky
From: [EMAIL PROTECTED] This is a question for Perl programmers in the field. I would like to hear your advice in my next step. I work presently in a DOS - windows environment. I program Perl in DOS. It is pretty straight Perl scripts. Besides some DBI, and a sprinkle

Next 10 Results Help Needed

2001-12-06 Thread Darryl Schnell
I am working on a program that will read the password file and display a list of users that match the gid's 670 671 on an html page. I have that part worked out, however now I want to have the results display in groups of ten allowing the user to click on next results to see the next results

Next 10 Results Help Needed

2001-12-06 Thread Darryl Schnell
I am working on a program that will read the password file and display a list of users that match the gid's 670 671 on an html page. I have that part worked out, however now I want to have the results display in groups of ten allowing the user to click on next results to see the next results

Getting next Monday...

2001-12-06 Thread Shinagare, Sandeep
Hi All, I am trying to find the date, month and year of the next Monday given any day. I am using this to get todays date/day/month etc. Is there a way to use this information to get the next Monday? #snip-start $thisday=(Sun,Mon,Tue,Wed,Thu,Fri,Sat)[(localtime)[6]]; $thisdate=(localtime)[3

RE: Getting next Monday...

2001-12-06 Thread Wagner-David
By using day of the week out of locatime, you should be able to determine how many days you need to add to get to Monday. Example: Thu is 4 and Mon is 1. So if always looking for the next Monday, then you can do something like: my ($sec,$min,$hour,$mday,$mon,$year,$wday

Re: Getting next Monday...

2001-12-06 Thread Peter Scott
At 05:06 PM 12/6/01 +, Shinagare, Sandeep wrote: Hi All, I am trying to find the date, month and year of the next Monday given any day. I am using this to get todays date/day/month etc. Is there a way to use this information to get the next Monday? #snip-start $thisday=(Sun,Mon,Tue,Wed

Re: Getting next Monday...

2001-12-06 Thread John W. Krahn
Sandeep Shinagare wrote: Hi All, I am trying to find the date, month and year of the next Monday given any day. I am using this to get todays date/day/month etc. Is there a way to use this information to get the next Monday? #snip-start $thisday=(Sun,Mon,Tue,Wed,Thu,Fri,Sat

next step

2001-12-06 Thread Murzc
This is a question for Perl programmers in the field. I would like to hear your advice in my next step. I work presently in a DOS - windows environment. I program Perl in DOS. It is pretty straight Perl scripts. Besides some DBI, and a sprinkle of CGI, it's mainly straight Perl. I learnt

Newbie: Move to next entry

2001-11-29 Thread Mark Smith
Hi all I am try to get my first guestbook to work. I have got it writing to a file, and retrieving,..but only the first entry in the logfile. I have delimited the fields in the logfile by ,..and delimited the last field for each entry with a *. How do I get it to move to the next entry

RE:How to print and go to the next line

2001-11-27 Thread Jorge Goncalvez
Hi, I have this: print NOUVEAU $newline2\n or die je ne peux écrire dans $nouveau : $!\n; But it prints but didn't go to the next line(\n seems to be ignored) Why? Thanks. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: How to print and go to the next line

2001-11-27 Thread John W. Krahn
Jorge Goncalvez wrote: Hi, I have this: print NOUVEAU $newline2\n or die je ne peux écrire dans $nouveau : $!\n; But it prints but didn't go to the next line(\n seems to be ignored) Why? The newline needs to be in quotes to be interpolated print NOUVEAU $newline2\n or die je ne peux

Re: Same date next month?

2001-09-30 Thread Rajeev Rumale
Rajeev. - Original Message - From: Bill Jones [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Sunday, September 30, 2001 5:45 AM Subject: Re: Same date next month? On 9/29/01 4:04 PM, wrote: I have couple of ideas - if the date is a date that isn't in the next month, just

from one problem to the next emumail...

2001-06-26 Thread KeN ClarK
SO I am closer to webmail. http://www.quantifier.org/emu/ will forward to the cgi script the way the index.html page tells it to. ALL of the directories are recursively set up in apache. Why does it serve the script itself like text? Do I need to define the type in the second line of the script?

Re: from one problem to the next emumail...

2001-06-26 Thread Ondrej Par
Just guessing: you need to say Apache that it's the cgi script. It's done like this on my machine: ScriptAlias /cgi-bin/ "/usr/apache/cgi-bin/" On Tuesday 26 June 2001 02:16, you wrote: SO I am closer to webmail. http://www.quantifier.org/emu/ will forward to the cgi script the way the

reading the next line from a file

2001-06-13 Thread Esrar Chowdhury
on the same line or automatically go the next line?) Thanks in advance. -- Esrar Esrar Chowdhury CCS Internet 13740 Research Blvd Suite #O-4 Austin, TX 78750 Phone: 512-257-2274

Re: reading the next line from a file

2001-06-13 Thread Dave Cross
the read pointer read every 10th line from my input file? (After reading one line, does the read pointer stay on the same line or automatically go the next line?) It's probably easiest to read every line, but only process every 10th one. Something like this should do it: while (INFILE) { next

Beginner? Please provide input into design of next version of perl (perl6).

2001-05-12 Thread Me
This is just my survey of one small but (imo) important aspect of perl 6. It will take about two minutes and six mouse clicks to do it. I will collate all answers and report to the people who are designing Perl 6 (including Larry Wall of course).

<    1   2