HEX
Server: Apache
System: Linux b:u:newjapaneti:1 3.10.0-1160.31.1.el7.x86_64 #1 SMP Thu Jun 10 13:32:12 UTC 2021 x86_64
User: newjapaneti (381717)
PHP: 5.6.30
Disabled: apache_get_modules, apache_get_version, apache_reset_timeout, apache_getenv, apache_note, apache_setenv
Upload Files
File: /var/www/html/newjapanetiquetas.com.br/web/docs/vendor/rickshaw/tutorial/transform.pl
#!/usr/bin/env perl

use warnings;
use strict;

my @header;
my $data;

while (<>) {

	# the third line is the header
	if ($. == 3) {
		          # and we want the years
		@header = map { m/^(\d{4})/; $1; }
	              (split ',')[1..11];
	}

	if (m/^United States/) {
		my $i = -1;
		$data = "[ " . join(", ", map { "{ x: $header[++$i], y: $_ }" } (split ',')[1..11]) . " ]";
		last;
	}
}

print $data;