Forum |  HardWare.fr | News | Articles | PC | S'identifier | S'inscrire | Shop Recherche
943 connectés 

  FORUM HardWare.fr
  Programmation

  [PERL] Explications sur un script SVP

 


 Mot :   Pseudo :  
 
Bas de page
Auteur Sujet :

[PERL] Explications sur un script SVP

n°42850
Largo
troubadour
Posté le 26-06-2001 à 14:42:27  profilanswer
 

Voila, je comprends pas trop comment ce script marche:
sub parse_csv {
    my $text = shift;      # record containing comma-separated values
    my @new  = ();
    push(@new, $+) while $text =~ m{
        # the first part groups the phrase inside the quotes.
        # see explanation of this pattern in MRE
        "([^\"\\]*(?:\\.[^\"\\]*)*)",?
           |  ([^,]+),?
           | ,
       }gx;
       push(@new, undef) if substr($text, -1,1) eq ',';
       return @new;      # list of values that were comma-separated
}  
 
ça parse un fichier CSV en omettant les ',' qui sont entre double quote ( " ) et backslashées \,
c'est l'expression régulière que je comprends pas..., si vous pouviez m'aider et décomposer le script...
 
MERci. :hello:  
 :hello:  :hello:

mood
Publicité
Posté le 26-06-2001 à 14:42:27  profilanswer
 


Aller à :
Ajouter une réponse
  FORUM HardWare.fr
  Programmation

  [PERL] Explications sur un script SVP

 

Sujets relatifs
[java script] probleme avec les mac ![javascript] help ! script compliqué
perl :)))[CGI-PERL] Un bon tutorial?
Inclure un "cgi" dans un script PHP ?Erreur dans mon script , je trouve po la faute
pb de script...[php] appel d'un fichier externe en milieu de script
Probleme avec PERL DBD-ORACLE v.1.07 sur HPUX10.20[PHP] Comment appeler un script PHP distant avec une balise <script> ?
Plus de sujets relatifs à : [PERL] Explications sur un script SVP


Copyright © 1997-2022 Hardware.fr SARL (Signaler un contenu illicite / Données personnelles) / Groupe LDLC / Shop HFR