Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^2: regex gotcha moving from 5.8.8 to 5.30.0?

by choroba (Cardinal)
on Feb 10, 2021 at 20:05 UTC ( [id://11128195]=note: print w/replies, xml ) Need Help??


in reply to Re: regex gotcha moving from 5.8.8 to 5.30.0?
in thread regex gotcha moving from 5.8.8 to 5.30.0?

What about reading the file in chunks? "endmodule" seems like a good candidate for the separator.
#!/usr/bin/perl use warnings; use strict; use feature qw{ say }; local $/ = 'endmodule'; my $name; while (<>) { if (/^ \s* module \s+ (\S+?) \s* \( \s* .*? \s* \) \s* ;/xsm) { $name = $1; say $name; } } say "LAST MODULE (Perl $]): $name";
map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11128195]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (7)
As of 2024-04-19 08:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found