Please run the code below and see if you get the same output as I do (also below). If so, I would like to know why it is behaving as it is.
#!/usr/local/perl -w use strict; my $filename1 = 'FILE.pgp'; my $filename2 = 'FILE.gpg'; my $signer = 'Some person <someone@this.com>'; my $exp_sender= ''; my $new_filename1 = $filename1; $new_filename1 =~ s/(\.gpg)|(\.encrypted)/\.decrypted/; print ".PGP FILE ERROR:'$signer' is not '$exp_sender'.\n" unless ($signer =~ m/\Q$exp_sender\E/); my $new_filename2 = $filename2; $new_filename2 =~ s/(\.gpg)|(\.encrypted)/\.decrypted/; print ".GPG FILE ERROR:'$signer' is not '$exp_sender'.\n" unless ($signer =~ m/\Q$exp_sender\E/); my $new_filename3 = $filename1; $new_filename3 =~ s/(\.gpg)|(\.encrypted)/\.decrypted/; print ".PGP ERROR, why the second time but not the first?:'$signer' is + not '$exp_sender'.\n" unless ($signer =~ m/\Q$exp_sender\E/); 1;
And below is the out put I get from the above script
$ perl match_test.pl .GPG FILE ERROR:'Some person <someone@this.com>' is not ''. .PGP ERROR, why the second time but not the first?:'Some person <someo +ne@this.com>' is not ''.
the_Don
...making offers others can't rufuse.
In reply to Re: Re: Regular Expression gotchas ?
by the_Don
in thread Regular Expression gotchas ?
by the_Don
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |