470,849 Members | 720 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,849 developers. It's quick & easy.

Inserting Line Number.

Inserting Line Number

--------------------------------------------------------------------------------

I would like to insert line numbers for all the files in a directory.
So if a directory contains files like foo.c, foo.c1, foo.c2, foo.c3,
foo.c4, I am trying to see and choose one of the numbers to process
it.

1. foo.c1

2. foo.c2

3. foo.c3

4. foo.c4

Can I use __LINE__ or $. to do that or am I wrong?

Any suggestions or ideas would be appreciated.

Thanks

Raghu
Jul 19 '05 #1
1 2172
rm*******@hotmail.com wrote:
I would like to insert line numbers for all the files in a
directory.
<snip>
Can I use __LINE__ or $. to do that


__LINE__ refers to your program, so it seems not very useful. $. is
certainly a better shot.

Note that this group is defunct and replaced by comp.lang.perl.misc.

--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl

Jul 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Marko Poutiainen | last post: by
4 posts views Thread by Zenon | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.