New to cig question

R

Ron

Having problem with this code.
First line works
3rd line works
2nd line I never get a greater than answer even when it's true.

my $size_file = (-s $FILE1)/1024;
if (($size_file > 0)) {
my $YourFiles1 = 'File1: ' . $filename1 . ' ' . $size_file . ' KB';
}

Could anyone let me know what I am doing wrong?

Thanks,
Ron
 
R

Ron

Hi Eric,

I have printed out both
my $size_file = (-s $FILE1)/1024;
is value is 43

I have printed out
my $YourFiles1 = 'File1: ' . $filename1 . ' ' . $size_file . ' KB';
'File1' is just a label
$filename1 is a file name&extension

Thanks,
Ron
 
E

Eric Schwartz

Because it's hard to understand.

Why don't people like top-posting?

Ron said:
I have printed out both
my $size_file = (-s $FILE1)/1024;
is value is 43

If so, then the statment

if($size_file > 0) {
#do something
}

would execute. I promise you, Perl is not capricious-- if the
variable is > 0 at that point, then the contents of the if() statement
will execute. It seems to me that what we're seeing, and what your
code actually looks like, is not the same thing.

I would recommend you try to distill this particular problem to a very
small program (10-15 lines should be plenty), and post that program
here, along with what it outputs for you, and what it should output.

Very often, the simple exercise of trying to reduce the trouble to its
smallest essence is all that's required to find your problem.

And again, please don't top-post; it's rude, and difficult to read.
Intersperse your replies with the material you're replying to, as most
other posters here do. Also, please trim the post you're quoting so
that you're only replying to the most significant bits.

http://www.html-faq.com/etiquette/?toppost

-=Eric
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top