473,386 Members | 1,743 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Opening a Directory

2
How can I make a perl program that will open a folder on my computer?

Thanks.
Apr 8 '07 #1
3 1391
KevinADC
4,059 Expert 2GB
Expand|Select|Wrap|Line Numbers
  1. opendir(DIR,'foldername') or die "$!";
  2. do something here
  3. close(DIR);
Apr 8 '07 #2
savanm
85
Hi....

use Cwd();
$path=getcwd();//Get the current path
$path=~s/\\/\//sg;
opendir(DIR,$path) || die ("cannot open the path");//This will used to open the folder
//in a particular path

Do sumthing
close(DIR);
Apr 9 '07 #3
savanm
85
Hi....

use Cwd();
$path=getcwd();//Get the current path
$path=~s/\\/\//sg;
opendir(DIR,$path) || die ("cannot open the path");//This will used to open the folder
//in a particular path

@content=grep(/\.xml/,readdir(DIR));//This will used to retrieve the particular Extension of the file

close(DIR);
Apr 9 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Cemoran | last post by:
I am fairly new to .Net and I am having a problem opening a web project in visual studio .Net. I created a web project from an existing project in the manner described in an MSDN article. The...
7
by: Fred H | last post by:
Hi I've tried to find out if and how I can open directories in standard C++, the same way I can open files. To my great suprise, I haven't managed to find out how this is done! I'm using MS...
1
by: Alfons | last post by:
Hello, I have build a program that can do file transferring between a Windows XP computer and a DOS computer via a serial port. The Windows program I have build in C++ with Visual Studio 6.0....
2
by: Mark R. Dawson | last post by:
Hi all, I have a directory full of images (most over 2MB in size) I was to show each image as a thumbnail on a form, however in order to create a thumbnail I have to open the complete image then...
3
by: Giuseppe D'Elia | last post by:
Hi there, I got a problem using an MS Access database through ASP.NET. After updating my system from .NET Framework 1.0 to 1.1, my existing application gives me the following error when...
11
by: aldrin | last post by:
I'm trying to run this code under windows xp sp2 using codeblocks v1.0 compiler with great difficulty.There is no problem with running this under KDevelop in linux. Any help would be greatly...
1
by: PK9 | last post by:
I am receiving the following error in Visual Studio 2003: "the web server reported the following error when attempting to create or open the web project HTTP/1.1 403 Access Forbidden" I am...
5
by: muwie | last post by:
Hello, I was browsing to see if I could find something similair to my problem. But I couldn't find anything.. I have this script that counts every word in a file. And then also says how many...
1
by: Bob | last post by:
Im setting up a fedora core 8 web server. Im currently running everything on another fedora core 6 server (working fine). Ive installed php 5.2.5 and apache 2.0.63 Im getting the following: ...
1
by: developing | last post by:
Hey all, I am using the FileUpload control in ASP.NET to upload a file. Its working jsut fine. I need to implement it so that when you click 'Browse', the dialog opens up in a specified...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.