Click to See Complete Forum and Search --> : New with perl


my_junk
10-16-2005, 04:32 AM
Hi,

I got a script that gives me some vars in an form. i want to divide the resault by 1024 so i will get it in gigs.
How do i devide in perl ?

here are the strings which holds the variables:
||kimap_size|| == size used
||kimap_disk_quota|| == size available


best regards,
Michael

Ultimater
10-16-2005, 05:13 AM
kimap_size /= 1024;
kimap_disk_quota /= 1024;


Note you also can do:

kimap_size = kimap_size / 1024;
kimap_disk_quota = kimap_disk_quota / 1024;


However, if there are any non-numeric characters in the string, you will need to filter them out with a regular expression first.

my_junk
10-16-2005, 05:31 AM
thanks