On 17/12/03 08:01 +0000, swanand pathak wrote:
> Hi!
> 
> This should  solve the problem.
> Save following lines as some_name.pl
If we are scripting.

> Also mention file name in the file as mentioned.
> 
> #!/usr/bin/perl
No -w?

> 
> open(vp,"myfile");
Wheres the die?

#!/usr/bin/perl -w
use strict;

my $file = "/path/to/users/file";
open(ADDRBK, "<", $file) or die "Failed to open $file: $!";

while (<ADDRBK>) {
        my @names = split(/\s+/, $_);
        foreach my $name (@names) {
                print "$name " if $name !~ /\@/;
        }
        print "\n";
}

<eot, going from a one liner to a whole script>
Devdas Bhagat

-- 
http://mm.ilug-bom.org.in/mailman/listinfo/linuxers

Reply via email to