Morgan,

You will have to refer the manpages for these functions
1) split (perldoc -f split)
2) open (perldoc -f open)
3) chomp (perldoc -f chomp)

The way to do this would be
1) Read in every line of the text file and chomp of the newline
2) Split the line such that you end up an array like this
      index 0 : username
                 1 : ||
                 2 : password
                 3 : user.xxxx
                 4 : domainX.com
     To achieve this you will have to refer to the split manpages about how to use a 
character class
      to split a string since the split must happen on either a \s+ or '@'.
      If you are not aware of character classes read up about them
      in the perlre man pages (perldoc perlre)
3) After this all you need to do is open the file with the
      entry in the 4'th index of the above mentioned array and write
      the username (index 0) and mail address using indexes 3 and 4.

HTH,
Sudarsan

Morgan Norell wrote:

> Hi
>
> I need help with this:
>
> I have a text file looking like this
>
> username || password            [EMAIL PROTECTED]
> username || password            [EMAIL PROTECTED]
> username || password            [EMAIL PROTECTED]
> ....
>
> I need a perl program who makes a file of each domainX.com in a
> separate directory and the program will also
> write every username and mailaddess to the file with the same name.
> The files should have this format.
>
> username        [EMAIL PROTECTED]
> username        [EMAIL PROTECTED]
>
> Can anyone give me some hints how to do this I'am totaly lost.
>
> Morgan.
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]


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

Reply via email to