Capacio, Paula J wrote:
> I am using $1 and $2 to retain data from a matched regular expression.
> I expect $1 to contain the KEY ID and $2 to contain USER NAME, but $2
Pauls, If you put a slash between $1 and $2, you will find out that it is not
doing what you think. You will find that $1 is getting everything but depending on the
line except for the last character. Since you use .* then this will always be
satisified with nothing in $2. From what I can see, you should be able to do
something like along with changing the print:
if ($line =~ /DSS p.+\].{1}(\S+).{1}(.+)/) {
print "Expression matched and retained: \{$1\}/\{$2\}\n\n";
which will give output:
*DSS pair 1024/1024 [VI---] 0x2BEAF881 American Family Insurance
Expression matched and retained: {0x2BEAF881}/{American Family Insurance}
DSS pub 2048/1024 [-----] 0x8E5DAD1A operator2<[EMAIL PROTECTED]>
Expression matched and retained: {0x8E5DAD1A}/{operator2<[EMAIL PROTECTED]>}
DSS pub 3072/1024 [-----] 0xBE71303F another/americanfamily <[EMAIL PROTECTED]>
Expression matched and retained: {0xBE71303F}/{another/americanfamily <[EMAIL
PROTECTED]>}
DSS pub 1024/1024 [-----] 0xB04F7DAA swisscow
Expression matched and retained: {0xB04F7DAA}/{swisscow}
DSS pub 2048/1024 [-----] 0xAA2F4ABA SLM <[EMAIL PROTECTED]>
Expression matched and retained: {0xAA2F4ABA}/{SLM <[EMAIL PROTECTED]>}
May not be completely correct, but shoudl give you a start.
Wags ;)
**********************************************************
This message contains information that is confidential
and proprietary to FedEx Freight or its affiliates.
It is intended only for the recipient named and for
the express purpose(s) described therein.
Any other use is prohibited.
****************************************************************
_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs