beginAgain has asked for the wisdom of the Perl Monks concerning the following question:
I have tried (sad attempts):opendir IN, $dirname; my @in = grep { /^[^.]/ } readdir IN; closedir IN; for my $in (@in) { open IN, '<', "$dirname/$in" || next; open OUT, '>', "$outdirname/$in" || die "can't open file output/$in" +; foreach(<IN>) { #read file line by line # Strings to correct Note: Escaped ( with \ s/rotate\(-180/rotate\(-0/g; # Look at the current line my @look_in = <IN>; # <path is in this line, process line if( $target ~~ @look_in) { for my $key (keys %stroke_width_hash) { s/$key/$stroke_width_hash{$key}/g; } } # Print out line to OUT file print OUT $_; } close OUT; close IN; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Grab Current Line of SVG File
by SuicideJunkie (Vicar) on Apr 17, 2019 at 15:14 UTC | |
by beginAgain (Novice) on Apr 17, 2019 at 16:14 UTC | |
by beginAgain (Novice) on Apr 17, 2019 at 15:24 UTC | |
|
Re: Grab Current Line of SVG File
by tangent (Parson) on Apr 17, 2019 at 15:58 UTC | |
by beginAgain (Novice) on Apr 17, 2019 at 16:26 UTC | |
|
Re: Grab Current Line of SVG File
by haukex (Archbishop) on Apr 17, 2019 at 21:23 UTC | |
|
Re: Grab Current Line of SVG File
by Anonymous Monk on Apr 18, 2019 at 08:12 UTC | |
|
Re: Grab Current Line of SVG File
by dinesh_1308 (Initiate) on Apr 20, 2019 at 17:26 UTC |