RE: What is the meaning of $normalize->{$1}
[email protected] (Claude Brown via beginners) Thu, 15 Jun 2023 20:31:31 +0000
| Newsgroups | perl.beginners |
|---|---|
| Message-ID | <SYBP282MB2527082E0D8B1C0FC9CA7C0FC75BA@SYBP282MB2527.AUSP282.PROD.OUTLOOK.COM> |
Is there any prior mention of "$normalise" in the script?
Assuming there isn't, most likely "$normalise->{$1}" is building out a hash-table with "$1" as the key and a value of 1 at each entry. $normalise will be a reference to that hash.
To check if this is correct, do this sometime after this code:
use Data::Dumper;
print Dumper($normalise);
-----Original Message-----
From: Freek de Kruijf <[email protected]>
Sent: Friday, June 16, 2023 5:29 AM
To: [email protected]
Subject: What is the meaning of $normalize->{$1}
CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.
Hi,
I am trying to understand fully a perl program with the following lines:
} elsif( /^(\#?\s*(?:pickup|qmgr)\s+)(?:fifo|unix)(\s+.*)/ ) {
if( defined $normalize->{$1} ) { next; } else { $normalize->{$1} = 1; }
I do understand the first line, but I can not find what the second line is
about.
As far as can see the tested line in $_, from a file, is all ASCII with lower
case characters. At the begin of the perl program the is no "use <something>".
--
fr.gr.
Freek de Kruijf
--
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
http://learn.perl.org/