On Tue, 2005-02-01 at 16:33, Ing. Branislav Gerzo wrote:
> Mariano Cunietti [MC], on Tuesday, February 01, 2005 at 16:19 (+0100)
> typed:
> 
> MC> I was wondering if there is anybody who can show me the *correct* way to
> MC> use a fast pattern-search-and-assign.
> MC> I mean: I am extracting viertual aliases from a postfix config file:
> 
> 1. you did not change subject
> 2. if you even did, it is bad posting, if you reply to something and
>    change subject (bad references)
> 3. always make new message and fill TO field with beginners@perl.org

sorry, put the Lame on me...I missed to change the subject while
creating a new post

> MC> # cannot use 'split' function, some statements in the second field may
> MC> contain whitespaces (e.g. ERROR "blah blah")
> MC> my ($virtual, $address) = ($_ =~ /^([^\s]+) (.*)$/);
> 
> I am not on UNIX, but I should help you, if you send some example
> data (always do that).

here are some example data:

[EMAIL PROTECTED]           mbiondi
[EMAIL PROTECTED]          salesenter
[EMAIL PROTECTED]         cbersa
[EMAIL PROTECTED]  aluffstampa
[EMAIL PROTECTED] contab1
[EMAIL PROTECTED]        sales
[EMAIL PROTECTED]     sonia
[EMAIL PROTECTED]    aliasupersonale
[EMAIL PROTECTED]     noautostaff
[EMAIL PROTECTED]      aliasecurity
[EMAIL PROTECTED]          fgiannil
[EMAIL PROTECTED]               fgiannil
[EMAIL PROTECTED]         renea
[EMAIL PROTECTED]    sergio
[EMAIL PROTECTED]        vpiazza
[EMAIL PROTECTED]       alazzara
@consulting.it        euconsulting

It seems something goes wrong with the regexp, assigning the whole $_ to
first variable

> -- 
> 
>  ...m8s, cu l8r, Brano.
> 
> ["Two wrongs do not make a right; it usually takes three or more."
> L.Long]
-- 
-----------------------------
Mariano Cunietti
System Administrator
Enter S.r.l.
Via  Stefanardo da Vimercate, 28
20128 - Milano - Italy
Tel.  +39 02 25514319
Fax   +39 02 25514303
[EMAIL PROTECTED]
www.enter.it - www.enterpoint.it
-----------------------------
Gruppo Y2K - www.gruppoy2k.it


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to