About: How to find the contents of a directory using PERL   Sponge Permalink

An Entity of Type : owl:Thing, within Data Space : dbkwik.org associated with source dataset(s)

To find the contents of a directory in perl use the opendir function. * opendir() * Operats similar to the open file function open() * format: opendir(VARIABLE, '/full/directory/or/relative * Example: opendir(DIR, '.'); open the current directory you are in and set it as variable DIR * readdir() * reads the contents of the directory * closedir() * closes the variable set for the directory read * practical example * This finds all jpgs and gifs in a directory and displays them for a website opendir(DIR, '.'); while (defined($dir = readdir(DIR))) { if ( $dir =~ /\.jpg/i || $dir =~ /\.gif/i) { print " "; } } closedir(DIR); From HowTo Wiki, a Wikia wiki.

AttributesValues
rdfs:label
  • How to find the contents of a directory using PERL
rdfs:comment
  • To find the contents of a directory in perl use the opendir function. * opendir() * Operats similar to the open file function open() * format: opendir(VARIABLE, '/full/directory/or/relative * Example: opendir(DIR, '.'); open the current directory you are in and set it as variable DIR * readdir() * reads the contents of the directory * closedir() * closes the variable set for the directory read * practical example * This finds all jpgs and gifs in a directory and displays them for a website opendir(DIR, '.'); while (defined($dir = readdir(DIR))) { if ( $dir =~ /\.jpg/i || $dir =~ /\.gif/i) { print " "; } } closedir(DIR); From HowTo Wiki, a Wikia wiki.
dcterms:subject
abstract
  • To find the contents of a directory in perl use the opendir function. * opendir() * Operats similar to the open file function open() * format: opendir(VARIABLE, '/full/directory/or/relative * Example: opendir(DIR, '.'); open the current directory you are in and set it as variable DIR * readdir() * reads the contents of the directory * closedir() * closes the variable set for the directory read * practical example * This finds all jpgs and gifs in a directory and displays them for a website opendir(DIR, '.'); while (defined($dir = readdir(DIR))) { if ( $dir =~ /\.jpg/i || $dir =~ /\.gif/i) { print " "; } } closedir(DIR); From HowTo Wiki, a Wikia wiki.
Alternative Linked Data Views: ODE     Raw Data in: CXML | CSV | RDF ( N-Triples N3/Turtle JSON XML ) | OData ( Atom JSON ) | Microdata ( JSON HTML) | JSON-LD    About   
This material is Open Knowledge   W3C Semantic Web Technology [RDF Data] Valid XHTML + RDFa
OpenLink Virtuoso version 07.20.3217, on Linux (x86_64-pc-linux-gnu), Standard Edition
Data on this page belongs to its respective rights holders.
Virtuoso Faceted Browser Copyright © 2009-2012 OpenLink Software