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

Re^8: How to avoid an alphabet and integer next to it in a string?

by hazylife (Monk)
on Mar 21, 2014 at 18:55 UTC ( #1079333=note: print w/replies, xml ) Need Help??


in reply to Re^7: How to avoid an alphabet and integer next to it in a string?
in thread How to avoid an alphabet and integer next to it in a string?

chomp(my $molform = <STDIN>);
  • Comment on Re^8: How to avoid an alphabet and integer next to it in a string?
  • Download Code

Replies are listed 'Best First'.
Re^9: How to avoid an alphabet and integer next to it in a string?
by runrig (Abbot) on Mar 21, 2014 at 19:20 UTC
    Forget chomp, just do:
    $molform =~ s/\s+$//;
      $molform =~ s/H\d*//g; worked for me except for Hg and He. Yup, I tried $molform =~ s/\s+$//;

      The output is zero

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (8)
As of 2016-08-30 14:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    The best thing I ever won in a lottery was:















    Results (418 votes). Check out past polls.