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

my $dict = 'pos.txt';
my $c = 0;

open DICT, '<', $dict
  or die "Cannot open '$dict': $!";

while (<DICT>) {

          my $string = $_;
          my $char = '@';
          my $offset = 0;
          my $result = index($string, $char, $offset);

          $c++;

          while ($result != -1) {
                  print "$c-$result" .", ";
                  $offset = $result + 1;
                  $result = index($string, $char, $offset);
          }
}
print "\n";
close DICT or warn;
