Conversion of bash parsing script to perl?

I need help with a perl parsing script. I have some error logs on a windows machine that I need to parse from a text file, but I know nothing about perl. I usually run this bash script on my linux box and it does just what I need. How would I do the same thing with perl and port it to my windows machine. Thanks.

#!/bin/bash

grep ERROR $1 | cut -d" " -f2- | sort | uniq -c

Try something like this:

#!/usr/bin/perl

open FILE, "<" . $ARGV[0];
@arr = ();
while (chomp($line = <FILE>)) {
	if ($line =~ /ERROR/) {
		@fields = split(/ /, $line);
		shift @fields;
		$key =  join(' ', @fields);
		push @arr,  $key;
		$count{$key}++;
	}
}

cbkihong,

Thanks for your help. Your script does exactly what I needed.