Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

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",...

CountZero

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


Comment on Re^4: Bug in script, regex help req extreme urgent
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (13)
As of 2014-10-21 09:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (99 votes), past polls