sivasakthi wrote:
On Tue, 2008-02-05 at 14:40 -0500, obdulio santana wrote:
May be this helps
perl -lne "print if ++$D{$_} == 1" address.txt
I have tried the above command , but it shows the following error,
Can't modify single ref constructor in preincrement (++) at -e line 1,
near "} =="
Execution of -e aborted due to compilation errors.
Using double quotes means that the shell will interpolate the line first
before perl gets it so you have to use single quotes instead.
perl -lne 'print if ++$D{$_} == 1' address.txt
John
--
Perl isn't a toolbox, but a small machine shop where you
can special-order certain sorts of tools at low cost and
in short order. -- Larry Wall
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/