GCU logs

June 9th, 2008 by iMil

Log du 20Aug2008

[00:01] GeJ [103]# perl -MData::Dumper -e '$a = \@{blah}; print Dumper $a;'
[00:01] GeJ $VAR1 = [];
[00:01] gaston ouiiboon
[00:01] gaston caline GeJ
[00:02] gaston mais il devrait pas y avoir blah dedans ?
[00:03] gaston perl -MData::Dumper -e '@b = (t); $a = \@{@b}; print Dumper $a;'
[00:03] gaston mieux.
[00:03] GeJ si @blah existe, alors \@{blah} == \@blah == une reference vers la liste @blah
[00:04] gaston hmpf
[00:04] gaston therestoomuchwaytodoit
[00:04] GeJ \@b ca marche aussi tres bien.
[00:05] gaston TIMTOWTDI mon cul ouais, ca devrait etre TTMWTDI
[00:05] GeJ Ce sont des gens comme toi qui donne une mauvaise reputation a Perl
[00:05] gaston on peut faire pareil avec un hash ?
[00:06] GeJ $my_hash_ref = \%my_hash;
[00:06] gaston oui non ca d'accord
[00:06] wolog http://www.youtube.com/watch?v=bj8KQMAt0pY (The Wii Homebrew Channel Hack)
[00:06] gaston mais y'a pas de forme simplifiée comme [] pour les listes ?
[00:06] gaston je vois que {}
[00:06] GeJ my $hash_ref = { foo => bar, baz => quux };
[00:07] gaston mais alors si $a est un hash, {$a} est une hashref ou faut absolument \%a ?
[00:07] gaston (quand je dis $a c'est plutot $self->{truc})
[00:08] gl ça a l'air cool perl, vu d'ici
[00:08] gl câline son C
[00:08] GeJ gaston: $a n'est pas un hash. C'est un scalar. %a est un hash.
[00:08] gaston perl -MData::Dumper -e '$b{r}=t; $a = {%b}; print Dumper $a;'
[00:08] gaston gut
[00:08] gaston donc {%hash} == \%hash pour creer une hashref
[00:09] ntome gl: bah ya autant de pointeurs qu'en C, tu fais moins de segfault, mais qu'est ce que tu te prends la tête :)
[00:09] gl (je ne fais jamais de sigsegv)
[00:09] hr pourquoi tu te fais chier ?
[00:09] hr $ref = \%hash