From 750e301f6a81622d7eb79283a4e59e2202b245d0 Mon Sep 17 00:00:00 2001 From: Matija Nalis Date: Mon, 23 Jun 2014 16:04:59 +0200 Subject: [PATCH] skip empty lines/comments --- gp2_to_bin.pl | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/gp2_to_bin.pl b/gp2_to_bin.pl index cac3e1b..ae876cd 100755 --- a/gp2_to_bin.pl +++ b/gp2_to_bin.pl @@ -8,7 +8,10 @@ while (<>) { - s/^.*\(0\) //; # remote timestamps etc - s/\s+//g; # no whitespace allowd for pack + next if /^\s*$/; # skip empty lines + next if /^\s*#/; # skip comment lines + s/^.*\(0\) //; # remove timestamps etc + s/#.*$//; # remove comments at the end of line + s/\s+//g; # no whitespace allowd for pack print pack "H*", $_; }