Camelia, the Perl 6 bug

IRC log for #mojo, 2011-12-07

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

All times shown according to UTC.

Time Nick Message
00:03 GabrielVieira joined #mojo
00:05 GabrielVieira Hi there.. i'm getting -----> Global symbol "$msg" requires explicit package name at template from DATA section "index.html.ep" line 27 <----------  while using <=% $msg %> in my __DATA__ index template... what should I do? (the $msg only exists in other action)
00:27 memowe_ GabrielVieira: you need to set a msg value in your stash. Assingning a variable in your controller code isn't enough
00:28 memowe like this: $self->stash(msg => "Hi, you look great!")
00:29 memowe GabrielVieira: I also assume you wrote <%= $msg %>, not <=% $msg %>, right?
00:29 GabrielVieira memowe: yeah
00:29 GabrielVieira but in the mojocast example, it do not show this error
00:30 GabrielVieira http://mojocasts.com/e4
00:30 GabrielVieira in the stash part
00:30 memowe give me a minute...
00:30 memowe what time in the video?
00:31 GabrielVieira 2min
00:31 GabrielVieira or just click below in the "stash" link
00:34 memowe I don't get your point.
00:34 GabrielVieira i'm changing the code... I'm used to use TT2.. it's a little easier
00:34 GabrielVieira hum
00:34 memowe Could you somewhere paste your full code?
00:34 GabrielVieira yep
00:34 GabrielVieira just a min, I just changed
00:34 memowe no problem
00:36 GabrielVieira http://pastebin.com/tH0VzxXZ
00:36 GabrielVieira I was trying this
00:36 GabrielVieira but I think I need to use % flash 'msg' instead
00:37 _sri i think you might be misunderstanding a lot
00:38 memowe Ah, _sri is here. :)
00:38 _sri i was about to show you a trick to make <%= $msg %> always work, but it's better if you learn the right way first
00:39 GabrielVieira humm
00:39 GabrielVieira ok
00:39 _sri learn what the stash is and how it works
00:39 _sri ep templates are just perl
00:41 GabrielVieira yeah.. I got...
00:41 _sri memowe: i generally don't answer questions anymore though, so please carry on :)
00:42 memowe _sri: I'm interested in the dirty trick, too. :)
00:42 _sri memowe: since it's just perl "% no warnings 'uninitialized';"
00:42 memowe Yay, I did it "right" in the past. ;)
00:42 _sri :)
00:42 memowe And I think GabrielVieira knows about its dirtyness.
00:43 GabrielVieira hehe
00:43 GabrielVieira hum
00:43 GabrielVieira I tried removing use warnings;
00:43 GabrielVieira I liked that
00:44 GabrielVieira but I'm working with flash ... %= $msg works as well?
00:44 memowe flash variables aren't variables in ep
00:44 memowe You can just check for definedness of flash 'msg'.
00:44 GabrielVieira yeah.. i saw...
00:45 GabrielVieira like if ( flash 'msg' ) { would work?
00:45 memowe Maybe you want to add a defined, but I think it should DWYM.
00:47 GabrielVieira worked just fine!
00:47 GabrielVieira so easy.. =)
00:47 memowe Wait a minute
00:47 GabrielVieira memowe, _sri thanks!!
00:49 memowe GabrielVieira: you can use the same method to access the stash without disabling warnings;
00:50 memowe % if ( stash 'msg' ) {
00:50 memowe <%= stash 'msg' %>
00:50 memowe % }
00:51 GabrielVieira humm
00:51 GabrielVieira that's great
00:51 memowe It's less dirty.
00:51 GabrielVieira yeah
00:51 GabrielVieira memowe++
00:51 memowe Now we need some sleep in europe. ;)
00:51 GabrielVieira :)
00:51 GabrielVieira thanks again!
00:51 memowe almost 2am.
00:51 memowe No problem, see you.
00:52 memowe Und gute Nacht, _sri! :)
00:52 _sri gute nacht! :)
01:07 mattastrophe joined #mojo
02:12 tempire GabrielVieira: you can copy and paste the shortcut links in the mojocasts
02:16 GabrielVieira hum
02:16 GabrielVieira its right
02:16 GabrielVieira thanks!
02:36 jnap joined #mojo
02:57 marty Is there a way to use a variable as a helper?  ie:  my $a = 'some_helper';  <%= $a %>
03:09 marty joined #mojo
03:09 memowe marty: if it is a helper, it's already accessible.
03:11 memowe marty: however, if you want to define something in templates and "call" it later, you want blocks: http://mojolicio.us/perldoc/Mojo/Template#Blocks
03:13 marty memowe: sorry, I don't follow.   I have an array of helper names and I want to loop through the array and call each helper.
03:14 memowe strange. :)
03:15 marty Hmmm.   I'm writing tests and I want to test my helpers.  So my thought was to just loop through them.  Maybe I am thinking wrong.   (wouldn't be the first time. )  :Q
03:15 memowe Ah, I see. :)
03:15 gbacon joined #mojo
03:15 xaka joined #mojo
03:20 memowe marty: wait a minute.
03:22 memowe marty: they live in app->renderer->helpers (which is a hashref of subrefs), but you need to pass the right objects.
03:22 marty Ahh got it.  tooo easy.   my $helper = 'some_helper_name'; <%= $self->$helper %>
03:22 memowe better. :)
03:22 marty Mojolicous makes things so easy it's hard to figure them out.  :)
03:23 memowe This time it's just Perl. :)
03:23 marty Yes, correct. :)
04:35 mire joined #mojo
04:52 hidek joined #mojo
06:16 Vandal joined #mojo
07:11 sugar joined #mojo
07:15 koban joined #mojo
07:42 reezer joined #mojo
08:07 berov joined #mojo
08:14 mire joined #mojo
08:45 MojoGuest996 joined #mojo
08:45 MojoGuest996 From: http://www.google.fi/url?sa=t&amp;rct=j&amp;​q=websocket%20demo&amp;source=web&amp;cd=5&a​mp;ved=0CFAQFjAE&amp;url=http%3A%2F%2Fdev.xa​ntus.org%2F&amp;ei=uCffTsjeL4HT4QSknIXlBg&am​p;usg=AFQjCNGw6nZv0wO42uzUnHhWcD0vcKNULg (1 hits)
08:48 spleenjack joined #mojo
09:23 batman joined #mojo
09:58 noganex joined #mojo
10:31 burk joined #mojo
10:51 Foxcool joined #mojo
10:54 cosmincx joined #mojo
11:06 GabrielVieira joined #mojo
11:29 Foxcool joined #mojo
11:45 andrefs joined #mojo
11:55 MojoGuest115 joined #mojo
11:55 MojoGuest115 From: http://www.google.co.uk/url?sa=t&amp;rct=j&a​mp;q=web%20sicket%20dmeo&amp;source=web&amp;​cd=9&amp;ved=0CGIQFjAI&amp;url=http%3A%2F%2F​dev.xantus.org%2F&amp;ei=vFPfTrXIGsbrOdDoje4​C&amp;usg=AFQjCNGw6nZv0wO42uzUnHhWcD0vcKNULg (1 hits)
11:55 MojoGuest115 hgf
11:55 MojoGuest115 kjhjk
11:55 MojoGuest115 kkk
11:56 _sri we are leaking ops again
12:13 Psyche^ joined #mojo
12:20 crab leaking ops?
12:21 _sri this channel is
12:23 crab oh. heh. i thought perl ops.
12:34 MojoGuest459 joined #mojo
12:34 MojoGuest459 From: http://blog.kraih.com/perl-is-ready-for-html5 (49 hits)
12:34 MojoGuest888 joined #mojo
12:35 MojoGuest54 joined #mojo
12:36 MojoGuest918 joined #mojo
12:36 MojoGuest918 hi
12:37 MojoGuest13 joined #mojo
12:37 MojoGuest13 From: http://blog.kraih.com/perl-is-ready-for-html5 (50 hits)
13:08 andrefs joined #mojo
13:43 Foxcool joined #mojo
13:54 koban left #mojo
13:54 jnap joined #mojo
13:58 amoore joined #mojo
14:06 GitHub49 joined #mojo
14:06 GitHub49 [mojo] kraih pushed 1 new commit to master: http://git.io/QMkU3w
14:06 GitHub49 [mojo/master] better tag helper tests - Sebastian Riedel
14:06 GitHub49 left #mojo
14:21 mire joined #mojo
14:27 GitHub60 joined #mojo
14:27 GitHub60 [mojo] kraih pushed 1 new commit to master: http://git.io/uQzdpw
14:27 GitHub60 [mojo/master] some more unicode tests - Sebastian Riedel
14:27 GitHub60 left #mojo
14:28 batman joined #mojo
14:43 andrefs joined #mojo
14:49 metaperl joined #mojo
14:52 metaperl|2 joined #mojo
15:04 gshank_ joined #mojo
15:05 judofyr joined #mojo
15:25 abra_ joined #mojo
15:36 Psyche^ joined #mojo
16:17 kaare joined #mojo
16:30 jnap_ joined #mojo
16:33 jnap_ joined #mojo
16:44 metaperl|2 joined #mojo
16:56 xaka joined #mojo
16:58 marcus joined #mojo
17:00 KayT3 joined #mojo
17:10 mercutioviz joined #mojo
17:10 newbie joined #mojo
17:14 marcus by
17:24 GitHub18 joined #mojo
17:24 GitHub18 [mojo] kraih pushed 1 new commit to master: http://git.io/MI1ROQ
17:24 GitHub18 [mojo/master] fixed inline template double encoding bug - Sebastian Riedel
17:24 GitHub18 left #mojo
17:26 sri fixed by removing code, i love it :)
17:32 jnap joined #mojo
18:06 MojoGuest783 joined #mojo
18:06 MojoGuest783 From: http://www.google.com/url?sa=t&amp;rct=j&amp;q=&a​mp;esrc=s&amp;source=web&amp;cd=10&amp;ved=0CHwQF​jAJ&amp;url=http%3A%2F%2Fdev.xantus.org%2F&amp;ei​=qanfTv-zJ6W9iAfF3OSSBQ&amp;usg=AFQjCNGw6nZv0wO42​uzUnHhWcD0vcKNULg&amp;sig2=fKAzsHI-FMxPvGl02-U3Jg (1 hits)
18:13 metaperl|2 joined #mojo
18:17 jwang joined #mojo
18:30 mire joined #mojo
18:42 metaperl joined #mojo
18:44 noganex_ joined #mojo
18:54 MojoGuest793 joined #mojo
18:54 MojoGuest793 From: http://blog.kraih.com/perl-is-ready-for-html5 (51 hits)
20:13 metaperl|2 joined #mojo
20:19 metaperl joined #mojo
21:29 mire joined #mojo
21:33 lammel2 joined #mojo
22:01 lukep joined #mojo
22:01 KayT2 joined #mojo
22:02 chorny joined #mojo
22:13 lammel2 joined #mojo
22:20 [R] joined #mojo
22:32 j3nnn1 joined #mojo
23:01 andrefs joined #mojo
23:03 [R] joined #mojo
23:04 andrefs joined #mojo
23:09 [R] joined #mojo
23:11 jnap joined #mojo
23:15 MojoGuest783 joined #mojo
23:15 MojoGuest783 From: http://blog.kraih.com/perl-is-ready-for-html5 (52 hits)
23:20 KayT3 joined #mojo
23:20 MojoGuest555 joined #mojo
23:20 MojoGuest555 From: http://blog.kraih.com/perl-is-ready-for-html5 (53 hits)
23:27 lammel2 joined #mojo
23:31 andrefs joined #mojo
23:43 MojoGuest488 joined #mojo
23:50 MojoGuest31 joined #mojo
23:50 MojoGuest31 From: http://blog.kraih.com/perl-is-ready-for-html5 (54 hits)

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