Rounding numbers

2002-04-17 Thread Glenn Cannon
I am dividing a number by 2. How do I force a round up of the result? Glenn.

Counting pairs in a hash.

2002-04-16 Thread Glenn Cannon
All, What is the simplest way to find out how many pairs I have in a hash? I am putting a variable number in when reading data from a file, and I then need to split the file in half for display. Thx, Glenn.

Problem testing variable

2002-04-05 Thread Glenn Cannon
open (RSTDATA, "rst/r".$event.".rst")|| print "Oops"; $winner = ; if ($winner eq "na") { print "FinalistsDid Not Play"; } else { print $winner; } Why does the above code always print the value of $winner, and never FinalistsDid Not Play, even when the line of text in the file is just the letters

Strip Carriage Returns

2002-04-04 Thread Glenn Cannon
Not strictly a perl question, I know, but... I have been writing and testing my perl script on a WinXP box, and I have now moved it to its final home on a linux box. When I run perl -c scriptname, I get the following: Illegal character \015 (carriage return) at index.pl line 2. (Maybe you did

RE: Reading lines from a file

2002-04-03 Thread Glenn Cannon
into the correct part of the HTML. -Original Message- From: Mark Anderson [mailto:[EMAIL PROTECTED]] Sent: Wednesday, April 03, 2002 4:22 PM To: Glenn Cannon; [EMAIL PROTECTED] Subject: RE: Reading lines from a file Specific by line number? specific by text in the line? specific as line

Reading lines from a file

2002-04-03 Thread Glenn Cannon
How do I read a specific line from a text file? I know how to open and close the file, and how to read the entire file, is there a way (maybe by setting $.) to read a specific line of the file?

2 questions

2002-04-02 Thread Glenn Cannon
Hi all, Couple of questions from a newbie... 1) How can I print the current directory name? 2) How can I check to see if a file I know the name of exists? Thx, Glenn -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Calendar Script

2001-11-21 Thread Glenn Cannon
All, I am writing a calendar display program. Each day is held as a separate file, within a directory for the month. If nothing is happening that day, then there is no file. How do I go about checking to see if a file exists before attempting to open it for reading? Glenn Cannon [EMAIL

RE: Day of the month

2001-11-15 Thread Glenn Cannon
Thx japhy, Does exactly what I need it to. Now all I need is a way to work out the last day of the month. Most of them should be easy, but that damn February... Glenn Cannon [EMAIL PROTECTED] Level II Certified DCI Judge 'There is no spoon.' www.eventsbeyondbelief.com >

Day of the month

2001-11-15 Thread Glenn Cannon
Given the month and the year, how can I derive what day the first landed on? Glenn Cannon [EMAIL PROTECTED] Level II Certified DCI Judge 'There is no spoon.' www.eventsbeyondbelief.com -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Better way

2001-11-08 Thread Glenn Cannon
I know there is a better way to do this. Anyone care to clue me in? # Code On open firsts, firsts; foreach $firstsdata () { ($firstsmonth, $firstsday) = split(/x/, $firstsdata); if ($firstsmonth eq $month) { $day = $firstsday } } # Code Off Glenn Cannon [EMAIL PROTECTED] Level II Certified

Problem with IF statement

2001-11-08 Thread Glenn Cannon
w[5] % 100 } #Code Off Glenn Cannon [EMAIL PROTECTED] Level II Certified DCI Judge 'There is no spoon.' www.eventsbeyondbelief.com -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]