Skip to content

Instantly share code, notes, and snippets.

@oneman
Forked from dsheeler/px2em.pl
Last active December 20, 2015 14:09
Show Gist options
  • Save oneman/6144565 to your computer and use it in GitHub Desktop.
Save oneman/6144565 to your computer and use it in GitHub Desktop.
#! /usr/bin/perl
while (<>) {
while (/([-.\d]+)(\s*)em/) {
$rel = $1 * 16;
$val = $1;
$s = $2;
s/$val\s*em/${rel}%/;
}
print;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment