Thank you a lot Luke, it worked.

Now there's something else, how do I tell perl to open a file where the 
/path/to/dir contained with $line? 

such as :

    open OUT, ">/path/to/$line/dir/.qmail-$line" or die "$!";
 

regards,
gregor 


listperl writes: 

> Hey Gregor, 
> 
> I use something similar on my box (I use qmail too). This should do what you
> want it to. 
> 
> #!/usr/bin/perl -w
> use strict; 
> 
> my @users = qw/ donna maria karina /;
> foreach my $line (@user){
>     open OUT, ">/path/to/dir/.qmail-$line" or die "$!";
>     print OUT "|/usr/local/blah ./$line/maildir/filter";
>     close OUT or die "$!";
> } 
> 
> Regards,
> Luke Davison 
> 
> 
> ----- Original Message -----
> From: "GREGOR" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Wednesday, March 20, 2002 9:55 PM
> Subject: creating file name from array 
> 
> 
>> hi guys, 
>>
>> I'm very new to perl. 
>>
>> Ok, let's assume that I have a file named *user.txt* contained with my
> user
>> name : 
>>
>> donna
>> maria
>> karina
>> ..
>> ..
>> ..
>> etc 
>>
>> I want to make a file for each of them. The file name and the content
> should
>> contained with their names, eg. .qmail-donna, .qmail-maria and
>> ..qmail-karina. 
>>
>> so far, here's my code : (which isn't working) 
>>
>> #!/usr/bin/perl 
>>
>> $file="user.txt";
>> open FILE,$file;
>> @user=<FILE>;
>> close FILE; 
>>
>> foreach $lines (@user){
>>     system "echo |/usr/local/blah ./$lines/maildir/filter >
> ..qmail-$lines";
>> } 
>>
>> please help me to make the right code. thank you. 
>>
>> regards,
>> Gregor 
>>
>>

WATCHOUT! 3RD INTERNATIONAL SEMINAR ON SUSTAINABLE ENVIRONTMENTAL 
ARCHITECTURE + DIGITAL ARCHITECTURE, 9-10 MARCH 2002, YOGYAKARTA
http://senvar.virtue.nu or http://senvar.uajy.web.id
NATIONAL DESIGN COMPETITION
http://senvar.uajy.web.id/lombadesain

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to