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

2003-01-11 Thread Randal L. Schwartz
> "John" == John W Krahn <[EMAIL PROTECTED]> writes: John> From the foreach loop it looks like you want to remove the last John> occurrence of $del_name from @pro_list. You could also do it like this: John> foreach ( reverse 0 .. $#pro_list ) { John> if ( $pro_list[$_] eq $del_name ) { J

Re: tail + count

2003-01-11 Thread Rob Dixon
Hi John "John W. Krahn" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > > @ARGV == 2 and my $n = pop || 10; > $n will be undefined if @ARGV != 2. Need something like: $n = @ARGV == 2 ? pop : 10; Rob -- To unsubscribe, e-mail: [EMAIL PROTECTED] For ad

Re: tail + count

2003-01-11 Thread John W. Krahn
Mrtlc wrote: > > I wrote the following script as a windows tail + count function, > but it's too slow if the input is huge, how can it be improved? > > if (!$ARGV[0]){ > die("you've forgotten to enter the file name\n"); > } > if (!$ARGV[1]) { > $n = 9; # output 10 rows by defaul

Re: build an array from a pattern match?

2003-01-11 Thread John W. Krahn
Rob Dixon wrote: > > "Michael Kelly" <[EMAIL PROTECTED]> wrote in message > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > > > # print out all the captured numbers > > map{ print "$_\n"; } @numbers; > > Hi Michael. > > May I warn against using 'map' in a void context like this? It'll work, > su

Re: error Bad file descriptor

2003-01-11 Thread Rob Dixon
Hi Michael I suggest you find out which call is producing your error; that will help you, and help us to help you. Do it either by running under the debugger or by adding print statements. If you're doing the latter it's best to enable autoflush with $| = 1; Cheers, Rob "Michael Kramer" <

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

2003-01-11 Thread John W. Krahn
Ebaad Ahmed wrote: > > Just used the following code to delete a specific value from an array, populated > from text read from file. Please let me know if i can be of any help. > sub doDeleteProvider { > my $cgi = shift; > my $counter = 0; > my $index; > my $del_name = $cgi->param("names"); >

Re: Formfeed in html (perl/cgi)

2003-01-11 Thread Tim Musson
Hey dhoubrechts, My MUA believes you used Mozilla 4.75 [fr] (X11; U; Linux 2.2.17-21mdk i686) to write the following on Friday, January 10, 2003 at 6:00:31 PM. d> Can I put a formfeed in a perl cgi ? I've tried print "\f" or d> something like but I can't force a new page. Can someone hel

Re: ftp: error Bad file descriptor

2003-01-11 Thread Wiggins d'Anconia
What does $file and $rename contain? http://danconia.org michael kramer wrote: For some reason when I use NET:FTP's get. I will get an error of "Bad file descriptor". What does this mean. Here is my code. use Net::FTP; $ftp = Net::FTP ->new("$ip_address", Timeout =>

Re: Epoch midnight

2003-01-11 Thread Karl Kaufman
Deborah, I'll second Todd W's response, and warn you to avoid solutions doing direct math on the result of time(), as they disregard the effects of Daylight Saving Time and calendar adjustments since the epoch. Also, you can get the other midnight bookend for today, using Todd's method, though an

Re: possible improvement(s)

2003-01-11 Thread Randal L. Schwartz
> "Mik" == Mik Rudich <[EMAIL PROTECTED]> writes: Mik> There are people on this list who Mik> kindly share their knowledge Mik> with others, like myself, to help Mik> us better understanding perl fundamentals. Mik> But there are also people who misuse that Mik> kindness to gain, I think, comm

Re: menu

2003-01-11 Thread Rob Dixon
Hi Dylan "Dylan Boudreau" <[EMAIL PROTECTED]> wrote in message 004c01c2b8cd$0920dbb0$0400a8c0@dylan">news:004c01c2b8cd$0920dbb0$0400a8c0@dylan... > 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'){ >

Re: possible improvement(s)

2003-01-11 Thread Slobodan Jaksic
- Original Message - From: "Randal L. Schwartz" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Saturday, January 11, 2003 5:02 PM Subject: Re: possible improvement(s) > > "Mik" == Mik Rudich <[EMAIL PROTECTED]> writes: > > Mik> There are people on this list who > Mik> kindly share

Re[2]: possible improvement(s)

2003-01-11 Thread Yacketta, Ronald
Hello Mik, MR> Hi MR> There are people on this list who MR> kindly share their knowledge MR> with others, like myself, to help MR> us better understanding perl fundamentals. MR> But there are also people who misuse that MR> kindness to gain, I think, commercial advantage. MR> Regards MR> Mik

Re: Sessions un CGI and Client's OS

2003-01-11 Thread Rob Dixon
"Wiggins D'Anconia" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > aman raheja wrote: > > Anyhow, I am looking for following solutions > > 1. How do we know the Operating System of the Client's system? > > You can't reliably The system under which Perl was bui

Re: using an AND operator

2003-01-11 Thread Mark Goland
perldoc perlop, for all operators you need Mark - Original Message - From: "Susan Aurand" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Saturday, January 11, 2003 9:48 AM Subject: using an AND operator > > Is there an AND operator in perl? For example; > > if

Re: Epoch midnight

2003-01-11 Thread R. Joseph Newton
Hi Rob, You missed a digit, I'm afraid--that should be 86400. Joseph ... my $epoch_today = time / 8400; #should be 86400 -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Sessions un CGI and Client's OS

2003-01-11 Thread Wiggins d'Anconia
aman raheja wrote: Hello I am using Perl/CGI on Linux (with Apache). Nice choices. 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

Re: build an array from a pattern match?

2003-01-11 Thread Rob Dixon
"Michael Kelly" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > # print out all the captured numbers > map{ print "$_\n"; } @numbers; Hi Michael. May I warn against using 'map' in a void context like this? It'll work, sure, but you're using it for the side-ef

using an AND operator

2003-01-11 Thread Susan Aurand
Is there an AND operator in perl? For example; if ($SRF=1 and $SRL=1) {print"YES";) Any help would be appreciated. Thank you - Susan -- 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-11 Thread Rob Dixon
"Alan C." <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Rob Dixon wrote: > > > > my $last = undef; > > > > while (<>) > > { > > next unless defined $last; > > chomp $last unless /^\./; > > print $last; > > } continue { >

Re: Epoch midnight

2003-01-11 Thread Rob Dixon
"Deborah Scott" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > 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

ppm: No suitable installation target for package G

2003-01-11 Thread David Eason
What does the error "No suitable installation target for package ..." mean? I am using ppm 3.0.1 from perl 5.8.0 build 802. ppm> describe G Name: G Version: 4.1 Author: Jan Krynicky ([EMAIL PROTECTED]) Title: G Abstract: Command line globing for Win32 systems Locatio

tail + count

2003-01-11 Thread Mrtlc
I wrote the following script as a windows tail + count function, but it's too slow if the input is huge, how can it be improved? if (!$ARGV[0]){ die("you've forgotten to enter the file name\n"); } if (!$ARGV[1]) { $n = 9; # output 10 rows by default } else { $n = $ARG

Re: Best way to return largest of 3 Vars?

2003-01-11 Thread David Storrs
On Fri, Jan 10, 2003 at 10:23:43AM -0600, Jensen Kenneth B SrA AFPC/DPDMPQ wrote: > In the line > my $max = (sort {$b<=>$a} ($x, $y, $z))[0]; > > What is the "[0]" doing? This part: (sort {$b<=>$a} ($x, $y, $z)) creates a list. The "[0]" returns the first element in that list. > Also an

Re: build an array from a pattern match?

2003-01-11 Thread Michael Kelly
On Fri, Jan 10, 2003 at 10:22:37PM -0500, David Nicely wrote: > Hello, Hi David, > 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 w

Administration errors

2003-01-11 Thread Marie Carianna
Can someone point me in the right direction? I am running my first FormMail.pl and have checked the syntax - all looks okay. The problem is I'm getting two types of errors - the first just gives "Administrative Error" when the submit button is clicked. The other says: > Error: GET request > The

Sessions un CGI and Client's OS

2003-01-11 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: Removing a specific value from a hash whose keys contains multiple values

2003-01-11 Thread Ebaad Ahmed
Just used the following code to delete a specific value from an array, populated from text read from file. Please let me know if i can be of any help. sub doDeleteProvider { my $cgi = shift; my $counter = 0; my $index; my $del_name = $cgi->param("names"); my $TITLE = "Nighthawk Database"; fo