#!/path/to/perl # (usually, on *nix, the path is /usr/bin/perl) while (<>) { s/^\[//; # note that the "[" and s/\]$//; # the "]" need to be preceded by backslash print; }