Showing posts with label perl. Show all posts
Showing posts with label perl. Show all posts

Monday, April 2, 2007

Using abbrevation in VIM

Here is a vim tip:

use abbreviate to something you type very frequently

:abb perl #!/usr/local/bin/perl

Now in insert mode as soon as you press space after typing perl, the #!/usr/local/bin/perl will be typed automatically for you.

if you don't want it to type, type something like "perls ", and then go back and remove the "s"!

Put this in your .exrc file for convenience

Saturday, March 24, 2007

Using perl's File::Find

Perl's File::Find module


What does it do? What I understood

Use the find OR finddepth methods after "use"ing File::File;

find (\&wanted, '/path/name/');

This goes to all the directories in the "/path/name/" find all the files. In the subroutine select the required file.

for example
find (wanted=>sub{print $_;} '/path/name');
would print all files in /path/name/