in reply to Re^5: Display filenames in mbox folder
in thread Display filenames in mbox folder

Neither -P or -E worked. I wrote a small script to use that pattern and nothing returned. It would seem the pattern is incorrect.

Replies are listed 'Best First'.
Re^7: Display filenames in mbox folder
by choroba (Cardinal) on Mar 01, 2015 at 09:04 UTC
    Strange. It works for me:
    say for map { /^([0-9][\w.:,=\-]+)$/ } qw( 1231125716.6864.bLyyk:2,S 1 +422830161.R3.asus64:2,S);

    Output:

    1231125716.6864.bLyyk:2,S 1422830161.R3.asus64:2,S
    لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ

      I used the following ..

      #!/usr/bin/perl use warnings; use strict; say for map { /^([0-9][\w.:,=\-]+)$/ } qw( 1231125716.6864.bLyyk:2,S 1 +422830161.R3.asus64:2,S);

      and got:

      Possible attempt to separate words with commas at dirrecurs17.pl line +11. Bareword "say" not allowed while "strict subs" in use at dirrecurs17.p +l line 11. Execution of dirrecurs17.pl aborted due to compilation errors.

      So I commented out the ..

      #use warnings; #use strict;

      ran the script and got no output ??

      Possibly there is something wrong with my Perl install. I noticed various folders under /usr, like Perl, Perl5

        say requires that you put use feature 'say'; or use 5.010; (or any version greater than that) at the top of your script. Commenting out use warnings; use strict; is not a solution.

        use warnings; use strict; my $PATH = '/tmp/foo'; opendir my $dh, $PATH or die $!; print "\"$_\"\n" for grep { -f "$PATH/$_" && /^([0-9][\w.:,=\-]+)$/ } readdir $dh; closedir $dh; __END__ "1231125716.6864.bLyyk:2,S" "123test" "1422830161.R3.asus64:2,S"

        If you have further trouble, please see Basic debugging checklist and How do I post a question effectively?