tags:

views:

52

answers:

2

Hey all,

This is probably something very basic, but my Erlang installation is doggedly rejecting my calls to the re module with error:undefs. It accepts the regexp package, however, so I'm thinking its a version issue.

I'm running v. 5.6.2, and -import(re, [...]). at the top of my file, are there any other gotchas I may be missing? I searched for a fair bit of time, but couldn't find a page describing the minimum version needed.

On a related note, since I'm still pretty fresh to Erlang and its tools/community/dev environments, if you have any suggestions for sites to visit frequently, or tools that changed your dev cycle, please let me know.

Thanks!

EDIT: If you want to see some code:

Erlang (BEAM) emulator version 5.6.2 [source] [smp:2] [async-threads:0] [kernel-poll:false]

Eshell V5.6.2  (abort with ^G)
1> re:compile("paul").
** exception error: undefined function re:compile/1

2> regexp:match("paul","au").
{match,2,2}

And in my Eunit test:

::error:undef
  in function re:compile/1
    called as compile("\\s+")
A: 

Try first running your regex code in the Erlang shell and see if you get the same error. Maybe posting the actual code would help.

hyperboreean
Posted, thanks.
paul.meier
+2  A: 

Your Erlang installation is very old. It is probably one of pre-R12B releases. The most current stable version is R13B04, and R14 is in beta stage now.

gleber
Upgraded and fixed, thanks ^_^. I didn't upgrade before because I was having build problems, turned out it was a rogue ./configure setting. Is there a way to check your installation with the release titles? From what I can tell the release titles don't have version numbers.
paul.meier
The never versions actually print out the Erlang version number in the top of the shell. Your old version doesn't do that, though. :-)
Adam Lindberg
`erlang:system_info(otp_release)` gives you the major version (e.g. `R12B`). Not sure if you can get the minor version as well...
legoscia