#!/usr/bin/perl -wp -00 use Getopt::Std; use strict; use vars qw(%opts); BEGIN { %opts = ( y => 6, ); getopts('y:', \%opts); } my ($g_id, $p_opts) = m#.*#s; next unless $p_opts; s#.*?)#sg; my ($collect) = ""; my $dy = - int($#lines/2) * $opts{y} - 1; foreach (@lines) { # http://stackoverflow.com/questions/5185699/multiple-lines-of-curved-text-in-svg my ($t_opts, $t_str) = m#(.*?)#; $t_opts =~ s# x=".*?"##; $t_opts =~ s# y=".*?"##; $collect .= qq($t_str\n); $dy += $opts{y}; } s#(.*?\s*)+#$collect#;