Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re^5: REGEX omit dashes - simple but ...

by kennethk (Abbot)
on Apr 04, 2016 at 17:28 UTC ( [id://1159520]=note: print w/replies, xml ) Need Help??


in reply to Re^4: REGEX omit dashes - simple but ...
in thread REGEX omit dashes - simple but ...

You are getting an uninitialized error because you are trying to change the content of $access_num, to which you've assigned $1, but there were no parentheses in your first regular expression. Maybe you mean something like:
if ($line =~ s/^\s*ACCESSION\s*NUMBER:\s*/) { $line =~ tr/-//; }
or possibly
if ($line =~ s/^\s*ACCESSION\s*NUMBER:\s*([-\d]+)$/m) { $access_num = $1; $access_num =~ tr/-//; }

#11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (4)
As of 2025-01-16 14:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Which URL do you most often use to access this site?












    Results (54 votes). Check out past polls.