hi, all, You know if you use system call to call a perl script in Ruby''s controller, it will only return the status for the status of execution but not the return value of perl script. I really need the return value of the perl script, can I get it and how can I get it? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
One possibility would be for your Perl script to write it to a file, then have your Ruby controller read the file. I''d like to know if there are other ways, though... On Dec 18, 1:45 am, lily <ygao1...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> hi, all, > You know if you use system call to call a perl script in Ruby''s > controller, it will only return the status for the status of > execution but not the return value of perl script. > I really need the return value of the perl script, can I get it and > how can I get it?--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
mikebind wrote:> One possibility would be for your Perl script to write it to a file, > then have your Ruby controller read the file. I''d like to know if > there are other ways, though...Well I do know this. Just as in bash scripting using the backquote (tick) around command runs in a subshell and returns the standard output from the command. Example: irb(main):001:0> `date` => "Thu Dec 18 14:00:09 EST 2008\n" irb(main):002:0> So as long as your Perl script outputs the result to standard out this should work. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---