Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

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

by kennethk (Abbot)
on Apr 04, 2016 at 17:28 UTC ( #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?

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (8)
As of 2023-09-27 08:25 GMT
Find Nodes?
    Voting Booth?

    No recent polls found