Re: The map function



Gerry Ford wrote:
"Jürgen Exner" <jurgenex@xxxxxxxxxxx> wrote in message news:21mr04pro5k3sqjbebv5g2jq5i0doq42t3@xxxxxxxxxx
However, I wonder what you are trying to achive by using eval in the
first place. I don't see any need for it.

I could just omit it?

It's up to you; I for one do see a need for it: It prevents a fatal error for the case a line is not a valid regular expression.

C:\home>type test.pl
my @filter;
while (<DATA>) {
chomp;
next unless length;
next if /^#/o;
my $pat;
eval '$pat = qr($_)' or do { warn $@; next };
push @filter, $pat;
}
print "$_\n" foreach @filter;

__DATA__
\w+).+?
\s+

C:\home>test.pl
Unmatched ) in regex; marked by <-- HERE in m/\w+) <-- HERE .+?/ at (eval 1) line 1, <DATA> line 1.
(?-xism:\s+)

C:\home>

--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
.



Relevant Pages

  • Re: MPEG2 Demultiplexer - Microsoft
    ... The incoming TS from DVB card has its PAT, ... I tried to connect a TS-Mpeg2 Datastream from the B2C2-Source Filter to ... Output pin that gives me a program stream, which I could save to disk to ... When you reassemble the payloads of TS to get PES, ...
    (microsoft.public.win32.programmer.directx.video)
  • Re: MPEG2 Demultiplexer - Microsoft
    ... The incoming TS from DVB card has its PAT, ... Select your program and build a filter which will pass only the ... playable transport stream containing your program. ... When you reassemble the payloads of TS to get PES, ...
    (microsoft.public.win32.programmer.directx.video)
  • Re: Internet Fax Services?
    ... PAT, please omit my email address. ... I've been using http://OneSuite.com for prepaid LD for years, ... offer a product called MessageOne that can receive voice and fax ...
    (comp.dcom.telecom)
  • Re: Questions with rsync
    ... I would pretty much recommend that you specifically omit /dev and /proc ... Save the filter to a text file and make it look something like this (I ... Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines ...
    (Fedora)
  • Re: [PATCH] x86: trim ram need to check if mtrr is there v3
    ... what we should probably do instead is to have a filter function: ... and then we could iterate through every e820 map entry that is ... and send it through this filter. ... Later on with PAT that filter could also do PAT related checks and ...
    (Linux-Kernel)

Loading