diff --git a/translations/italian/chapter_12.pod b/translations/italian/chapter_12.pod old mode 100644 new mode 100755 index 375bc4c8..c6ad9380 --- a/translations/italian/chapter_12.pod +++ b/translations/italian/chapter_12.pod @@ -2,14 +2,10 @@ =head0 Cosa Manca -Perl5 non è perfetto, almeno nei suoi comportamenti di default. Alcune -opzioni sono disponibili nel linguaggio, molte altre si possono trovare su -CPAN. I programmatori Perl esperti hanno ciascuno la propria idea di come -dovrebbe comportarsi un Perl 5 ideale e spesso utilizzano le proprie -configurazioni in maniera molto efficace. - -I neofiti posono non sapere come essere aiutati da Perl a scrivere meglio -i programmi. C'è una manciata di moduli base che vi renderanno molto più -produttivi. +Perl5 non è perfetto, ma è malleabile--in parte perchè non esiste un'unica +configurazione ideale per ogni programmatore e ogni obiettivo. Alcuni comportamenti +utili sono disponibili nelle librerie distribuite con Perl. Altri sono disponibili su CPAN. +La vostra efficacia come programmatore Perl dipende da quanto sapete avvantaggiarvi di queste +aggiunte. L diff --git a/translations/italian/missing_defaults.pod b/translations/italian/missing_defaults.pod old mode 100644 new mode 100755 index 8e20332c..966b6354 --- a/translations/italian/missing_defaults.pod +++ b/translations/italian/missing_defaults.pod @@ -1,117 +1,99 @@ -=head1 Missing Defaults +=head1 Default Mancanti Z -Perl 5's design process in 1993 and 1994 tried to anticipate new directions for -the language, but it's impossible to predict the future. Perl 5 added many -great new features, but it also kept compatibility with the previous seven -years of Perl 1 through Perl 4. Sixteen years later, the best way to write -clean, maintainable, powerful, and succinct Perl 5 code is very different from -Perl 5.000. The default behaviors sometimes get in the way; fortunately, -better behaviors are available. +La progettazione di Perl 5 ha tentato di anticipare le nuove direzioni del linguaggio, +ma era altrettanto impossibile predire il futuro nel 1994 come lo è nel 2011. Perl 5 +ha espanso il linguaggio, ma è rimasto compatibile con Perl 1 del 1987. -X> +Il miglior codice Perl 5 scritto nel 2011 è molto diverso dal miglior codice Perl 5 scritto nel +1994 e dal miglior codice Perl 1 scritto nel 1987. -The CPAN (L) contains many modules and pragmas designed to make your work -simpler, more correct, and more enjoyableN to start.>. As -you improve as a Perl programmer, you will have many opportunities to use (and -even to create) such code in the right circumstances. For now, use these -pragmas and modules regularly in your own code. +X> -=head2 The strict Pragma +Sebbene Perl 5 sia distribuito con una ricca libreria, essa non è onnicomprensiva. +Molti dei migliori moduli Perl 5 sono distribuiti su CPAN (L) anzichè insieme +a Perl. La meta-distribuzione C include svariate altre +distribuzioni che rappresentano il meglio che CPAN abbia da offrire. Dateci un'occhiata +come prima cosa ogni volta che dovete risolvere un problema. -X> -X> - -The C pragma (L) allows you to forbid (or re-enable) various -language constructs which offer power but also the potential for accidental -abuse. - -C provides three features: forbidding symbolic references, requiring -variable declarations, and forbidding the use of undeclared barewords -(L). While the occasional use of symbolic references is necessary -to manipulate symbol tables (barring the use of helper modules, such as -C), the use of a variable as a variable name offers the possibility of -subtle errors of action at a distance--or, worse, the possibility of -poorly-validated user input manipulating internal-only data for malicious -purposes. - -Requiring variable declarations helps to prevent typos in variable names and -encourages proper scoping of lexical variables. It's much easier to see the -intended scope of a lexical variable if all variables have C or C -declarations in the appropriate scope. - -C has a lexical effect, based on the compile-time scope of its use. -You may disable certain features of C (within the smallest possible -scope, of course) with C. See C for more details. - -=head2 The warnings Pragma +Ciò detto, alcune direttive e moduli distribuiti con Perl sono indispensabili ad ogni +programmatore Perl serio. -The C pragma (L) controls the reporting of various -classes of warnings in Perl 5, such as attempting to stringify the C -value or using the wrong type of operator on values. It also warns about the -use of deprecated features. +=head2 La direttiva strict -The most useful warnings explain that Perl had trouble understanding what you -meant and had to guess at the proper interpretation. Even though Perl often -guesses correctly, disambiguation on your part will ensure that your programs -run correctly. +X> +X> -The C pragma has a lexical effect on the compile-time scope of its -use. You may disable some or all warnings with C (within the -smallest possible scope, of course). See C and C for more details. +La direttiva C (L) vi permette di disattivare (e ri-attivare) vari +costrutti potenti del linguaggio che si prestano ad abusi involontari. -=begin sidebar +C proibisce i riferimenti simbolici, richiede che le variabili siano dichiarate +(L) e proibisce l'uso di bareword non dichiarate +(L). Anche se l'uso occasionale dei riferimenti simbolici può essere necessario per +manipolare le tabelle dei simboli (L), l'uso di una variabile come nome di variabile +offre il fianco a errori sottili di azione a distanza--o, peggio ancora, alla +possibilità di manipolazione di strutture dati interne per fini illeciti +da parte di input utente scarsamente validato. -Combine C with C, and Perl 5 will display -expanded diagnostic messages for each warning present in your programs. These -expanded diagnostics come from C. This behavior is useful -when learning Perl, but it's less useful in code deployed to production, -because it can produce verbose error output. +Richiedere che le variabili siano dichiarate aiuta a rilevare erroti di battitura nei nomi delle variabili e +incoraggia la definizione di variabili lessicali negli con appropriati. È molto più facile capire qual è +lo scope che si intende associare a una variabile lessicale se tutte le variabili hanno dichiarazioni C e C +nello scope appropriato. -=end sidebar +C ha un effetto lessicale basato sullo scope durante la compilazione del suo uso +(L) e della sua disattivazione (con C). Vedete C per maggiori dettagli. -=head2 IO::Handle +=head2 La Direttiva warnings -Perl 5.6.0 added lexical filehandles. Previously, filehandles were all package -globals. This was occasionally messy and often confusing. Now that you can -write: +La direttiva C (L) controlla la generazione delle varie classi di +warning in Perl 5, come il tentativo di convertire in stringa il valore C +o l'uso del tipo sbagliato di operatore su certi valori. Genera anche warning relativi +all'uso di funzionalità deprecate. -=begin programlisting +I warning più utili sono quelli che spiegano che Perl ha incontrato difficoltà a interpretare le vostre +intenzioni e ha dovuto tentare di indovinare l'interpretazione giusta. Sebbene spesso Perl ci +azzecchi, una disambiguazione da parte vostra garantisce che i vostri programmi +funzionino correttamente. - open my $fh, '>', $file or die "Can't write to '$file': $!\n"; +La direttiva C ha un effetto lessicale sullo scope durante la compilazione del suo uso o +disattivazione (con C). Vedete C e C per maggiori dettagli. -=end programlisting +=begin tip Chiedere altro Aiuto -... the lexical filehandle in C<$fh> is easier to use. The implementation of -lexical filehandles creates objects; C<$fh> is an instance of C. -Unfortunately, even though C<$fh> is an object, you can't call methods on it -because nothing has loaded the C class. +Combinate C con C per ricevere messaggi diagnostici più estesi +per ogni warning presente nei vostri programmi. Questa diagnostica estesa +è documentata in C. Questo comportamento è particolarmente utile quando imparate Perl. +Disattivatelo prima di distribuire il vostro programma, perchè produce un output verboso +che potrebbe riempire i vostri file di log ed esporre troppe informazioni agli utenti. -This is occasionally painful when you want to flush the buffer of the -associated filehandle, for example. It could be as easy as: +=end tip -=begin programlisting +=head2 C and C - $fh->flush(); +X> +X> -=end programlisting +Prima di Perl 5.14 i filehandle lessicali erano oggetti della classe C, +ma dovevate caricare esplicitamente C prima di poter chiamare dei metodi +su di essi. A partire da Perl 5.14, i filehandle lessicali sono istanze del modulo C che +Perl carica per voi. -... but only if your program somewhere contains C. The -solution is to add this line to your programs so that lexical filehandles--the -objects as they are--behave as objects should behave. +Aggiungete C al codice da eseguire in Perl 5.12 o versioni precedenti se volete chiamare dei metodi +sui filehandle lessicali. -=head2 The autodie Pragma +=head2 La direttiva autodie Z -X pragma> -X> +X> +X> -Perl 5's default error checking is parsimonious. If you're not careful to -check the return value of every C call, for example, you could try to -read from a closed filehandle--or worse, lose data as you try to write to one. -The C pragma changes the default behavior. If you write: +Perl 5 lascia alla vostra responsabilità gestire (o ignorare) gli errori. Per esempio, se non fate attenzione +a controllare il valore di ritorno di ogni chiamata a C potreste +tentare di leggere da un filehandle chiuso--o, peggio ancora, perdere dati che tentate di +scriverci. La direttiva C modifica questo comportamento di default. Se +scrivete: =begin programlisting @@ -121,11 +103,10 @@ The C pragma changes the default behavior. If you write: =end programlisting -... an unsuccessful C call will throw an exception via Perl 5's normal -exception mechanism. Given that the most appropriate approach to a failed -system call is throwing an exception, this pragma can remove a lot of -boilerplate code and allow you the peace of mind of knowing that you haven't -forgotten to check a return value. +... un fallimento della chiamata a C solleverà un'eccezione. Dato che la reazione più +appropriata al fallimento di una chiamata di sistema è quella di sollevare un'eccezione, questa +direttiva può rimuovere molto codice ripetitivo dal vostro programma e garantirvi la tranquillità +di sapere che non non avete dimenticato di controllare un valore di ritorno. -This pragma entered the Perl 5 core as of Perl 5.10.1. See C -for more information. +Questa direttiva viene distribuita con Perl 5 a partire dalla versione 5.10.1. Vedete C +per maggiori informazioni.