gg48gg has asked for the wisdom of the Perl Monks concerning the following question:
Monks, I seek your wisdom on matching an end of string/line using the qr quote like operator. I am simply trying to match a string of 8 characters, no more no less. This is not working as expected
here is my code
#!/bin/perl -w use strict; my $re = qr/\S{8}$/; my $input=""; until ($input=~m/$re/) { $input=<STDIN>; chomp $input; }
execution...
#./retest 1234 12345678 #./retest 123456789 #
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: End of String in qr// expression
by choroba (Cardinal) on Sep 05, 2013 at 21:46 UTC | |
by gg48gg (Sexton) on Sep 05, 2013 at 23:09 UTC | |
|
Re: End of String in qr// expression
by wanna_code_perl (Friar) on Sep 06, 2013 at 01:57 UTC | |
by MidLifeXis (Monsignor) on Sep 06, 2013 at 13:03 UTC | |
by afoken (Chancellor) on Sep 06, 2013 at 19:28 UTC |