Update: Anno makes it better for anticipating unexpected input. I did solely by the fact of the sample input. I know about \s* and limit in split.my $entries; while (<DATA>) { chomp; my($ip, $text) = split /\s+\|\s+/; $entries{$ip} = $text; } print $entries{"192.168.0.1"}; # some text __DATA__ 192.168.0.1 | some text 192.168.0.2 | another text
Open source softwares? Share and enjoy. Make profit from them if you can. Yet, share and enjoy!
In reply to Re: File Searching
by naikonta
in thread File Searching
by mattwortho
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |