The web in a box - a next generation web framework for the Perl programming language

IRC log for #mojo, 2013-12-07

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

All times shown according to UTC.

Time Nick Message
00:58 laouji joined #mojo
01:25 punter joined #mojo
01:28 Adura joined #mojo
01:32 jberger joined #mojo
02:27 d4rkie joined #mojo
02:29 d4rkie joined #mojo
03:19 russum joined #mojo
03:19 russum left #mojo
03:25 jberger joined #mojo
03:48 asarch joined #mojo
04:13 jberger joined #mojo
04:15 D4RK-PH0ENiX joined #mojo
04:19 d4rkie joined #mojo
04:20 preflex_ joined #mojo
04:56 inokenty joined #mojo
05:17 itz_ joined #mojo
05:37 d4rkie joined #mojo
05:52 d4rkie joined #mojo
06:11 D4RK-PH0ENiX joined #mojo
06:43 KindTwo joined #mojo
07:06 Vandal joined #mojo
08:11 dod joined #mojo
08:30 dod joined #mojo
08:32 batman sri: if you think it wouldn't slow down the Prefork server, then i'm happy to look at it.
08:34 batman you mean moving out this code out into a event https://metacpan.org/source/SRI/Mojolicious-4.59/lib/Mojo/Server/Daemon.pm#L179 ?
08:41 KindTwo joined #mojo
10:15 KindTwo joined #mojo
10:28 punter joined #mojo
10:28 jnbek joined #mojo
10:31 sivoais_ joined #mojo
11:13 denis_boyun joined #mojo
11:14 billy-whiz joined #mojo
11:34 hrupp joined #mojo
12:02 punter joined #mojo
12:06 dsteinbrunner joined #mojo
12:11 sh4 joined #mojo
12:19 meshl joined #mojo
13:05 abra joined #mojo
13:14 denisboyun joined #mojo
13:48 asarch joined #mojo
13:52 Vandal joined #mojo
14:05 denisboyun joined #mojo
14:20 jnbek^dt joined #mojo
14:23 hummeleBop joined #mojo
14:23 maxhq joined #mojo
14:38 good_news_everyone joined #mojo
14:38 good_news_everyone [mojo] kraih pushed 3 new commits to master: http://git.io/QatOFQ
14:38 good_news_everyone mojo/master d9e0820 David Steinbrunner: typo fix
14:38 good_news_everyone mojo/master cc0f914 David Steinbrunner: typo fix
14:38 good_news_everyone mojo/master e02be4d Sebastian Riedel: Merge pull request #569 from dsteinbrunner/patch-1...
14:38 good_news_everyone left #mojo
14:40 good_news_everyone joined #mojo
14:40 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/VhIPKw
14:40 good_news_everyone mojo/master f975a45 Sebastian Riedel: fixed POD formatting
14:40 good_news_everyone left #mojo
14:41 sri dsteinbrunner: please don't mess with the formatting next time
14:43 dsteinbrunner ?
14:43 dsteinbrunner did not know that I did
14:43 dsteinbrunner looking back
14:44 dsteinbrunner ah
14:44 dsteinbrunner the github editor did that
14:44 dsteinbrunner did it via the website
14:48 jberger_ joined #mojo
14:49 jberger_ o/
14:58 d4rkie joined #mojo
14:59 sri \o
15:00 jberger_ sri: is there a helper or else a plugin that you are aware of which parses the content-disposition header?
15:03 jberger_ if not, I'm thinking of making something
15:03 jberger_ it would help with my blog series post
15:04 jberger_ use content-disposition's filename if present, or else use the request's last part unless it ends in a trailing slash
15:05 crab hi.
15:05 jberger_ crab o/
15:05 jberger_ how ya feeling?
15:06 crab good, thanks. marvellous dentist. the procedure was a bit painful (yesterday and today), but now (~10hrs later) i have to concentrate to feel anything at all.
15:06 jberger_ great, glad to hear it
15:48 D4RK-PH0ENiX joined #mojo
15:48 d4rkie__ joined #mojo
16:25 abra joined #mojo
16:33 mire_ joined #mojo
16:35 abra joined #mojo
16:49 jnbek^dt joined #mojo
16:59 rem_lex joined #mojo
17:05 KindTwo joined #mojo
17:22 billy|whix joined #mojo
17:45 hellyna joined #mojo
17:46 hellyna joined #mojo
17:47 denisboyun joined #mojo
17:55 hellyna hello. i am new to mojo and perl and i am not sure if this is a common error being asked here.
17:55 hellyna Can't use string ("id") as an ARRAY ref while "strict refs" in use at ... <-- this error
17:56 hellyna so how do i possibly circumvent this error? ideally not setting no strict 'refs'?
17:56 jberger_ unsetting strict refs wouldn't help anyway
17:57 jberger_ somehow you are trying to dereference a string as an array
17:57 hellyna that happened when i refer to something on the stash via @$var
17:57 hellyna on the template
17:58 jberger_ where $var is a stash value?
17:59 jberger_ in your controller, you must be setting $self->stash( var => ... )
17:59 jberger_ if that value you set is a string, you wouldn't want to use the @ sign
18:00 jberger_ if that value is an array reference ( $self->stash( var => [ 'some', 'values' ] )  ) then you should be able to do @$var in your template
18:00 hellyna the... var i am setting is an array called in a scalar context ie @array
18:01 hellyna var => $array
18:01 jberger_ that will not do what you mean
18:01 hellyna oh.
18:01 jberger_ an array in scalar context returns the number of elements in the array
18:01 jberger_ you want a reference to the array
18:01 jberger_ $self->stash( var => \@array );
18:02 hellyna ooh
18:02 jberger_ then you can do @$var in your template
18:02 jberger_ i HIGHLY recommend perlreftut for learning about references
18:03 jberger_ http://perldoc.perl.org/perlreftut.html
18:03 jberger_ its the best tutorial there is on the matte
18:03 hellyna oh right. i realized u are the writer of this post: http://blogs.perl.org/users/joel_berger/2012/10/a-simple-mojoliciousdbi-example.html
18:03 jberger_ matter
18:03 jberger_ I am
18:03 hellyna and i was just trying to follow what is happening in the examples shown
18:04 hellyna so u called smth like:   $self->stash( rows => $rows ); then
18:04 hellyna % foreach my $row (@$rows) {
18:04 hellyna <tr>
18:04 hellyna % foreach my $text (@$row) {
18:04 hellyna ...
18:05 jberger_ (fyi, its bad etiquette to paste into IRC channels
18:05 jberger_ )
18:05 Lucas1 joined #mojo
18:05 hellyna sorry. but i hope i shouldnt use a pastebin because its only 3 lines..
18:05 jberger_ other people would yell, I'm just reminding :-)
18:05 hellyna so i am confused why the abovementioned code fragment would be exactly what i followed.. wouldn't it?
18:06 hellyna haha >_< it is weird to paste a 3 line in a pastebin.. i don't know
18:06 jberger_ anyway, the reason that the controller uses $rows is that the select helper calls fetchall_arrayref
18:06 jberger_ so that you already get a reference to the array of results
18:07 hellyna ooh
18:07 jberger_ when possible I prefer to keep a single reference to an array and pass it around to prevent copying of the individual elements
18:08 hellyna i realized i called the wrong function which i thought would return something similar: fetchrow_array
18:08 jberger_ ding ding
18:08 hellyna :)
18:08 jberger_ ok, well now you are on the right track
18:08 jberger_ I always like to hear that people find my tutorials useful (or at least that they are using them :-) )
18:09 hellyna thanks joel :).
18:09 jberger_ np
18:09 hellyna yeah i need something clean to start making sense the way mojo worked.. ;)
18:10 jberger_ cool
18:10 hellyna so true, a clean example would help a lot
18:10 hellyna grateful for the help <3
18:11 dsteinbrunner joined #mojo
18:14 sri hellyna: i'm the one who would yell at you, and usually ban for pasting into the channel more than once ;)
18:15 sri conder yourself yelled at
18:15 sri *consider
18:23 hellyna sri: boo. i'll stick to using the pastebin next time
18:38 rem_lex|pivo joined #mojo
18:40 Mad_Dud- joined #mojo
18:56 damaya joined #mojo
18:56 damaya Hey, are there any guides to making a web app installer?
18:57 damaya I want an installer that builds the database, runs some commands, grabs all dependencies, etc.
19:02 abra_ joined #mojo
19:04 Mad_Dud joined #mojo
19:35 dsteinbrunner joined #mojo
19:45 dod joined #mojo
19:56 asarch joined #mojo
20:29 dsteinbrunner joined #mojo
20:41 zacts joined #mojo
21:01 jberger_ damaya, Galileo does it, but the mechanism is not trivia
21:01 jberger_ trivial
21:57 nicomen joined #mojo
22:20 dsteinbrunner joined #mojo
22:45 damaya jberger_: I was looking at that.
22:45 damaya Hm, I will have to continue looking at Galileo as an example.
22:46 damaya Galileo relies on CPAN though, right?
22:46 damaya The difference here is that none of this is going to be on CPAN, because it's an internal app where I work.
22:51 jovial_chat damaya: i just use a cpanfile and DBIx::Migration or similar
22:51 jovial_chat making a deployment script from that is pretty trivial
22:51 jovial_chat get perlbrew -> install preferred version -> add cpanm -> install deps -> provision database -> start hypnotoad
22:52 damaya Hm, I will have to look into it. Is this done via a script?
22:52 damaya Or a Makefile?
22:52 purl rumour has it a makefile is fine
22:52 jovial_chat damaya: i do it by hand because it's literally like 6 commands
22:52 jovial_chat but there's no reason you couldn't easily script it
22:54 damaya jovial_chat: For what I am doing it is something like: A) choose whether to run in a perlbrew environment, B) install perlbrew if chosen, C) add cpanm, D) install deps, E) provision database, F) start daemon (not hypnotoad yet), G) run some commands and gather information about the system, H) upload the information... and more. There's a lot to the installer, because I need to gather information about the system, upload it, register with
22:54 damaya a server, and more.
22:54 damaya OK
22:55 damaya So, I am thinking that I either script it, or create a Makefile that does everything I need to do.
22:55 jovial_chat i avoid Makefiles when i can use cmake
22:55 damaya Oh yeah, and create the configuration file for the app.
22:55 jovial_chat but regardless the amount of work required in that should be pretty trivial
22:55 jovial_chat hwinfo|mail addr@server.biz etc
22:55 damaya I think actually that I will have a web based installer that does everything. That makes more sense for me.
22:55 jovial_chat write it in Mojo :)
22:55 damaya Of course :)
22:56 damaya Thanks for the help all! Back to work.
22:56 jovial_chat if you use mojo lite, you can do the whole web interface in a single file
22:56 jovial_chat and mojo's deps are as manageable as you could ever ask for
22:57 damaya The installer in Mojo lite, and the app itself using Mojo::Command and a mojo full app.
22:57 jovial_chat sounds like you have a plan
22:57 damaya yeah, thus far that is what I have found.
22:57 damaya Awesome-o. Thanks for talking me through it :D
22:57 damaya Stay jovial!
22:57 jovial_chat i'm no expert, but feel free to bother me if something isn't working
22:57 jovial_chat i'm around fairly often
22:58 damaya You don't know what you just did to yourself ;)
22:58 damaya hehe
22:58 jovial_chat i can always pretend i'm not here :)
22:58 * jovial_chat slinks away silently
22:59 asarch joined #mojo
23:01 billy-whiz joined #mojo
23:05 meshl joined #mojo
23:06 marcus damaya: I suggest bundling your dependencies  with carton
23:28 dvinciguerra joined #mojo
23:50 dsteinbrunner joined #mojo

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