I'm trying to make a perl subroutine similar to this php function.

```
private function writeOutput($msg, $type) {
                  echo date("H\:i\:s") . " - [$type] .  > $msg\n";
          }

```

I need a little help defining `$msg` and `$type`.

```
sub WriteOutput {
    $sec = sprintf ("%02d", $sum%60);
    $mins = sprintf("%02d", ($sum%3600)/60);
    $hrs = int($sum/3600);
    print "[$hrs:$mins:$sec]:[$type]>: $msg";
}

```