I am dividing a number by 2. How do I force a round up of the result?
Glenn.
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.
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
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
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
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?
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]
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
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
>
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]
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
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]
12 matches
Mail list logo