Re: How to get the name of the variable a reference is "pointing" at

2007-11-20 Thread Frank Bergemann
Hi Paul, just another level of indirection - should have known that :-) - many thanks! rgds! Frank -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

How to get the name of the variable a reference is "pointing" at

2007-11-20 Thread Frank Bergemann
Hi, foreach my $ref (\%Hash1, \%Hash2, \%Hash3) { while(my ($key, $value) = each(%$ref)) { debug ("$key -> $value") } } I'd like to prefix the name of the hash for the elements in my debug(...). How to get the name of what $r

Re: regexp with capture of multiple lines matching a line pattern

2007-11-06 Thread Frank Bergemann
In case s.o. else will have the same problem. Here's, how i solved it "my way": [...] # storage for APN data (multiple lines) my %APNdata; my @APNarray; [...] APNID PDPADDEQOSID VPAA PDPCHPDPTY PDPID (?:[ ]+(\\d+)(?{\$APNdata{'APNID'} = \$^N;})[ ]+(\\d+)(?{\ $APNdata{'EQOS

Re: regexp with capture of multiple lines matching a line pattern

2007-11-05 Thread Frank Bergemann
On 5 Nov., 17:12, [EMAIL PROTECTED] (John W . Krahn) wrote: > > Your pattern ()* is a list and the pattern will match every line but > only capture the *last* line matched. To do what you want you have to > loop through the lines individually. > I would prefer to do without own loops. What about

Re: regexp with capture of multiple lines matching a line pattern

2007-11-05 Thread Frank Bergemann
Hi Tom, sorry i was missing to tell, that i used the HERE script like syntax. Here's an example: #!/usr/bin/perl -w use strict; my $input = << "END_OF_INPUT"; Hi there! Here're some lines to match... 1st some specific ones some more and finally this one No

regexp with capture of multiple lines matching a line pattern

2007-11-05 Thread Frank Bergemann
Hi, using perl 5.8.8. i was trying to match for capturing data from a server's response message. Now i have the problem, that within the response there is a head-line with #x next lines, that match a certain pattern. And i want to extract as many data as come: E.g folloing input [...] APNID PD