>>> "Edward WIJAYA" <[EMAIL PROTECTED]> 02/12/2004 10:02:05 am >>>
>Can anybody suggest the case
>where we *only* need '-ne' ?

I use the -ne quite a bit.  Off the top of my head, here's a cheesy
version of (unix) grep's -n option to print line numbers:

perl -ne 'print "$. $_" if m/some pattern/' my_file.txt

Or, say I want to rip through a file that is just a plaintext table of
info with a column I want to sum:

perl -ne '$total+=(split)[columnnumber];END{print $total}' my_file.txt

Hope this helps,

Jeff Eggen
IT Programmer Analyst
Saskatchewan Government Insurance
Ph (306) 751-1795
email [EMAIL PROTECTED]
************DISCLAIMER*************
This e-mail and any files transmitted with it are confidential and intended 
solely for the use of the individual or entity to whom they are addressed.  If 
you are not the named addressee, please notify the sender immediately by e-mail 
if you have received this e-mail by mistake and delete this e-mail from your 
system. If you are not the intended recipient you are notified that using, 
disclosing, copying or distributing the contents of this information is 
strictly prohibited.
************DISCLAIMER*************

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to