Deprecated: Use of MediaWiki\Parser\ParserOutput::getText was deprecated in MediaWiki 1.42. [Called from SMW\MediaWiki\Hooks\OutputPageParserOutput::getParserOutput in /home/jltryoen/www/MediaWiki/extensions/SemanticMediaWiki/src/MediaWiki/Hooks/OutputPageParserOutput.php at line 161] in /home/jltryoen/www/MediaWiki/includes/debug/MWDebug.php on line 386
« Perl » : différence entre les versions — La FAQ de JLT

« Perl » : différence entre les versions

m 1 révision importée
Aucun résumé des modifications
 
Ligne 1 : Ligne 1 :
<keywords content="Perl"/>
{{#seo:|keywords=perl}}
== Trouver des fichiers avec un motif donné ==
== Trouver des fichiers avec un motif donné ==
<syntaxhighlight lang="perl">
<syntaxhighlight lang="perl">
Ligne 13 : Ligne 13 :
print "notfound d in @ar\n"  if ( grep (!/d/, @ar));
print "notfound d in @ar\n"  if ( grep (!/d/, @ar));
</syntaxhighlight>
</syntaxhighlight>
<br>


== Liens Externes ==
== Liens Externes ==

Dernière version du 23 septembre 2023 à 19:02

Trouver des fichiers avec un motif donné

opendir D, '.' or die "Could not open current dir: $!\n";
my @filelist = grep(/[A-Z]{2}_\w{2,5}/i, readdir D);
closedir D;

Trouver un élement d'une liste

my @ar = ( "a", "b", "c");
print "found b in @ar\n"  if ( grep (/b/, @ar));
print "notfound d in @ar\n"  if ( grep (!/d/, @ar));


Liens Externes