Camelia, the Perl 6 bug

IRC log for #mojo, 2013-07-12

| Channels | #mojo index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
00:17 btyler joined #mojo
00:35 shmuel joined #mojo
01:02 btyler joined #mojo
01:26 whitebook joined #mojo
01:42 Moataz-E joined #mojo
01:42 Moataz-E yo yo yo
01:42 TitanOfOld joined #mojo
01:43 Moataz-E guys is there a workaround for mojo complaining when you have an undefined variable in a template?
01:43 Moataz-E i have it inside an if else statement, so it isn't supposed to be reached, but mojo still complains :(
02:00 d4rkie joined #mojo
02:40 egopro joined #mojo
02:44 asarch joined #mojo
03:13 d4rkie joined #mojo
03:26 marty Moataz-E:  % if (defined $self->stash('var')) {...}
03:30 crab or just if (defined stash('var')) { ... }
03:34 Moataz-E thanks guys, I managed to get it to work but your suggestions are a lot better. Appreciated.
03:44 crab you're welcome.
03:52 preflex_ joined #mojo
04:50 mrphilov joined #mojo
05:47 dotandimet joined #mojo
05:51 Britzel_ joined #mojo
05:59 duncanthrax joined #mojo
06:06 shmuel say, when I'm feeling the urge to divide a Lite app to several files, is that the time I should move to Full-mojo?
06:06 trone joined #mojo
06:09 crab yes.
06:15 crab and the growing guide (Mojolicious::Guides::Growing) may help you.
06:16 shmuel thanks.
06:29 rem_lex joined #mojo
06:43 dpetrov_ joined #mojo
06:46 Vandal joined #mojo
06:51 xablor joined #mojo
07:00 dod joined #mojo
07:14 dod joined #mojo
07:40 Phil21 joined #mojo
07:44 trone joined #mojo
07:59 ver joined #mojo
07:59 alexeiras joined #mojo
08:06 dotandimet joined #mojo
08:12 basiliscos joined #mojo
08:20 maxhq joined #mojo
08:24 moltar joined #mojo
08:35 jzawodn joined #mojo
08:40 alexeiras left #mojo
08:49 cosmincx joined #mojo
09:01 fhelmber_ joined #mojo
09:14 D4RK-PH0ENiX joined #mojo
09:23 egopro joined #mojo
09:29 egopro joined #mojo
09:30 egopro joined #mojo
09:36 ladnaV joined #mojo
10:04 heytrav joined #mojo
10:25 ladnaV is there some hook after action? I want to edit some stash data filled by actions
10:26 ladnaV before it been rendered
10:26 alnewkirk after_dispatch maybe?
10:30 ladnaV alnewkirk, docs says Emitted in reverse order after a response has been rendered.
10:32 ladnaV so its too late
10:34 alnewkirk around_action it is then
10:38 ladnaV it says: Emitted right before an action gets invoked and wraps around it
10:38 ladnaV if understand correctly its too early
10:40 alnewkirk no, it wraps an action
10:40 alnewkirk like around in Moose
10:40 egopro joined #mojo
10:42 ladnaV what does it mean "wraps"?
10:42 ladnaV it fiers before and after ation?
10:42 ladnaV *fires
10:42 ladnaV or what?
10:44 alnewkirk ummm
10:46 alnewkirk Passed a callback leading to the next hook, the current controller object, the action callback and a flag indicating if this action is an endpoint
10:47 alnewkirk you* fire the action by calling $action->();
10:48 alnewkirk then $next->();
11:00 ladnaV oh
11:00 ladnaV thanks, I''l try
11:31 ladnaV it looks like app ignores this hook
11:34 batman ladnaV: iirc the around_action hook is relatively new. maybe you have an old mojo version?
11:34 ladnaV 3.9
11:35 batman ok. it was added in 4.15 :)
11:35 batman what about around_dispatch ?
11:36 ladnaV batman, will it fires after actions but before rendering?
11:36 batman i do believe so.
11:37 libsysguy joined #mojo
11:38 ladnaV batman, I'll try
11:38 batman let me know if it works or not...
11:41 Moataz-E hi guys, just a quick question; How can i pass an array variable to the stash?
11:42 batman Moataz-E: $c->stash(a => $array_ref) ?
11:42 Moataz-E I keep getting odd number of elements in anonymous hash error
11:42 batman Moataz-E: $c->stash(a => \@array) ?
11:42 batman hash or array?
11:42 batman Moataz-E: $c->stash(a => \@array, h => \%hash)
11:43 Moataz-E batman: thank you, i was passing in the whole array as "$self->stash(x => @myarray)
11:43 batman right. that will make the array into a list, like this: @array=qw/a b c/; => $c->stash(x => 'a', 'b', 'c');
11:44 batman instead of $c->stash(x => ['a', 'b', 'c']);
11:44 batman https://metacpan.org/module/RJ​BS/perl-5.18.0/pod/perlref.pod
11:45 Moataz-E batman: ohh i see, thank you very much!
11:45 batman np. new to mojolicous AND perl?
11:45 Moataz-E batman: i will give that link a read, thank you, you are really helpful
11:45 Moataz-E batman: yup :D, heard it is the most difficult but the fastest language around so gave it a shot
11:46 Moataz-E batman: tired of java's formality and bulkiness.
11:46 batman it shouldn't be the most difficult language i think... at least if you're not afraid of reading $, @ and % :)
11:46 batman right. it's a lot less overhead to write perl than java, hehe
11:46 nic it sounds like a martial art
11:47 batman Moataz-E: do you know how to use the array reference in your template?
11:48 batman array = @array, array reference = \@array
11:48 Moataz-E batman: that's the most confusing part so far, especially the more thn one way to do it thing
11:49 Moataz-E batman: for example i came across some code using @$, is this legacy or...?
11:49 batman no. that is to make the array ref back into a array.
11:49 batman $array_ref = \@array; print join ', ', @$array_ref # same as print join ', ', @array;
11:50 Moataz-E batman: alright so @$ is for dereferencing and \@ is for referencing
11:50 batman there's no arrays in the templates. only references. that means that if you want to use the array in the template, you need to us "@$array_name", where "array_name" is whatever you called in the stash
11:51 batman yes.
11:51 ladnaV batman, nope, it seems to fire after rendering
11:51 batman ladnaV: do you use $c->render; or auto-renderinger?
11:51 ladnaV batman, auto
11:51 nic and you can take a ref to an existing array: \@array
11:52 nic or stick the flattened list into an arrayref: [ @array ]
11:52 ladnaV batman, looks like i need to update
11:52 batman Moataz-E: in the controller: $c->stash(whatever => \@my_array);
11:52 batman Moataz-E: in the template: % for my $item (@$whatever) { ...
11:52 Moataz-E batman: yeh it is working, awesome, thanks :D
11:53 batman ladnaV: not sure if updating will help you... good luck
11:53 batman Moataz-E: excellent!
11:53 Moataz-E nic: thank you! will keep that in mind :D
11:53 ladnaV batman, thank you
11:53 whitebook joined #mojo
11:53 whitebook1 joined #mojo
12:17 bowtie_ joined #mojo
12:40 libsysguy left #mojo
12:52 asarch joined #mojo
13:19 whitebook joined #mojo
13:49 Dandre hello,
13:50 Dandre I am trying mojolicious (not lite). I have this simple test application: http://pastebin.fr/27984
13:51 Dandre This doesn't work, I get this error: Undefined subroutine &Kwartz::Mdm::_prepare_docs called at /usr/local/share/perl/5.14​.2/Mojolicious/Plugins.pm line 20
13:51 Dandre what should I do?
13:51 Dandre the _prepare_docs subroutine is defined in my file
13:56 PerlJam Dandre: no it is not.
13:56 PerlJam Dandre: there's a sub called "_prepare_doc", but not "_prepare_docs"
13:56 Dandre oups
13:56 Dandre sorry
13:59 Dandre now I have:
13:59 Dandre None of these routes matched your           GET request for           /, maybe you need to add a           new one?
14:01 Dandre there must be an issue in my custom handler
14:02 Dandre is there anything similar to -w option in morbo with mojolicious daemon mode?
14:02 Dandre or how can I use morbo with full mojolicious application
14:11 hrupp_ joined #mojo
14:14 btyler joined #mojo
14:22 dotandimet joined #mojo
14:46 sweet_kid left #mojo
15:04 nic Dandre: A full app has an initial script, which you pass to morbo
15:12 Dandre nic is this script I have to pass to morbo: http://mojolicio.us/perldoc/Moj​olicious/Guides/Growing#Script ?
15:13 nic yes
15:18 Dandre ok
15:29 Dandre joined #mojo
15:33 d4rkie joined #mojo
15:35 dod joined #mojo
16:07 xaka joined #mojo
16:21 PerlJam joined #mojo
16:24 dod1 joined #mojo
16:28 denisboyun joined #mojo
17:01 D4RK-PH0ENiX joined #mojo
17:10 russum joined #mojo
17:11 russum left #mojo
17:24 dod joined #mojo
17:26 mike_ joined #mojo
17:36 perlite joined #mojo
18:35 met joined #mojo
18:49 bluescreen joined #mojo
19:42 marcusie joined #mojo
19:43 marcusie joined #mojo
19:44 marcusie am I here?
19:46 doby being existential?
19:56 d4rkie joined #mojo
20:12 Britzel joined #mojo
20:15 d4rkie joined #mojo
20:21 whitebook joined #mojo
20:35 d4rkie joined #mojo
20:38 D4RK-PH0ENiX joined #mojo
20:40 d4rkie_ joined #mojo
20:46 rem_lex|pivo joined #mojo
21:17 sinkovsky joined #mojo
21:24 punter joined #mojo
21:30 asarch joined #mojo
21:34 moltar joined #mojo
22:31 russum joined #mojo
22:32 russum left #mojo

| Channels | #mojo index | Today | | Search | Google Search | Plain-Text | summary