Come for the quick hacks, stay for the epiphanies. | |
PerlMonks |
Re^2: Inserting domain name into Snort ruleby miniperl (Initiate) |
on Oct 05, 2012 at 14:01 UTC ( [id://997481]=note: print w/replies, xml ) | Need Help?? |
Im probably doing something wrong but I pulled out the join statement and plugged it in to a while loop to read the csv file and all I get are a bunch of |00|. #!/usr/bin/perl $work = "/var/tmp/work"; $input = "$work/domainlist.csv"; open (IN,"$input"); open (OUT,">domainlist.rules"); while (<IN>) { chomp(); $domain = $_; print join '|', '', ( map { sprintf('%02d',length $domain), $domain } split /\./, shift ), '00', ''; }
In Section
Seekers of Perl Wisdom
|
|