[erlang-questions] Executing an Erlang function from Perl

Bengt Kleberg bengt.kleberg@REDACTED
Mon Sep 8 09:10:27 CEST 2008


Greetings,

This is just a correction of a typo below:

code:add_patha(Dir)


bengt

On Fri, 2008-09-05 at 12:41 -0500, Anders Nygren wrote:
> 2008/9/5 Sebastian Bello <sebastian.bello@REDACTED>:
> > Thanks Bengt and Chandru.
> > An additional question: if I know the full path to a .beam file, and that
> > path has no been added with a -pa for example, what would be the way to
> > execute a function of that module?
> >     Sebastian-
> 
> Sebastian
> 
> Dir = filename:dirname(Beam),
> code:addpatha(Dir)
> 
> /Anders
> 
> >
> > Chandru escribió:
> >
> > 2008/9/3 Sebastian Bello <sebastian.bello@REDACTED>
> >>
> >> Hi list,
> >>
> >> I need to execute an Erlang function from within Perl code, what do you
> >> suggest?
> >> Thanks,
> >>    Sebastian-
> >
> > Try 'erl -man erl_call'
> >
> > Extract from the man page:
> >
> > NAME
> >        erl_call - Call/Start a Distributed Erlang Node
> >
> > DESCRIPTION
> >        erl_call  makes  it  possible  to  start and/or communicate with a
> > dis-
> >        tributed Erlang node. It is built upon the erl_interface library as
> > an
> >        example  application.  Its  purpose  is  to use an Unix shell script
> > to
> >        interact with a distributed Erlang node. It performs all
> > communication
> >        with  the Erlang rex server, using the standard Erlang RPC facility.
> > It
> >        does not require any special software to be run at  the  Erlang
> > target
> >        node.
> >
> >        The main use is to either start a distributed Erlang node or to make
> > an
> >        ordinary function call. However, it is also possible to pipe an
> > Erlang
> >        module  to  erl_call  and  have  it  compiled, or to pipe a sequence
> > of
> >        Erlang expressions to be evaluated (similar to the Erlang shell).
> >
> >        Options, which cause stdin to be read, can be used  with  advantage
> > as
> >        scripts  from within (Unix) shell scripts. Another nice use of
> > erl_call
> >        could be from (http) CGI-bin scripts.
> >
> >
> >
> >
> > _______________________________________________
> > erlang-questions mailing list
> > erlang-questions@REDACTED
> > http://www.erlang.org/mailman/listinfo/erlang-questions
> >
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://www.erlang.org/mailman/listinfo/erlang-questions




More information about the erlang-questions mailing list