Conversion Problem

hi,
i am reading a string values from a file.the values are

2000
20000
300
10
5000

now retrieving each value one by one and printing if they are greater than 1000.

i use this statement for the same (in perl script)

if ($_ gt 1000){
print $_
}

but its now prininting all the values.

are the strings form files trated as characters?if so how can convert them to number?any type cast operator?or am i doin anything else wrong?

Thnaks and Regards
Vivek.S

hi i used
if ($e > 20000) and is working

i guess > is fr number comparison and ge , le are all from string...am i right?

ANOTHER QUESTION:

if i use

split(\ \) then it assign it to a and b.

suppose if i want splitting to start from last word what shall i do?

Thanks and Regards
vivek.S

Are you using perl with the -w switch? That gives a lot of useful information.
I suggest you get the book either "Learning Perl" or "Programming Perl."

Also, If you have a completely different question and have searched and read available documentation and still don't understand, post a new thread.

Thanks :slight_smile:

can u tell me the author of the books.......so that i cud get one...

thanks and regards
vivek.s