From webmaster.staff at gmail.com Tue Apr 17 09:43:05 2007 From: webmaster.staff at gmail.com (LordOfDeath) Date: Tue, 17 Apr 2007 18:43:05 +0200 Subject: [Roma.pm] saluti e piccola domanda :) Message-ID: <4624F919.8000304@gmail.com> Ciao a tutti ragazzi! come sn andate le vancanze di pasqua? scusatemi se non vi ho mandato gli auguri, ma vacanze e tutto mi hanno portato via molto tempo :) Posso chiedervi un grande favore? molto probabilmente mi sto solo bloccando con una vera e propria stupidaggine :) praticamente, devo controllare i processi di ogni utente, ovvero, devo controllare se un utente ne fa + di 1, quindi ho fatto cos?: @processo=`ps aux`; foreach $linea(@processo){ $linea=~s/ [0-9].+$//; $linea=~s/USER.+COMMAND//; chop $linea; } cos? ho la lista degli utenti, quindi avr? tipo nell'array @processo: ('antonio','antonio','giovanni','root','root'), il mio problema purtroppo ? questo : come avverto, una sola volta, che l'utente antonio(in questo caso) o altri compare 2 volte in @processo??? vi ringrazio tutti p.s. io stavo provando cos? my $try; $process=@processo; print $process; foreach $linea(@processo){ foreach $line(@processo) { if ($line =~ /$linea/){ if ($process =~ /$line{2,}/){ print "$line\n" ; $try.=$line;} else{ } } ma mi d? errore, potete aiutarmi?? grazie in anticipo, byeeee :) From balestra at cesmail.net Tue Apr 17 10:37:31 2007 From: balestra at cesmail.net (Marco Balestra) Date: Tue, 17 Apr 2007 19:37:31 +0200 Subject: [Roma.pm] saluti e piccola domanda :) In-Reply-To: <4624F919.8000304@gmail.com> References: <4624F919.8000304@gmail.com> Message-ID: <70DC039F-AAF6-47CE-ABB6-60DBA0D6E721@cesmail.net> On 17/apr/07, at 18:43, LordOfDeath wrote: > il mio problema purtroppo ? questo : come avverto, una sola volta, che > l'utente antonio(in questo caso) o altri compare 2 volte in > @processo??? Quando il problema ? "una sola volta" io uso sempre gli hash array: ad ogni occorrenza setto $hash{$chiave}++, alla fine ho sia l'elenco senza ripetizioni (keys %hash) che le numerosit? di ogni singola occorrenza. -- Marco Balestra IT consultant balestra at cesmail.net From hunternet at alice.it Tue Apr 17 10:47:15 2007 From: hunternet at alice.it (Fabrizio Cardarello) Date: Tue, 17 Apr 2007 19:47:15 +0200 Subject: [Roma.pm] saluti e piccola domanda :) In-Reply-To: <4624F919.8000304@gmail.com> References: <4624F919.8000304@gmail.com> Message-ID: <46250823.6050600@alice.it> Ciao devi confrontare ogni elemento dell'array con tutti gli altri e tenerti un count. Oppure puoi per ogni elemento dell'array usare grep elemento, lista e vedere quati elementi del nuovo array restituisce. Hai diversi modi. Ciao Fabrizio From webmaster.staff at gmail.com Tue Apr 17 10:48:22 2007 From: webmaster.staff at gmail.com (LordOfDeath) Date: Tue, 17 Apr 2007 19:48:22 +0200 Subject: [Roma.pm] saluti e piccola domanda :) In-Reply-To: <70DC039F-AAF6-47CE-ABB6-60DBA0D6E721@cesmail.net> References: <4624F919.8000304@gmail.com> <70DC039F-AAF6-47CE-ABB6-60DBA0D6E721@cesmail.net> Message-ID: <46250866.1080508@gmail.com> Marco Balestra ha scritto: > On 17/apr/07, at 18:43, LordOfDeath wrote: > > >> il mio problema purtroppo ? questo : come avverto, una sola volta, che >> l'utente antonio(in questo caso) o altri compare 2 volte in >> @processo??? >> > > Quando il problema ? "una sola volta" io uso sempre gli hash array: > ad ogni occorrenza setto $hash{$chiave}++, alla fine ho sia l'elenco > senza ripetizioni (keys %hash) che le numerosit? di ogni singola > occorrenza. > potresti farmi un esempio per favore? grazie in anticipo -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/pipermail/roma/attachments/20070417/107d6a61/attachment.html From webmaster.staff at gmail.com Tue Apr 17 10:51:05 2007 From: webmaster.staff at gmail.com (LordOfDeath) Date: Tue, 17 Apr 2007 19:51:05 +0200 Subject: [Roma.pm] saluti e piccola domanda :) In-Reply-To: <46250823.6050600@alice.it> References: <4624F919.8000304@gmail.com> <46250823.6050600@alice.it> Message-ID: <46250909.8050102@gmail.com> Fabrizio Cardarello ha scritto: > Ciao > devi confrontare ogni elemento dell'array con tutti gli altri e tenerti > un count. > Oppure puoi per ogni elemento dell'array usare grep elemento, lista e > vedere quati elementi del nuovo array restituisce. > Hai diversi modi. > Ciao > Fabrizio > > _______________________________________________ > Roma mailing list > Roma at pm.org > http://mail.pm.org/mailman/listinfo/roma > > ? quello che ho cercato di fare! :) ma senza successo.... ciao Ettore From christoph at wernli.org Tue Apr 17 11:43:24 2007 From: christoph at wernli.org (Christoph Wernli) Date: Tue, 17 Apr 2007 20:43:24 +0200 Subject: [Roma.pm] saluti e piccola domanda :) In-Reply-To: <46250866.1080508@gmail.com> References: <4624F919.8000304@gmail.com> <70DC039F-AAF6-47CE-ABB6-60DBA0D6E721@cesmail.net> <46250866.1080508@gmail.com> Message-ID: <9b16401b0704171143s69b720b9q754eb40fe05123d2@mail.gmail.com> On 4/17/07, LordOfDeath wrote: > il mio problema purtroppo ? questo : come avverto, una sola volta, che > l'utente antonio(in questo caso) o altri compare 2 volte in > @processo??? > > Quando il problema ? "una sola volta" io uso sempre gli hash array: > ad ogni occorrenza setto $hash{$chiave}++, alla fine ho sia l'elenco > senza ripetizioni (keys %hash) che le numerosit? di ogni singola > occorrenza. > > potresti farmi un esempio per favore? grazie in anticipo > contiene una discussione sull'argomento; immagino che soprattutto l'ultima parte ti possa interessare. -c -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/pipermail/roma/attachments/20070417/69cebc7f/attachment.html From balestra at cesmail.net Tue Apr 17 11:44:02 2007 From: balestra at cesmail.net (Marco Balestra) Date: Tue, 17 Apr 2007 20:44:02 +0200 Subject: [Roma.pm] saluti e piccola domanda :) In-Reply-To: <46250866.1080508@gmail.com> References: <4624F919.8000304@gmail.com> <70DC039F-AAF6-47CE-ABB6-60DBA0D6E721@cesmail.net> <46250866.1080508@gmail.com> Message-ID: <03B07009-B4DB-4C6C-96FB-4605875D1396@cesmail.net> On 17/apr/07, at 19:48, LordOfDeath wrote: >> ad ogni occorrenza setto $hash{$chiave}++, alla fine ho sia >> l'elenco senza ripetizioni (keys %hash) che le numerosit? di ogni >> singola occorrenza. > potresti farmi un esempio per favore? grazie in anticipo my @procs = `ps aux`; my %PS; foreach my $line (@procs){ chomp $line; $line =~ s/ [0-9].+$//; $line =~ s/USER.+COMMAND//; $PS{$line}++ if $line; } A questo punto puoi usare %PS, ad esempio: foreach my $k (sort keys %PS) { print "$k is here $PS{$k} times\n"; } -- Marco Balestra IT consultant balestra at cesmail.net From webmaster.staff at gmail.com Tue Apr 17 11:56:08 2007 From: webmaster.staff at gmail.com (LordOfDeath) Date: Tue, 17 Apr 2007 20:56:08 +0200 Subject: [Roma.pm] saluti e piccola domanda :) In-Reply-To: <03B07009-B4DB-4C6C-96FB-4605875D1396@cesmail.net> References: <4624F919.8000304@gmail.com> <70DC039F-AAF6-47CE-ABB6-60DBA0D6E721@cesmail.net> <46250866.1080508@gmail.com> <03B07009-B4DB-4C6C-96FB-4605875D1396@cesmail.net> Message-ID: <46251848.4020009@gmail.com> Marco Balestra ha scritto: > On 17/apr/07, at 19:48, LordOfDeath wrote: > > >>> ad ogni occorrenza setto $hash{$chiave}++, alla fine ho sia >>> l'elenco senza ripetizioni (keys %hash) che le numerosit? di ogni >>> singola occorrenza. >>> >> potresti farmi un esempio per favore? grazie in anticipo >> > > my @procs = `ps aux`; > my %PS; > foreach my $line (@procs){ > chomp $line; > $line =~ s/ [0-9].+$//; > $line =~ s/USER.+COMMAND//; > $PS{$line}++ if $line; > } > > A questo punto puoi usare %PS, ad esempio: > > foreach my $k (sort keys %PS) { > print "$k is here $PS{$k} times\n"; > } > grazie mille :) e grazie a tutti quelli che mi hanno aiutato :) -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/pipermail/roma/attachments/20070417/cf7715ca/attachment.html From oha at oha.it Wed Apr 18 03:06:23 2007 From: oha at oha.it (oha at oha.it) Date: Wed, 18 Apr 2007 12:06:23 +0200 Subject: [Roma.pm] saluti e piccola domanda :) Message-ID: <200704181006.l3IA6NNx028427@chopin04.register-europe.com> visto che non mi sentivo di tornare in questa lista senza un pezzo di codice, ma non ho trovato algoritmi differenti da quelli suggeriti da marco (ciao!) vi propongo almeno una variante di stile: @_ = `ps aux`; shift; map { ($_) = split; $c{$_}++; } @_; map { print "$_ $c{$_}n"; } sort {$c{$b} <=> $c{$a}} keys %c ciao a tutti! Oha From hunternet at alice.it Wed Apr 18 04:02:08 2007 From: hunternet at alice.it (Fabrizio Cardarello) Date: Wed, 18 Apr 2007 13:02:08 +0200 Subject: [Roma.pm] saluti e piccola domanda :) In-Reply-To: <200704181006.l3IA6NNx028427@chopin04.register-europe.com> References: <200704181006.l3IA6NNx028427@chopin04.register-europe.com> Message-ID: <4625FAB0.8010407@alice.it> oha at oha.it wrote: > visto che non mi sentivo di tornare in questa lista senza un pezzo di codice, ma non ho trovato algoritmi differenti da quelli suggeriti da marco (ciao!) vi propongo almeno una variante di stile: > > @_ = `ps aux`; shift; > map { ($_) = split; $c{$_}++; } @_; > map { print "$_ $c{$_}n"; } sort {$c{$b} <=> $c{$a}} keys %c carino!! Fabrizio From d.ortolani at ecosystemspa.com Wed Apr 18 05:11:33 2007 From: d.ortolani at ecosystemspa.com (Ortolani Dante) Date: Wed, 18 Apr 2007 13:11:33 +0100 Subject: [Roma.pm] saluti e piccola domanda :) In-Reply-To: <4625FAB0.8010407@alice.it> References: <200704181006.l3IA6NNx028427@chopin04.register-europe.com> <4625FAB0.8010407@alice.it> Message-ID: <1176894693f5a0a8ehehh69cbnfrnmt1dscmhltibgik8sg535@ecosystemspa.com> va bhe qui qui si lanciano sassi.... /^(\S+)/ && $c{$1}++ for `ps aux --no-headers`; print "$_ $c{$_}n\n" for sort {$c{$b} <=> $c{$a}} keys %c; Saluti [LucaS] > oha at oha.it wrote: > > visto che non mi sentivo di tornare in questa lista senza un pezzo > > di codice, ma non ho trovato algoritmi differenti da quelli > > suggeriti da marco (ciao!) vi propongo almeno una variante di > > stile: > > > > @_ = `ps aux`; shift; map { ($_) = split; $c{$_}++; } @_; map { > > print "$_ $c{$_}n"; } sort {$c{$b} <=> $c{$a}} keys %c > > carino!! Fabrizio > _______________________________________________ > Roma mailing list Roma at pm.org > http://mail.pm.org/mailman/listinfo/roma > > > Luca Dante Ortolani ------------------------------------- Direzione Amministrativa e Commerciale Ecosystem S.p.A. From oha at oha.it Wed Apr 18 05:25:21 2007 From: oha at oha.it (oha at oha.it) Date: Wed, 18 Apr 2007 14:25:21 +0200 Subject: [Roma.pm] saluti e piccola domanda :) Message-ID: <200704181225.l3ICPLfr023118@chopin14.register-europe.com> >/^(S+)/ && $c{$1}++ for `ps aux --no-headers`; >print "$_ $c{$_}nn" for sort {$c{$b} <=> $c{$a}} keys %c; puoi evitare --no-headers con: $_=`ps aux`; s/n(S+)/$c{$1}++/ge; print "$_ $c{$_}nn" for sort {$c{$b} <=> $c{$a}} keys %c; (tra l'altro l'uso del for in questo modo e' disponibile solo con le recenti versioni di perl, IIRW) oppure fare quasi tutto con la shell ps aux --no-headers | perl -ne '($_)=split; print "$_n"' | sort | uniq -c anche se non so se il -c in uniq sia disponibile ovunque e almeno cosi' abbiamo usato anche il fatidico -n di perl :) Oha From oleber at gmail.com Wed Apr 18 05:37:55 2007 From: oleber at gmail.com (marcos rebelo) Date: Wed, 18 Apr 2007 14:37:55 +0200 Subject: [Roma.pm] saluti e piccola domanda :) In-Reply-To: <200704181225.l3ICPLfr023118@chopin14.register-europe.com> References: <200704181225.l3ICPLfr023118@chopin14.register-europe.com> Message-ID: <319d96980704180537n59016bc4vbcdba46f7d5046df@mail.gmail.com> ok try ps aux --no-headers | perl -ple '($_)=split' | sort | uniq -c Marcos On 4/18/07, oha at oha.it wrote: > >/^(S+)/ && $c{$1}++ for `ps aux --no-headers`; > >print "$_ $c{$_}nn" for sort {$c{$b} <=> $c{$a}} keys %c; > > puoi evitare --no-headers con: > $_=`ps aux`; s/n(S+)/$c{$1}++/ge; > print "$_ $c{$_}nn" for sort {$c{$b} <=> $c{$a}} keys %c; > > (tra l'altro l'uso del for in questo modo e' disponibile solo con le recenti versioni di perl, IIRW) > > oppure fare quasi tutto con la shell > > ps aux --no-headers | perl -ne '($_)=split; print "$_n"' | sort | uniq -c > > anche se non so se il -c in uniq sia disponibile ovunque > e almeno cosi' abbiamo usato anche il fatidico -n di perl :) > > Oha > > _______________________________________________ > Roma mailing list > Roma at pm.org > http://mail.pm.org/mailman/listinfo/roma > -- Marcos Rebelo http://oleber.freehostia.com From stamm.bladecaster at gmail.com Wed Apr 18 06:08:40 2007 From: stamm.bladecaster at gmail.com (Aldo Calpini) Date: Wed, 18 Apr 2007 15:08:40 +0200 Subject: [Roma.pm] saluti e piccola domanda :) In-Reply-To: <1176894693f5a0a8ehehh69cbnfrnmt1dscmhltibgik8sg535@ecosystemspa.com> References: <200704181006.l3IA6NNx028427@chopin04.register-europe.com> <4625FAB0.8010407@alice.it> <1176894693f5a0a8ehehh69cbnfrnmt1dscmhltibgik8sg535@ecosystemspa.com> Message-ID: Ortolani Dante wrote: > va bhe qui qui si lanciano sassi.... ps aux | perl -ne '$.-1&&$1{(split)[5]}++;map{print$_.$/if$1{$_}>1}keys%x if eof' :-) cheers, Aldo From stamm.bladecaster at gmail.com Wed Apr 18 06:35:55 2007 From: stamm.bladecaster at gmail.com (Aldo Calpini) Date: Wed, 18 Apr 2007 15:35:55 +0200 Subject: [Roma.pm] saluti e piccola domanda :) In-Reply-To: References: <200704181006.l3IA6NNx028427@chopin04.register-europe.com> <4625FAB0.8010407@alice.it> <1176894693f5a0a8ehehh69cbnfrnmt1dscmhltibgik8sg535@ecosystemspa.com> Message-ID: Aldo Calpini wrote: > ps aux | perl -ne > '$.-1&&$1{(split)[5]}++;map{print$_.$/if$1{$_}>1}keys%x if eof' oops... ps aux | perl -ne '$.-1&&$1{(split)[5]}++;map{print$_.$/if$1{$_}>1}keys%1 if eof' mi fanno anche notare che i ps hanno idee diverse sul numero di colonna nel quale mettere l'UID. il mio ? in sesta colonna, da cui il 5. YMMV. cheers, Aldo From d.ortolani at ecosystemspa.com Wed Apr 18 07:44:59 2007 From: d.ortolani at ecosystemspa.com (Ortolani Dante) Date: Wed, 18 Apr 2007 15:44:59 +0100 Subject: [Roma.pm] saluti e piccola domanda :) In-Reply-To: References: <200704181006.l3IA6NNx028427@chopin04.register-europe.com> <4625FAB0.8010407@alice.it> <1176894693f5a0a8ehehh69cbnfrnmt1dscmhltibgik8sg535@ecosystemspa.com> Message-ID: <1176903899ifbtb9tdel9a31mnaq1pme964ji3ilgqkta8hohs@ecosystemspa.com> > ps aux | perl -ne '$.- > 1&&$1{(split)[5]}++;map{print$_.$/if$1{$_}>1}keys%x if eof' giusto per ricordare "perl -n" ps aux | perl -ne '/^(\S+)/&&$x{$1}++&&eof&&map{print"$_ $x{$_}\n"}keys%x' ;o) LucaS Luca Dante Ortolani ------------------------------------- Direzione Amministrativa e Commerciale Ecosystem S.p.A. From hunternet at alice.it Wed Apr 18 06:47:31 2007 From: hunternet at alice.it (Fabrizio Cardarello) Date: Wed, 18 Apr 2007 15:47:31 +0200 Subject: [Roma.pm] saluti e piccola domanda :) In-Reply-To: References: <200704181006.l3IA6NNx028427@chopin04.register-europe.com> <4625FAB0.8010407@alice.it> <1176894693f5a0a8ehehh69cbnfrnmt1dscmhltibgik8sg535@ecosystemspa.com> Message-ID: <46262173.40207@alice.it> Aldo Calpini wrote: > mi fanno anche notare che i ps hanno idee diverse sul numero di > colonna nel quale mettere l'UID. il mio ? in sesta colonna, da cui il > 5. YMMV. be allora si puo' usare il ps -o e mettere cio' che serve!! ps -eo user :) ciao Fabrizio From d.ortolani at ecosystemspa.com Wed Apr 18 07:52:44 2007 From: d.ortolani at ecosystemspa.com (Ortolani Dante) Date: Wed, 18 Apr 2007 15:52:44 +0100 Subject: [Roma.pm] saluti e piccola domanda :) In-Reply-To: References: <200704181006.l3IA6NNx028427@chopin04.register-europe.com> <4625FAB0.8010407@alice.it> <1176894693f5a0a8ehehh69cbnfrnmt1dscmhltibgik8sg535@ecosystemspa.com> Message-ID: <1176904364plptcmpuum96htfbu36h3ppt01kdl3qeh1soqoe1@ecosystemspa.com> > oops... > > ps aux | perl -ne '$.- > 1&&$1{(split)[5]}++;map{print$_.$/if$1{$_}>1}keys%1 if eof' allora... meglio cos?... ps aux|perl -ne '$.-1&&$1{(split)[5]}++;eof&&map{print"$_ $1{$_}$/"}keys%1' LucaS Luca Dante Ortolani ------------------------------------- Direzione Amministrativa e Commerciale Ecosystem S.p.A. From oha at oha.it Wed Apr 18 06:59:09 2007 From: oha at oha.it (oha at oha.it) Date: Wed, 18 Apr 2007 15:59:09 +0200 Subject: [Roma.pm] saluti e piccola domanda :) Message-ID: <200704181359.l3IDx91G023694@chopin01.register-europe.com> >> va bhe qui qui si lanciano sassi.... >ps aux | perl -ne >'$.-1&&$1{(split)[5]}++;map{print$_.$/if$1{$_}>1}keys%x if eof' trovato un algoritmo diverso (oviamente sfavorevole, ma mooolto piu' divertente) $_ = `ps aux`; s/^.*n/n/; s/(S+).*/$1 1/g; while(s/n(S+) (d+)(.*)n(1) (d+)/"n$1 ".($2+$5).$3;/sge){} print substr $_, 1; Oha From balestra at cesmail.net Wed Apr 18 08:44:51 2007 From: balestra at cesmail.net (Marco Balestra) Date: Wed, 18 Apr 2007 17:44:51 +0200 Subject: [Roma.pm] saluti e piccola domanda :) In-Reply-To: <200704181359.l3IDx91G023694@chopin01.register-europe.com> References: <200704181359.l3IDx91G023694@chopin01.register-europe.com> Message-ID: <9B84A27C-769D-4A5D-AAB4-FF793BA8114D@cesmail.net> On 18/apr/07, at 15:59, wrote: > (oviamente sfavorevole, ma mooolto piu' divertente) E poi dicono male dei perlisti... Avete rotto er cazzo! :-DDDD Bentornato, oha :-) -- Marco Balestra IT consultant balestra at cesmail.net From oha at oha.it Wed Apr 18 08:54:20 2007 From: oha at oha.it (oha at oha.it) Date: Wed, 18 Apr 2007 17:54:20 +0200 Subject: [Roma.pm] saluti e piccola domanda :) Message-ID: <200704181554.l3IFsKLi014953@chopin05.register-europe.com> >E poi dicono male dei perlisti... Avete rotto er cazzo! :-DDDD perche? non ti sei divertito? PS: ho visto che questa bellissima webmail mi mangia i backslash, vi lascio rimetterli come esercizio enigmistico via :) >Bentornato, oha :-) ty :) Oha From d.ortolani at ecosystemspa.com Wed Apr 18 11:04:47 2007 From: d.ortolani at ecosystemspa.com (Ortolani Dante) Date: Wed, 18 Apr 2007 19:04:47 +0100 Subject: [Roma.pm] saluti e piccola domanda :) In-Reply-To: <200704181554.l3IFsKLi014953@chopin05.register-europe.com> References: <200704181554.l3IFsKLi014953@chopin05.register-europe.com> Message-ID: <1176915887ejb9hhf56c1fc1jdg9ge2lrfeqg46ufseiu27q5c@ecosystemspa.com> > PS: ho visto che questa bellissima webmail mi mangia i backslash, vi > lascio rimetterli come esercizio enigmistico via :) e io allora che sono andato a controllare il codice di IGWebMail per capire se c'era qualche problema con i tuoi backslash!?!? LucaS Luca Dante Ortolani ------------------------------------- Direzione Amministrativa e Commerciale Ecosystem S.p.A. From webmaster.staff at gmail.com Thu Apr 19 11:11:37 2007 From: webmaster.staff at gmail.com (LordOfDeath) Date: Thu, 19 Apr 2007 20:11:37 +0200 Subject: [Roma.pm] saluti e piccola domanda :) In-Reply-To: <1176904364plptcmpuum96htfbu36h3ppt01kdl3qeh1soqoe1@ecosystemspa.com> References: <200704181006.l3IA6NNx028427@chopin04.register-europe.com> <4625FAB0.8010407@alice.it> <1176894693f5a0a8ehehh69cbnfrnmt1dscmhltibgik8sg535@ecosystemspa.com> <1176904364plptcmpuum96htfbu36h3ppt01kdl3qeh1soqoe1@ecosystemspa.com> Message-ID: <4627B0D9.9020502@gmail.com> Ortolani Dante ha scritto: >> oops... >> >> ps aux | perl -ne '$.- >> 1&&$1{(split)[5]}++;map{print$_.$/if$1{$_}>1}keys%1 if eof' >> > > allora... meglio cos?... > > ps aux|perl -ne > '$.-1&&$1{(split)[5]}++;eof&&map{print"$_ $1{$_}$/"}keys%1' > > LucaS > > Luca Dante Ortolani > ------------------------------------- > Direzione Amministrativa e Commerciale > Ecosystem S.p.A. > _______________________________________________ > Roma mailing list > Roma at pm.org > http://mail.pm.org/mailman/listinfo/roma > > siete paurosi :) From flavio at polettix.it Thu Apr 19 18:12:28 2007 From: flavio at polettix.it (Flavio Poletti) Date: Fri, 20 Apr 2007 03:12:28 +0200 (CEST) Subject: [Roma.pm] saluti e piccola domanda :) In-Reply-To: <1176904364plptcmpuum96htfbu36h3ppt01kdl3qeh1soqoe1@ecosystemspa.com> References: <200704181006.l3IA6NNx028427@chopin04.register-europe.com> <4625FAB0.8010407@alice.it> <1176894693f5a0a8ehehh69cbnfrnmt1dscmhltibgik8sg535@ecosystemspa.com> <1176904364plptcmpuum96htfbu36h3ppt01kdl3qeh1soqoe1@ecosystemspa.com> Message-ID: <33105.213.203.159.164.1177031548.squirrel@upmail.polettix.it> Dove eravamo? ps aux|perl -lane '$.-1&&$1{$F[5]}++}{map{print"$_ $1{$_}"}keys%1' >> oops... >> >> ps aux | perl -ne '$.- >> 1&&$1{(split)[5]}++;map{print$_.$/if$1{$_}>1}keys%1 if eof' > > allora... meglio cos?... > > ps aux|perl -ne > '$.-1&&$1{(split)[5]}++;eof&&map{print"$_ $1{$_}$/"}keys%1' > > LucaS > > Luca Dante Ortolani > ------------------------------------- > Direzione Amministrativa e Commerciale > Ecosystem S.p.A. > _______________________________________________ > Roma mailing list > Roma at pm.org > http://mail.pm.org/mailman/listinfo/roma > From oleber at gmail.com Fri Apr 20 00:14:51 2007 From: oleber at gmail.com (marcos rebelo) Date: Fri, 20 Apr 2007 09:14:51 +0200 Subject: [Roma.pm] Sono arrivato a Roma Message-ID: <319d96980704200014l1d850857v8bfc11d48d2fa22b@mail.gmail.com> Hy all I have moved to Rome and I'm curios to see what is this group doing. Let me present myself. Portuguese, 34 working with Perl, C/C++ and Java. Doing a little bit of everything. I'm actually working in Rome, I was lucky. Note: I can consider another offer it it is really good. See you around Marcos Rebelo -- Marcos Rebelo http://oleber.freehostia.com From balestra at cesmail.net Fri Apr 20 00:46:40 2007 From: balestra at cesmail.net (Marco Balestra) Date: Fri, 20 Apr 2007 09:46:40 +0200 Subject: [Roma.pm] Sono arrivato a Roma In-Reply-To: <319d96980704200014l1d850857v8bfc11d48d2fa22b@mail.gmail.com> References: <319d96980704200014l1d850857v8bfc11d48d2fa22b@mail.gmail.com> Message-ID: <0BD28A3F-D353-499C-A073-513807BD075A@cesmail.net> On 20/apr/07, at 09:14, marcos rebelo wrote: > I have moved to Rome and I'm curios to see what is this group doing. it's Rome Perl Mongers, then we're talking about perlish and porchetta... what else? :-D Please note that the most part of our mail will use Italian (except for perlish portions, of course), or at least the revision of Italian language so called "Roman" :-) > Let me present myself. Portuguese, 34 working with Perl, C/C++ and > Java. Doing a little bit of everything. I'm actually working in Rome, > I was lucky. Next step: Italian :-) In my experience people from Portugal and Brazil are very clever with foreign languages, I dunno why. > Note: I can consider another offer it it is really good. Subscribed, now and forever :-D -- Marco Balestra IT consultant balestra at cesmail.net From boxlinux at gmail.com Fri Apr 20 01:27:36 2007 From: boxlinux at gmail.com (alex at boxlinux) Date: Fri, 20 Apr 2007 09:27:36 +0100 Subject: [Roma.pm] Sono arrivato a Roma In-Reply-To: <319d96980704200014l1d850857v8bfc11d48d2fa22b@mail.gmail.com> References: <319d96980704200014l1d850857v8bfc11d48d2fa22b@mail.gmail.com> Message-ID: <75030ba0704200127n3f651481p320088974da77b98@mail.gmail.com> 2007/4/20, marcos rebelo : > Hy all > > I have moved to Rome and I'm curios to see what is this group doing. > > Let me present myself. Portuguese, 34 working with Perl, C/C++ and > Java. Doing a little bit of everything. I'm actually working in Rome, > I was lucky. > > Note: I can consider another offer it it is really good. > > See you around > Marcos Rebelo > > -- > Marcos Rebelo > http://oleber.freehostia.com > is it interesting some italians go in ireland some portuguese go to italy. the IT technician move very fast now in across europe. P.S dico ma che ce sta la migrazione de massa de tecnici in giro per l'europa? ---------------------------------------------------------------- Alessio Porcacchia Debian Consultant www.debian.org/consultants/porcacchia mobile +353873259473 ------------------------------------------------------------------ From oleber at gmail.com Fri Apr 20 01:33:13 2007 From: oleber at gmail.com (marcos rebelo) Date: Fri, 20 Apr 2007 10:33:13 +0200 Subject: [Roma.pm] Sono arrivato a Roma In-Reply-To: <0BD28A3F-D353-499C-A073-513807BD075A@cesmail.net> References: <319d96980704200014l1d850857v8bfc11d48d2fa22b@mail.gmail.com> <0BD28A3F-D353-499C-A073-513807BD075A@cesmail.net> Message-ID: <319d96980704200133i468c2fe5ufb979531edeb75e4@mail.gmail.com> On 4/20/07, Marco Balestra wrote: > On 20/apr/07, at 09:14, marcos rebelo wrote: > > > I have moved to Rome and I'm curios to see what is this group doing. > > it's Rome Perl Mongers, then we're talking about perlish and > porchetta... what else? :-D > > Please note that the most part of our mail will use Italian (except > for perlish portions, of course), or at least the revision of Italian > language so called "Roman" :-) I started this week to study Italian (not Roman) but I can understand what you are writing. > > Let me present myself. Portuguese, 34 working with Perl, C/C++ and > > Java. Doing a little bit of everything. I'm actually working in Rome, > > I was lucky. > > Next step: Italian :-) > > In my experience people from Portugal and Brazil are very clever with > foreign languages, I dunno why. English for people is +- like C for Perl. It's called the "Lingua franca". > > > Note: I can consider another offer it it is really good. > > Subscribed, now and forever :-D > -- > Marco Balestra > IT consultant > balestra at cesmail.net > > > > _______________________________________________ > Roma mailing list > Roma at pm.org > http://mail.pm.org/mailman/listinfo/roma > -- Marcos Rebelo http://oleber.freehostia.com From d.ortolani at ecosystemspa.com Fri Apr 20 02:39:35 2007 From: d.ortolani at ecosystemspa.com (Ortolani Dante) Date: Fri, 20 Apr 2007 10:39:35 +0100 Subject: [Roma.pm] saluti e piccola domanda :) In-Reply-To: <33105.213.203.159.164.1177031548.squirrel@upmail.polettix.it> References: <200704181006.l3IA6NNx028427@chopin04.register-europe.com> <4625FAB0.8010407@alice.it> <1176894693f5a0a8ehehh69cbnfrnmt1dscmhltibgik8sg535@ecosystemspa.com> <1176904364plptcmpuum96htfbu36h3ppt01kdl3qeh1soqoe1@ecosystemspa.com> <33105.213.203.159.164.1177031548.squirrel@upmail.polettix.it> Message-ID: <11770583750ft4dbebqb1nrg818mola2p4ogdr9ngnk363hsl6@ecosystemspa.com> Grande Flavio! e questo ci ricorda che sarebbe bene dare una sbirciata a "man perlrun" ogni tanto. Pero' se parliamo di golf dobbiamo rubare ancora qualche carattere per cui la forma pi? corta ? questa (anche se l'uso di map era pi? fico!): ps aux|perl -lane'$.-1&&$1{$F[5]}++}{print"$_ $1{$_}" for keys%1' LucaS P.s. siamo partiti con una lista ordinata quindi sarebbe pi? corretto un "for sort keys%1" > Dove eravamo? > ps aux|perl -lane '$.-1&&$1{$F[5]}++}{map{print"$_ $1{$_}"}keys%1' > >> oops... > >> ps aux | perl -ne '$.- > >> 1&&$1{(split)[5]}++;map{print$_.$/if$1{$_}>1}keys%1 if eof' > > allora... meglio cos?... > > ps aux|perl -ne '$.-1&&$1{(split)[5]}++;eof&&map{print"$_ > > $1{$_}$/"}keys%1' Luca Dante Ortolani ------------------------------------- Direzione Amministrativa e Commerciale Ecosystem S.p.A. From oleber at gmail.com Fri Apr 20 01:39:45 2007 From: oleber at gmail.com (marcos rebelo) Date: Fri, 20 Apr 2007 10:39:45 +0200 Subject: [Roma.pm] Sono arrivato a Roma In-Reply-To: <75030ba0704200127n3f651481p320088974da77b98@mail.gmail.com> References: <319d96980704200014l1d850857v8bfc11d48d2fa22b@mail.gmail.com> <75030ba0704200127n3f651481p320088974da77b98@mail.gmail.com> Message-ID: <319d96980704200139s64e06b9fg2afd37aa47b7dcf0@mail.gmail.com> On 4/20/07, alex at boxlinux wrote: > 2007/4/20, marcos rebelo : > > Hy all > > > > I have moved to Rome and I'm curios to see what is this group doing. > > > > Let me present myself. Portuguese, 34 working with Perl, C/C++ and > > Java. Doing a little bit of everything. I'm actually working in Rome, > > I was lucky. > > > > Note: I can consider another offer it it is really good. > > > > See you around > > Marcos Rebelo > > > > -- > > Marcos Rebelo > > http://oleber.freehostia.com > > > is it interesting some italians go in ireland some portuguese go to italy. > the IT technician move very fast now in across europe. > > P.S > dico ma che ce sta la migrazione de massa de tecnici in giro per l'europa? I have to be honest, professionally speaking I'd prefer to be in Portugal. But my girlfriend cannot get a job there :'( So I got one in here :) > ---------------------------------------------------------------- > Alessio Porcacchia Debian Consultant > www.debian.org/consultants/porcacchia > mobile +353873259473 > ------------------------------------------------------------------ > _______________________________________________ > Roma mailing list > Roma at pm.org > http://mail.pm.org/mailman/listinfo/roma > -- Marcos Rebelo http://oleber.freehostia.com From boxlinux at gmail.com Fri Apr 20 01:50:01 2007 From: boxlinux at gmail.com (alex at boxlinux) Date: Fri, 20 Apr 2007 09:50:01 +0100 Subject: [Roma.pm] Sono arrivato a Roma In-Reply-To: <319d96980704200139s64e06b9fg2afd37aa47b7dcf0@mail.gmail.com> References: <319d96980704200014l1d850857v8bfc11d48d2fa22b@mail.gmail.com> <75030ba0704200127n3f651481p320088974da77b98@mail.gmail.com> <319d96980704200139s64e06b9fg2afd37aa47b7dcf0@mail.gmail.com> Message-ID: <75030ba0704200150x40df59dfl145ffe1a651b77d4@mail.gmail.com> 2007/4/20, marcos rebelo : > On 4/20/07, alex at boxlinux wrote: > > 2007/4/20, marcos rebelo : > > > Hy all > > > > > > I have moved to Rome and I'm curios to see what is this group doing. > > > > > > Let me present myself. Portuguese, 34 working with Perl, C/C++ and > > > Java. Doing a little bit of everything. I'm actually working in Rome, > > > I was lucky. > > > > > > Note: I can consider another offer it it is really good. > > > > > > See you around > > > Marcos Rebelo > > > > > > -- > > > Marcos Rebelo > > > http://oleber.freehostia.com > > > > > is it interesting some italians go in ireland some portuguese go to italy. > > the IT technician move very fast now in across europe. > > > > P.S > > dico ma che ce sta la migrazione de massa de tecnici in giro per l'europa? > > I have to be honest, professionally speaking I'd prefer to be in > Portugal. But my girlfriend cannot get a job there :'( > > So I got one in here :) > ehi man i know that is difficult to move in another country but this is our work and now is very normally at the moment that many IT Techincian move and transfer across the europe. In italy the coffe is good and you will find a good IT experts don't worry :) ---------------------------------------------------------------- Alessio Porcacchia Debian Consultant www.debian.org/consultants/porcacchia mobile +353873259473 ------------------------------------------------------------------ From oleber at gmail.com Fri Apr 20 01:55:38 2007 From: oleber at gmail.com (marcos rebelo) Date: Fri, 20 Apr 2007 10:55:38 +0200 Subject: [Roma.pm] Sono arrivato a Roma In-Reply-To: <75030ba0704200150x40df59dfl145ffe1a651b77d4@mail.gmail.com> References: <319d96980704200014l1d850857v8bfc11d48d2fa22b@mail.gmail.com> <75030ba0704200127n3f651481p320088974da77b98@mail.gmail.com> <319d96980704200139s64e06b9fg2afd37aa47b7dcf0@mail.gmail.com> <75030ba0704200150x40df59dfl145ffe1a651b77d4@mail.gmail.com> Message-ID: <319d96980704200155r231a06f9y554382b309d07b40@mail.gmail.com> On 4/20/07, alex at boxlinux wrote: > 2007/4/20, marcos rebelo : > > On 4/20/07, alex at boxlinux wrote: > > > 2007/4/20, marcos rebelo : > > > > Hy all > > > > > > > > I have moved to Rome and I'm curios to see what is this group doing. > > > > > > > > Let me present myself. Portuguese, 34 working with Perl, C/C++ and > > > > Java. Doing a little bit of everything. I'm actually working in Rome, > > > > I was lucky. > > > > > > > > Note: I can consider another offer it it is really good. > > > > > > > > See you around > > > > Marcos Rebelo > > > > > > > > -- > > > > Marcos Rebelo > > > > http://oleber.freehostia.com > > > > > > > is it interesting some italians go in ireland some portuguese go to italy. > > > the IT technician move very fast now in across europe. > > > > > > P.S > > > dico ma che ce sta la migrazione de massa de tecnici in giro per l'europa? > > > > I have to be honest, professionally speaking I'd prefer to be in > > Portugal. But my girlfriend cannot get a job there :'( > > > > So I got one in here :) > > > > ehi man i know that is difficult to move in another country but this > is our work and now is very normally at the moment that many IT > Techincian move and transfer across the europe. > > In italy the coffe is good > and you will find a good IT experts don't worry :) I'm hopping to find them in here :) > ---------------------------------------------------------------- > Alessio Porcacchia Debian Consultant > www.debian.org/consultants/porcacchia > mobile +353873259473 > ------------------------------------------------------------------ > _______________________________________________ > Roma mailing list > Roma at pm.org > http://mail.pm.org/mailman/listinfo/roma > -- Marcos Rebelo http://oleber.freehostia.com From flavio at polettix.it Fri Apr 20 06:00:54 2007 From: flavio at polettix.it (Flavio Poletti) Date: Fri, 20 Apr 2007 15:00:54 +0200 (CEST) Subject: [Roma.pm] saluti e piccola domanda :) In-Reply-To: <11770583750ft4dbebqb1nrg818mola2p4ogdr9ngnk363hsl6@ecosystemspa.com> References: <200704181006.l3IA6NNx028427@chopin04.register-europe.com> <4625FAB0.8010407@alice.it> <1176894693f5a0a8ehehh69cbnfrnmt1dscmhltibgik8sg535@ecosystemspa.com> <1176904364plptcmpuum96htfbu36h3ppt01kdl3qeh1soqoe1@ecosystemspa.com> <33105.213.203.159.164.1177031548.squirrel@upmail.polettix.it> <11770583750ft4dbebqb1nrg818mola2p4ogdr9ngnk363hsl6@ecosystemspa.com> Message-ID: <65456.129.192.97.5.1177074054.squirrel@upmail.polettix.it> Ti sei lasciato sfuggire lo spazio prima del for! ps aux | perl -lane '$.-1&&$1{$F[5]}++}{print"$_ $1{$_}"for keys%1' L'ordinamento non mi sembra cos? necessario, ma se proprio lo fosse probabilmente andrebbe fatto numerico e non lessicografico: for sort{$a<=>$b}keys%1 > Grande Flavio! e questo ci ricorda che sarebbe bene dare una sbirciata > a "man perlrun" ogni tanto. > > Pero' se parliamo di golf dobbiamo rubare ancora qualche carattere per > cui la forma pi? corta ? questa (anche se l'uso di map era pi? fico!): > > ps aux|perl -lane'$.-1&&$1{$F[5]}++}{print"$_ $1{$_}" for keys%1' > > LucaS > P.s. siamo partiti con una lista ordinata quindi sarebbe pi? corretto > un "for sort keys%1" > > >> Dove eravamo? >> ps aux|perl -lane '$.-1&&$1{$F[5]}++}{map{print"$_ $1{$_}"}keys%1' > >> >> oops... >> >> ps aux | perl -ne '$.- >> >> 1&&$1{(split)[5]}++;map{print$_.$/if$1{$_}>1}keys%1 if eof' > >> > allora... meglio cos?... >> > ps aux|perl -ne '$.-1&&$1{(split)[5]}++;eof&&map{print"$_ >> > $1{$_}$/"}keys%1' > > > Luca Dante Ortolani > ------------------------------------- > Direzione Amministrativa e Commerciale > Ecosystem S.p.A. > _______________________________________________ > Roma mailing list > Roma at pm.org > http://mail.pm.org/mailman/listinfo/roma > From oha at oha.it Mon Apr 23 04:05:19 2007 From: oha at oha.it (Oha) Date: Mon, 23 Apr 2007 13:05:19 +0200 Subject: [Roma.pm] saluti e piccola domanda :) Message-ID: <200704231105.l3NB5J3h029342@vivaldi12.register.it> >L'ordinamento non mi sembra cos? necessario, ma se proprio lo fosse >probabilmente andrebbe fatto numerico e non lessicografico: > for sort{$a<=>$b}keys%1 le chiavi contengono lo username se vuoi fare l'ordinamento per numero di processi devi quindi sort {$1{$b} <=> $1{$a}} Oha From flavio at polettix.it Mon Apr 23 05:40:15 2007 From: flavio at polettix.it (Flavio Poletti) Date: Mon, 23 Apr 2007 14:40:15 +0200 (CEST) Subject: [Roma.pm] saluti e piccola domanda :) In-Reply-To: <200704231105.l3NB5J3h029342@vivaldi12.register.it> References: <200704231105.l3NB5J3h029342@vivaldi12.register.it> Message-ID: <39483.129.192.97.5.1177332015.squirrel@upmail.polettix.it> Uhm, allora mi sa che sul mio sistema non sto beccando la colonna giusta, visto che ho due colonne numeriche. Sinceramente mi aveva stuzzicato la parte golfistica, ed avevo perso di vista il problema originale :D Ciao, Flavio. >>L'ordinamento non mi sembra cos? necessario, ma se proprio lo fosse >>probabilmente andrebbe fatto numerico e non lessicografico: >> for sort{$a<=>$b}keys%1 > > le chiavi contengono lo username > > se vuoi fare l'ordinamento per numero di processi devi quindi > sort {$1{$b} <=> $1{$a}} > > Oha > > _______________________________________________ > Roma mailing list > Roma at pm.org > http://mail.pm.org/mailman/listinfo/roma > From webmaster.staff at gmail.com Tue Apr 24 11:48:07 2007 From: webmaster.staff at gmail.com (LordOfDeath) Date: Tue, 24 Apr 2007 20:48:07 +0200 Subject: [Roma.pm] maledetti array! Message-ID: <462E50E7.10206@gmail.com> ciao a todos, da tutto oggi che cerco la funzione in perl che mi dice che se nell'array @numeri=("1","2","34"); (numeri presi a caso) mi dica qual'? il pi? grande... vorrei evitare di fare i foreach, sperando che ci sia una funzione apposita :( saluti a todos, grazie!! From a.r.ferreira at gmail.com Tue Apr 24 11:58:23 2007 From: a.r.ferreira at gmail.com (Adriano Ferreira) Date: Tue, 24 Apr 2007 15:58:23 -0300 Subject: [Roma.pm] maledetti array! In-Reply-To: <462E50E7.10206@gmail.com> References: <462E50E7.10206@gmail.com> Message-ID: <73ddeb6c0704241158g571a55f0sbe98130be704c00c@mail.gmail.com> On 4/24/07, LordOfDeath wrote: > ciao a todos, da tutto oggi che cerco la funzione in perl che mi dice > che se nell'array @numeri=("1","2","34"); (numeri presi a caso) mi dica > qual'? il pi? grande... vorrei evitare di fare i foreach, sperando che > ci sia una funzione apposita :( saluti a todos, grazie!! use List::Util qw(max); $max = max(@numeri) Leggere la documentazione a http://search.cpan.org/~gbarr/Scalar-List-Utils-1.19/lib/List/Util.pm o http://perldoc.perl.org/List/Util.html > _______________________________________________ > Roma mailing list > Roma at pm.org > http://mail.pm.org/mailman/listinfo/roma > From webmaster.staff at gmail.com Tue Apr 24 12:04:23 2007 From: webmaster.staff at gmail.com (LordOfDeath) Date: Tue, 24 Apr 2007 21:04:23 +0200 Subject: [Roma.pm] maledetti array! In-Reply-To: <73ddeb6c0704241158g571a55f0sbe98130be704c00c@mail.gmail.com> References: <462E50E7.10206@gmail.com> <73ddeb6c0704241158g571a55f0sbe98130be704c00c@mail.gmail.com> Message-ID: <462E54B7.1060006@gmail.com> Adriano Ferreira ha scritto: > On 4/24/07, LordOfDeath wrote: > >> ciao a todos, da tutto oggi che cerco la funzione in perl che mi dice >> che se nell'array @numeri=("1","2","34"); (numeri presi a caso) mi dica >> qual'? il pi? grande... vorrei evitare di fare i foreach, sperando che >> ci sia una funzione apposita :( saluti a todos, grazie!! >> > > use List::Util qw(max); > > $max = max(@numeri) > > Leggere la documentazione a > http://search.cpan.org/~gbarr/Scalar-List-Utils-1.19/lib/List/Util.pm > o > http://perldoc.perl.org/List/Util.html > > > >> _______________________________________________ >> Roma mailing list >> Roma at pm.org >> http://mail.pm.org/mailman/listinfo/roma >> >> > _______________________________________________ > Roma mailing list > Roma at pm.org > http://mail.pm.org/mailman/listinfo/roma > > grazie mille!!!!! era proprio quello che mi serviva!!! :) -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/pipermail/roma/attachments/20070424/38e704e0/attachment.html From flavio at polettix.it Wed Apr 25 02:16:23 2007 From: flavio at polettix.it (Flavio Poletti) Date: Wed, 25 Apr 2007 11:16:23 +0200 (CEST) Subject: [Roma.pm] Perl REPL [Was: Re: un saluto a tutti] In-Reply-To: <73ddeb6c0611271106u50402cc4h713e3308e95d4f88@mail.gmail.com> References: <75030ba0611270703s759cd636gc0c24629dc6f6cfb@mail.gmail.com> <73ddeb6c0611271106u50402cc4h713e3308e95d4f88@mail.gmail.com> Message-ID: <32847.213.203.159.164.1177492583.squirrel@upmail.polettix.it> Ciao, ravanando fra i link su perl.it ho trovato questo articolo che mi sembra pertinente (esistono anche le parti 2 e 3): http://chainsawblues.vox.com/library/post/a-perl-read-excute-print-loop-repl.html (spero che l'email non spezzi il link :) La conclusione immediata ? che al momento non esiste un REPL per Perl... ma che esister? fra poco! In ogni caso nell'articolo si fa riferimento a qualche modulo, magari ti ? gi? utile. Ciao, Flavio. > Sono nuovo qui anche. Conosco quasi niente di italiano ed un po'di Perl. > > ? ci qualcuno che sappia circa uno read-eval-print loop per Perl? Come > irb per Ruby? > > Saluti a questa lista. > > Adriano Ferreira > > On 11/27/06, alex at boxlinux wrote: >> Sono nuovo da queste parti vorrei salutare comunque tutti. >> nella speranza se non altro di non appesantire banda con inutili >> messaggi >> come codesto :D >> >> A.P. >> _______________________________________________ >> Roma mailing list >> Roma at pm.org >> http://mail.pm.org/mailman/listinfo/roma >> >> > _______________________________________________ > Roma mailing list > Roma at pm.org > http://mail.pm.org/mailman/listinfo/roma > From a.r.ferreira at gmail.com Wed Apr 25 04:18:33 2007 From: a.r.ferreira at gmail.com (Adriano Ferreira) Date: Wed, 25 Apr 2007 08:18:33 -0300 Subject: [Roma.pm] Perl REPL [Was: Re: un saluto a tutti] In-Reply-To: <32847.213.203.159.164.1177492583.squirrel@upmail.polettix.it> References: <75030ba0611270703s759cd636gc0c24629dc6f6cfb@mail.gmail.com> <73ddeb6c0611271106u50402cc4h713e3308e95d4f88@mail.gmail.com> <32847.213.203.159.164.1177492583.squirrel@upmail.polettix.it> Message-ID: <73ddeb6c0704250418l1ae6fe1avf11491c7b821fafd@mail.gmail.com> On 4/25/07, Flavio Poletti wrote: > Ciao, > > ravanando fra i link su perl.it ho trovato questo articolo che mi > sembra pertinente (esistono anche le parti 2 e 3): > > http://chainsawblues.vox.com/library/post/a-perl-read-excute-print-loop-repl.html > > (spero che l'email non spezzi il link :) > > La conclusione immediata ? che al momento non esiste un REPL per Perl... > ma che esister? fra poco! In ogni caso nell'articolo si fa riferimento a > qualche modulo, magari ti ? gi? utile. Ma no. Ci ? Shell::Perl ed App::REPL (como mencionado nell'articolo). Shell::Perl ? iniziato dopo le risposte Aldo Calpini mi abbiano dato a questa lista. Non ? completo, ma funziona. ? un "work in progress". http://search.cpan.org/author/FERREIRA/Shell-Perl-0.0010/lib/Shell/Perl.pm http://search.cpan.org/author/AYRNIEU/App-REPL-0.012/lib/App/REPL.pm > Ciao, > Flavio. > > > Sono nuovo qui anche. Conosco quasi niente di italiano ed un po'di Perl. > > > > ? ci qualcuno che sappia circa uno read-eval-print loop per Perl? Come > > irb per Ruby? > > > > Saluti a questa lista. > > > > Adriano Ferreira > > > > On 11/27/06, alex at boxlinux wrote: > >> Sono nuovo da queste parti vorrei salutare comunque tutti. > >> nella speranza se non altro di non appesantire banda con inutili > >> messaggi > >> come codesto :D > >> > >> A.P. > >> _______________________________________________ > >> Roma mailing list > >> Roma at pm.org > >> http://mail.pm.org/mailman/listinfo/roma > >> > >> > > _______________________________________________ > > Roma mailing list > > Roma at pm.org > > http://mail.pm.org/mailman/listinfo/roma > > > > > _______________________________________________ > Roma mailing list > Roma at pm.org > http://mail.pm.org/mailman/listinfo/roma > From flavio at polettix.it Thu Apr 26 01:13:54 2007 From: flavio at polettix.it (Flavio Poletti) Date: Thu, 26 Apr 2007 10:13:54 +0200 (CEST) Subject: [Roma.pm] Perl REPL [Was: Re: un saluto a tutti] In-Reply-To: <73ddeb6c0704250418l1ae6fe1avf11491c7b821fafd@mail.gmail.com> References: <75030ba0611270703s759cd636gc0c24629dc6f6cfb@mail.gmail.com> <73ddeb6c0611271106u50402cc4h713e3308e95d4f88@mail.gmail.com> <32847.213.203.159.164.1177492583.squirrel@upmail.polettix.it> <73ddeb6c0704250418l1ae6fe1avf11491c7b821fafd@mail.gmail.com> Message-ID: <33621.213.203.159.164.1177575234.squirrel@upmail.polettix.it> > On 4/25/07, Flavio Poletti wrote: >> Ciao, >> >> ravanando fra i link su perl.it ho trovato questo articolo che mi >> sembra pertinente (esistono anche le parti 2 e 3): >> >> http://chainsawblues.vox.com/library/post/a-perl-read-excute-print-loop-repl.html >> >> (spero che l'email non spezzi il link :) >> >> La conclusione immediata ? che al momento non esiste un REPL per Perl... >> ma che esister? fra poco! In ogni caso nell'articolo si fa riferimento a >> qualche modulo, magari ti ? gi? utile. > > Ma no. Ci ? Shell::Perl ed App::REPL (como mencionado nell'articolo). > Shell::Perl ? iniziato dopo le risposte Aldo Calpini mi abbiano dato > a questa lista. Non ? completo, ma funziona. ? un "work in progress". > > http://search.cpan.org/author/FERREIRA/Shell-Perl-0.0010/lib/Shell/Perl.pm > http://search.cpan.org/author/AYRNIEU/App-REPL-0.012/lib/App/REPL.pm > Wow, non avevo visto che Shell::Perl era tuo! Sostanzialmente, ho visto che la "critica" al tuo modulo ? che "uses package variables to persist data between lines (think namespaced globals)" (non so se il tuo modulo ? "easy to extend" o no). Ti va di spiegarci il problema? :-) Ciao, Flavio. From a.r.ferreira at gmail.com Fri Apr 27 03:04:04 2007 From: a.r.ferreira at gmail.com (Adriano Ferreira) Date: Fri, 27 Apr 2007 07:04:04 -0300 Subject: [Roma.pm] Perl REPL [Was: Re: un saluto a tutti] In-Reply-To: <33621.213.203.159.164.1177575234.squirrel@upmail.polettix.it> References: <75030ba0611270703s759cd636gc0c24629dc6f6cfb@mail.gmail.com> <73ddeb6c0611271106u50402cc4h713e3308e95d4f88@mail.gmail.com> <32847.213.203.159.164.1177492583.squirrel@upmail.polettix.it> <73ddeb6c0704250418l1ae6fe1avf11491c7b821fafd@mail.gmail.com> <33621.213.203.159.164.1177575234.squirrel@upmail.polettix.it> Message-ID: <73ddeb6c0704270304w61bac4aem945b816404a2aff3@mail.gmail.com> On 4/26/07, Flavio Poletti wrote: > Wow, non avevo visto che Shell::Perl era tuo! Sostanzialmente, ho visto > che la "critica" al tuo modulo ? che "uses package variables to persist > data between lines (think namespaced globals)" (non so se il tuo modulo ? > "easy to extend" o no). Ti va di spiegarci il problema? :-) Prover? a spiegare il mio punto di vista. Ma devo scusarmi perch? non potr? dire a quello in italiano senza danneggiare ogni altoparlante italiano qui. Allora risparmier? da tale dolore (a me ed a voi) e scriver? in inglese. I will try to explain my point of view. I don't share the idea that "using package variables to persist data between lines" is such a bad thing. This is just what you expect from getting together the lines of code into a script to be fed to the Perl interpreter. The package is a natural thing, just so the 'main' package is used in a simple script and the undeclared variables (when using " no strict 'vars' ") end up as package variables. The REPL is a tool for experimentation -- it should be handy. And declarations for one-shot code does not seem handy too me. So by default Shell::Perl allows: $ pirl Welcome to the Perl shell. Type ':help' for more information pirl @> $a = 2 2 pirl @> $b = 2 + $a 4 pirl @> __PACKAGE__ "Shell::Perl::sandbox" and these variables may be found in the default package Shell::Perl uses (in this case, "Shell::Perl::sandbox"). What the blogger (Matt Trout) was behind was a more strict REPL, where he would say $ pirl Welcome to the Perl shell. Type ':help' for more information pirl @> my $a = 2 2 pirl @> my $b = 2 + $a 4 and that works today if you replace "my" by "our". I will introduce a change so that a user can made that strictness required. For the reasons I pointed out above, "no strict qw(vars subs)" is used to be easier to type things into the REPL. But it will not be hard to replace that with "use strict;" if the user wants to declare every variable. But with "our", the variables are package variables yet and if they make you sad as it seems the case with Matt, you must extend the scope of 'my' variables beyound the current lines. In the actual Shell::Perl, it is a feature of eval that the 'my' variables last for the length of the line and then go away. This is another (optional) configuration I will introduce (but I have to experiment with it first): the loop will use Devel::EvalContext to extend the lexical environment through many input lines. In this case, the lines above could be typed directly into the shell prompt with the expected results. But as I insisted, the REPL is supposed to a very simple way to run Perl statements interactively and, in this regard, there is nothing wrong about package variables. And, at least, you can wipe our your sandbox package with pirl @> :reset pirl @> \%Shell::Perl::sandbox:: { "BEGIN" => *Shell::Perl::sandbox::BEGIN } I don't know how much extensibility I will try to implement into Shell::Perl. It does a very definite task: reads - evals - prints and I thing that (at least with respect to this main objective) it may be quite complete once the module is more mature and very few features would be necessary or desirable when you consider the trade-offs of keeping the REPL simple and functional. I don't see many people interested in extending a Perl REPL once it works ok (that means once it does a good job reading, evaling and printing Perl expressions/statements). But the code will always be there as an open-source project and I will be open to suggestions and contributions. I posted a comment in the blog http://chainsawblues.vox.com/library/post/a-perl-read-excute-print-loop-repl.html#comment-6a00cd971ce84f4cd500d4142e9a006a47 but Matt is really right about the advantage of avoiding typos in variable names. Nevertheless if you're lazy, you won't try to use too long variable names in a shell that you can't glance at some occasional typo. Well, that's it! > Ciao, > > Flavio.