perl how to change from string to a number

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading...

Below you can asee a subrutine that will cause perl to undrtsnad this as numbers

foreach (@full_cpu_data) {
        $_ =~ s/K//;
        @cpu_data = split(':', $_);

        @cpu_data  = map { $_ += 0 } @cpu_data;   

        push @cpu_plot, { cpu => @cpu_data[3], core => @uptime[6], disk => @disk[4] };
        $i++;
}

 

Leave a Reply

avatar
  Subscribe  
Notify of