Just another Perl shrine | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Hello again. I've got a script that uses named capture groups to parse file records. The record format is always the same (four fields wide, colon separated), just like a passwd file (except for the number of fields). For example: 0:1:bob:Bob 1:1:bob:Bob 1:0:alice:Alice You get the idea. At first I used to split it, but later I came to the conclusion that using a regex with named groups could provide a more understandable code. The (simplified) example below might help you get the picture.
Now, I've noticed (according to perlretut) that named capture groups were introduced in Perl 5.10. I don't expect the script to run in older versions, but would it be wise to use v5.10 pragma? Would it have any unwanted side effects? I'm not using any of the features of the bundle, just wanted to state that version 5.10 is required. Is that a good idea? In reply to Should I use v5.10 because of named groups? by hrcerq
|
|