Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine

Re^4: Bug in script, regex help req extreme urgent

by CountZero (Bishop)
on Mar 10, 2013 at 14:06 UTC ( #1022664=note: print w/replies, xml ) Need Help??

in reply to Re^3: Bug in script, regex help req extreme urgent
in thread Bug in script, regex help req extreme urgent

OK, let's address this item by item.
  1. Modern::Perl: you can replace this by use strict; use warnings; and replace say by print + "\n".
  2. What version of Perl are you using?
  3. You can use any regex that works (but see point 5).
  4. My code does not need an else part.
  5. Of course it does not work, the regex you use is wrong. Use the following regex: my $match = qr "module\s*($ARGV[2])\b";. That one works, trust me. It is similar to my previous once, but will reject modulenames that are not exactly the same, but only start with the string you want to replace. It will accept "OLD" but will reject strings like "OLDER", "OLDENBERG", "OLDUVAI",...


A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

My blog: Imperial Deltronics

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1022664]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (3)
As of 2018-05-22 22:12 GMT
Find Nodes?
    Voting Booth?