Your skill will accomplish what the force of many cannot |
|
PerlMonks |
Re: Why can't I open a file for writing?by haukex (Archbishop) |
on Jan 13, 2018 at 09:09 UTC ( [id://1207190]=note: print w/replies, xml ) | Need Help?? |
Something I noticed in addition to the comments about open ... or die:
Sorry but I don't see how the pattern <$dir/\d{6}*> can be working at all* - glob does not recognize regex syntax, unless you're using some custom module. Always Use strict and warnings - you should be seeing a warning like "Unrecognized escape \d passed through". Also, be very careful with what $dir contains, and in fact with glob in general, as discussed in the recent thread To glob or not to glob. * Update: Or rather, how it is working in the context provided, "All the relevant files start with 6 numbers" - thanks for pointing this out, Lotus1!
In Section
Seekers of Perl Wisdom
|
|