Re: reading directories using perl in windows

2016-03-13 Thread Shawn H Corey
rl.org wrote: > > Subject: > > Re: reading directories using perl in windows > > From: > > Akshay Mohit > > Date: > > 3/1/2016 4:49 AM > > > > To: > > Arghya Das > > CC: > > Perl Beginners > > > > > > Could you

Re: reading directories using perl in windows

2016-03-13 Thread Mike Flannigan
FYI, there is no error. If the directory path has no spaces it works fine, if the directory path has spaces it prints the path up to the 1st space and just goes back to a cursor line. Mike On 3/6/2016 5:04 AM, beginners-digest-h...@perl.org wrote: Subject: Re: reading directories using

Re: reading directories using perl in windows

2016-03-01 Thread Shawn H Corey
On Tue, 1 Mar 2016 15:53:15 +0530 Arghya Das wrote: > use warnings; > > $dir = "c:/folder/*";my @files = glob( $dir ); > foreach (@files ){ >print $_ . "\n";} > > > i am trying to read windows directory using above code but it gives > errors in recognising tthe directory path. please help.

Re: reading directories using perl in windows

2016-03-01 Thread Kent Fredric
On 1 March 2016 at 23:23, Arghya Das wrote: > $dir = "c:/folder/*"; > my @files = glob( $dir ); > > foreach (@files ){ >print $_ . "\n"; > } Personally, I would have used either Path::Tiny, or at least, readdir() here. There's far few places that can lead to strange bugs and security holes

Re: reading directories using perl in windows

2016-03-01 Thread Akshay Mohit
Could you please send the exact error which you are getting as I Copy/Pasted the exact code which you had given and it is working properly for me. I have only given the directory which is present in my system. use strict; use warnings; my $dir = "C:/Python_Exercise/*"; my @files = glob( $dir );

Re: reading directories using perl in windows

2016-03-01 Thread Raj Barath
Try using readdir http://perldoc.perl.org/functions/readdir.html On Tue, Mar 1, 2016, 5:24 AM Arghya Das mailto:arghya0...@gmail.com>> wrote: use warnings; $dir = "c:/folder/*"; my @files = glob( $dir ); foreach (@files ){ print $_ . "\n"; } i am trying to read windows directory using abo

reading directories using perl in windows

2016-03-01 Thread Arghya Das
use warnings; $dir = "c:/folder/*";my @files = glob( $dir ); foreach (@files ){ print $_ . "\n";} i am trying to read windows directory using above code but it gives errors in recognising tthe directory path. please help.

Re: Locating files in sub-directories

2013-12-17 Thread Octavian Rasnita
From: "SSC_perl" Octavian, Thanks for the reply. >> So I tried the following: >> use lib "ss_files"; >> This also works, but iirc, I read that it won't work across all platforms. >> Is that correct? > > > This method also works, but to be equivalent with the first method it should > have b

Re: Locating files in sub-directories

2013-12-17 Thread SSC_perl
Octavian, Thanks for the reply. >> So I tried the following: >> use lib "ss_files"; >> This also works, but iirc, I read that it won't work across all platforms. >> Is that correct? > > > This method also works, but to be equivalent with the first method it should > have been: > use

Re: Locating files in sub-directories

2013-12-16 Thread Octavian Rasnita
From: "SSC_perl" I'm in the process of moving certain files of the SurfShop script into a sub-directory to clean up the main directory and would like to know the best way for the script to find these files. I was using this method: use FindBin qw($Bin); use lib "$Bin/../ss_files"; which work

Locating files in sub-directories

2013-12-16 Thread SSC_perl
I'm in the process of moving certain files of the SurfShop script into a sub-directory to clean up the main directory and would like to know the best way for the script to find these files. I was using this method: use FindBin qw($Bin); use lib "$Bin/../ss_files"; which worked

Re: A problem of searching through directories

2011-04-15 Thread Uri Guttman
> "LY" == Li Yi writes: LY> I have encounter a problem in which i need to scan over all the files LY> within a directory tree. My script is like the following before we get into your code, where are you learning perl? this is very old style perl. it is perl 4 to be exact which is very ve

A problem of searching through directories

2011-04-15 Thread Li Yi
I have encounter a problem in which i need to scan over all the files within a directory tree. My script is like the following #!/usr/bin/perl -w $d = "some directory here"; chop($d); &searchDirectory($d); sub searchDirectory { local($dir); local(@lines1); local($line); local($

Re: Remove old core dump directories in Oracle ... ???

2010-06-07 Thread newbie01 perl
Hi Uri, Oops ... sorry, I think I've explained it wrong ... I mean, supposedly, the script is to scan the sub-directories of $ARGV[0] but not include $ARGV[0] in the list so I've modified the pseudo-code hack that you provided to do just that ...

Re: Remove old core dump directories in Oracle ... ???

2010-06-07 Thread Uri Guttman
>>>>> "np" == newbie01 perl writes: uri> that still isn't clear to me. is the @ARGV value to be scanned or uri> skipped? you need to be very clear when you specify this stuff. np> The @ARGV value is to be scanned for its sub-directories but np>

Re: Remove old core dump directories in Oracle ... ???

2010-06-06 Thread newbie01 perl
Hi Uri, uri> that still isn't clear to me. is the @ARGV value to be scanned or uri> skipped? you need to be very clear when you specify this stuff. The @ARGV value is to be scanned for its sub-directories but excluding @ARGV itself ... the File::Find gives all the listing and includin

Re: Remove old core dump directories in Oracle ... ???

2010-06-06 Thread Uri Guttman
diting yours, manually ... you look like you are doing np> your editing of the quote programmatically ..  emacs with gnus and supercite. many decent text editors and mailers support indented quoting of emails. np> - Oracle creates core dumps as directories. The script is supposed np>

Re: Remove old core dump directories in Oracle ... ???

2010-06-06 Thread newbie01 perl
ically .. uri> i don't know exactly what you are trying to do. it is always important uri> to be able to explain your goals in clear natural language. then you can uri> translate that to code. - Oracle creates core dumps as directories. The script is supposed to check the core dump

Re: Remove old core dump directories in Oracle ... ???

2010-06-06 Thread Uri Guttman
>>>>> "np" == newbie01 perl writes: first off please edit the quoted part of posts. only keep the parts you are commenting or asking about. np> How do I exclude the command line argument from the "found" np> directories ... ??? Or would you recommen

Re: Remove old core dump directories in Oracle ... ???

2010-06-06 Thread newbie01 perl
stat($file))[9] ; >if ( $now - $file_time > $AGE) { > > i also added horizontal whitespace. > > uri > > -- > Uri Guttman -- u...@stemsystems.com http://www.sysarch.com-- > - Perl Code Review , Architecture, Development, Training, Support

Re: Remove old core dump directories in Oracle ... ???

2010-06-06 Thread Uri Guttman
> "np" == newbie01 perl writes: np> I found a better example at a Perlmonk posting and changed it a bit as np> below: np> #!/usr/bin/perl np> use strict; no use warnings. bad. see below. np> use File::Find; np> use File::Spec::Functions; np> #use File::Spec->no_upwards(); n

Re: Remove old core dump directories in Oracle ... ???

2010-06-06 Thread newbie01 perl
2010/6/7 Shlomi Fish > On Sunday 06 Jun 2010 19:59:36 Wojciech Łysiak wrote: > > On 06.06.2010 18:12, newbie01 perl wrote: > > > Hi all, > > > > > > Oracle core dumps are created as directories. I want to remove these > > > directories after

Re: Remove old core dump directories in Oracle ... ???

2010-06-06 Thread Shlomi Fish
On Sunday 06 Jun 2010 19:59:36 Wojciech Łysiak wrote: > On 06.06.2010 18:12, newbie01 perl wrote: > > Hi all, > > > > Oracle core dumps are created as directories. I want to remove these > > directories after a certain period of time, for example 10 days. > > >

Re: Remove old core dump directories in Oracle ... ???

2010-06-06 Thread Wojciech Łysiak
On 06.06.2010 18:12, newbie01 perl wrote: Hi all, Oracle core dumps are created as directories. I want to remove these directories after a certain period of time, for example 10 days. I have the following script that searches a directory for files that are older than 10 days and possibly

Remove old core dump directories in Oracle ... ???

2010-06-06 Thread newbie01 perl
Hi all, Oracle core dumps are created as directories. I want to remove these directories after a certain period of time, for example 10 days. I have the following script that searches a directory for files that are older than 10 days and possibly remove them. At the moment, for the sake of

Re: Using Archive::Zip to compress two directories into a single zip file

2010-06-02 Thread John W. Krahn
Chap Harrison wrote: Well, I suppose I've missed a subtlety along the way here. I have two directories: /path/to/existing/directory/foo/ /path/to/existing/directory/bar/ And I want to archive these two directories into a zip file named archive.zip. Here's what I did, using the s

Using Archive::Zip to compress two directories into a single zip file

2010-06-02 Thread Chap Harrison
Well, I suppose I've missed a subtlety along the way here. I have two directories: /path/to/existing/directory/foo/ /path/to/existing/directory/bar/ And I want to archive these two directories into a zip file named archive.zip. Here's what I did, using the synopsis of Archive::Zip

Re: export symbols across directories

2009-09-25 Thread Shawn H Corey
Stanisław T. Findeisen wrote: When I, however, move Utils.pm into subdirectory mylib, and modify the program accordingly: # # The program (2) # use warnings; use strict; use mylib::Utils qw(bar foo); use lib './mylib'; use Utils qw(foo ba

Re: export symbols across directories

2009-09-25 Thread Uri Guttman
> "STF" == Stanisław T Findeisen writes: STF> I am trying to use symbols from Utils.pm without qualifying them with STF> package name. I have 2 files: STF> # STF> # File Utils.pm STF> # STF> package Utils; STF> our @EXPOR

export symbols across directories

2009-09-25 Thread Stanisław T. Findeisen
I am trying to use symbols from Utils.pm without qualifying them with package name. I have 2 files: # # File Utils.pm # package Utils; use warnings; use strict; use base 'Exporter'; our @EXPORT_OK = ('foo', 'bar'); sub foo { print "foo

RE: Comparing 2 directories of Mail/News single files

2009-03-02 Thread Bob McConnell
On Behalf Of Harry Putnam > > I have a semi-big mess here. > > Never mind how I managed it but let me describe what I want to do and > maybe some kind soul can steer me to something on cpan or just have > some helpful clues. > > I have two directories of news/mail messa

Comparing 2 directories of Mail/News single files

2009-03-02 Thread Harry Putnam
I have a semi-big mess here. Never mind how I managed it but let me describe what I want to do and maybe some kind soul can steer me to something on cpan or just have some helpful clues. I have two directories of news/mail messages containing different number of files. However I expect there is

Re: HTML Stipper with an option for directories and multiple files

2008-12-22 Thread Mr. Shawn H. Corey
On Mon, 2008-12-22 at 13:59 -0800, bdy wrote: > On Nov 18, 9:34 am, bdy120...@gmail.com (Bdy) wrote: > > Does any one know if there is a HTML stripper module that contains an > > option to strip multiple files across multiple directories. > > > > Having a helluva time

Re: HTML Stipper with an option for directories and multiple files

2008-12-22 Thread bdy
On Nov 18, 9:34 am, bdy120...@gmail.com (Bdy) wrote: > Does any one know if there is a HTML stripper module that contains an > option to strip multiple files across multiple directories. > > Having a helluva time finding one and getting the strippers and > parsers to work as I

Re: Reading Files across directories and subdirectories

2008-12-02 Thread Ganesh Babu N
Koti, You can use File::List module which does your task very easily. Regards, Ganesh On Tue, Dec 2, 2008 at 5:18 PM, Koti <[EMAIL PROTECTED]> wrote: > Hi Matt, A very Good Morning, Need a small Info for my problem. > > I have a directory named "X" which has many sub

Re: Reading Files across directories and subdirectories

2008-12-02 Thread James Moser
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Dec 2, 2008, at 11:51 AM, John W. Krahn wrote: James Moser wrote: On Dec 2, 2008, at 5:48 AM, Koti wrote: I have a directory named "X" which has many sub directories "Y","Z","W" and many files a

Re: Reading Files across directories and subdirectories

2008-12-02 Thread John W. Krahn
James Moser wrote: On Dec 2, 2008, at 5:48 AM, Koti wrote: I have a directory named "X" which has many sub directories "Y","Z","W" and many files about 20 , and these sub directories also contain some more sub directories and files in them and

Re: Reading Files across directories and subdirectories

2008-12-02 Thread James Moser
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Dec 2, 2008, at 5:48 AM, Koti wrote: Hi Matt, A very Good Morning, Need a small Info for my problem. I have a directory named "X" which has many sub directories "Y","Z","W" and many files about 20 , and

Re: Reading Files across directories and subdirectories

2008-12-02 Thread Chas. Owens
On Tue, Dec 2, 2008 at 06:48, Koti <[EMAIL PROTECTED]> wrote: > Hi Matt, A very Good Morning, Need a small Info for my problem. > > I have a directory named "X" which has many sub directories > "Y","Z","W" and many files about 20 , and thes

Reading Files across directories and subdirectories

2008-12-02 Thread Koti
Hi Matt, A very Good Morning, Need a small Info for my problem. I have a directory named "X" which has many sub directories "Y","Z","W" and many files about 20 , and these sub directories also contain some more sub directories and files in them and

Re: HTML Stipper with an option for directories and multiple files

2008-11-19 Thread cc96ai
Use: - HTML::Parser to parse - File::Find to loop the directory and file -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

HTML Stipper with an option for directories and multiple files

2008-11-18 Thread bdy
Does any one know if there is a HTML stripper module that contains an option to strip multiple files across multiple directories. Having a helluva time finding one and getting the strippers and parsers to work as I'd like them to. Thanks. -- To unsubscribe, e-mail: [EMAIL PROTECTED

Re: HTML Stipper with an option for directories and multiple files

2008-11-18 Thread Stealth
On Tuesday 18 November 2008 09:34:52 am bdy wrote: > Does any one know if there is a HTML stripper module that > contains an option to strip multiple files across multiple > directories. > > Having a helluva time finding one and getting the strippers and > parsers to work a

Re: ignore directories with File::Find?

2008-10-28 Thread protoplasm
:topdev || $File::Find::name =~ m!/\.! && return; >      /^AesTest/ && print "$File::Find::name\n"; >      }, $home_directory ); > > __END__ John, thanks for the code. Your code does eliminate the printing of hidden directories but not of file systems that are

Re: ignore directories with File::Find?

2008-10-24 Thread John W. Krahn
protoplasm wrote: On Oct 23, 2:09 am, [EMAIL PROTECTED] (John W. Krahn) wrote: Perhaps you need to use the -xdev switch for find to ignore other file systems? Thank you, John. That certainly helped. It now ignores the mounted file systems but still traverses hidden directories. I must be

Re: ignore directories with File::Find?

2008-10-24 Thread protoplasm
On Oct 23, 2:09 am, [EMAIL PROTECTED] (John W. Krahn) wrote: > Perhaps you need to use the -xdev switch for find to ignore other file > systems? Thank you, John. That certainly helped. It now ignores the mounted file systems but still traverses hidden directories. I must be overlooking som

Re: ignore directories with File::Find?

2008-10-23 Thread Telemachus
On Wed Oct 22 2008 @ 4:32, protoplasm wrote: > I ran find2perl to give me some output that I included below (in > Sub_directory). If I have no network shares mounted it runs fine. But > I have some shares mounted (sftp, or smb, etc.) via Nautilus, the > below script really takes a long time. It be

get list of accessible directories

2008-10-23 Thread Andreas Moroder
Hello, on our linux system I have a script that runs as root that should return a list of subdirectorys a specific user can access. I have the four directories and aside the users that can access them dira ( usera,userb, userc) dirb ( userb ) dirc ( userc ) dird ( usera, userc

Re: ignore directories with File::Find?

2008-10-23 Thread John W. Krahn
protoplasm wrote: I ran find2perl to give me some output that I included below (in Sub_directory). If I have no network shares mounted it runs fine. But I have some shares mounted (sftp, or smb, etc.) via Nautilus, the below script really takes a long time. It begins to search through ~/.gvfs whi

ignore directories with File::Find?

2008-10-23 Thread protoplasm
print "\nLocating directory...\n"; File::Find::find(\&Some_directory, $home_directory); } ##-- Find directories. sub Some_directory { my ($dev,$ino,$mode,$nlink,$uid,$gid); (($dev,$ino,$mode,$nlink,$uid,$gid) = lstat($_)) && -d _ && ! /^.*\

Re: create the home directories of 424 students in a server machine

2008-08-19 Thread Perry Smith
On Aug 19, 2008, at 1:48 PM, Jyotishmaan Ray wrote: Dear All, I am a new bie in perl. I have to create the home directories of 424 students in a server machine. The path of the home directory would be :- /mnt/btech/formatted-rollno. where formatted-rollno ="s08-1-5-097" And

Re: Script neeed for creating home directories for each student!!

2008-08-19 Thread yitzle
On Tue, Aug 19, 2008 at 10:39 AM, Jyotishmaan Ray <[EMAIL PROTECTED]> wrote: > I would need it in a different server to create all the home directories. > > Kindly provide a different script for that. There are websites out there that allow you to hire someone to work on a

Re: create the home directories of 424 students in a server machine

2008-08-19 Thread Wolf
Jyotishmaan Ray <[EMAIL PROTECTED]> wrote: > > Dear All, > > I am a new bie in perl. I have to create the home directories of 424 students > in a server machine. > > The path of the home directory would be :- > > /mnt/btech/formatted-rollno. > &g

create the home directories of 424 students in a server machine

2008-08-19 Thread Jyotishmaan Ray
Dear All, I am a new bie in perl. I have to create the home directories of 424 students in a server machine. The path of the home directory would be :- /mnt/btech/formatted-rollno. where formatted-rollno ="s08-1-5-097" And the input file contains all the rollnos of 424 stud

Re: Script neeed for creating home directories for each student!!

2008-08-19 Thread Jyotishmaan Ray
I  would need it in a different server to create all the home directories. Kindly provide a different script for that.    --- On Tue, 8/19/08, Anirban Adhikary <[EMAIL PROTECTED]> wrote: From: Anirban Adhikary <[EMAIL PROTECTED]> Subject: Re: Script neeed for creating home dir

Re: Script neeed for creating home directories for each student!!

2008-08-19 Thread Anirban Adhikary
ot;$homedir";` if(! -e $homedir);* } close(FH); close(FH1); another way is do the home directory creating job in another script use strict; use warnings; open(FH,"/home/anadhikary/perl/sourcefile"); while() { ($a,$b)=split(/\s+/,$_); my $homedir = "/mnt/btech/$a";

Script neeed for creating home directories for each student!!

2008-08-19 Thread Jyotishmaan Ray
Thank you Anirban. Also do you any script for creating the home directories in a server machine for 424 students in the path :  /mnt/btech/uid, where uid = s08-1-5-097 for the same file read, as before. All the students must have all permissions to read, write and execute in their home

Re: How to delete old directories with perl script?

2008-04-24 Thread Dr.Ruud
"Siegfried Heintze (Aditi)" schreef: > I have directory names in the format of "-mm-dd_hh-mm-ss". > Sometimes I want to delete all the non-empty directories that are > from last week or earlier. Other times I want to delete all the > directories that are over

Re: How to delete old directories with perl script?

2008-04-23 Thread Gunnar Hjalmarsson
Siegfried Heintze (Aditi) wrote: the following does not produce an error and does not work. $ perl -MFile::Tasks -e '(File::Tasks->new)->remove_dir("2008-03-11_15-42-58/"); File::Path is probably a better choice than File::Tasks. perl -MFile::Path -e 'rmtree("2008-03-11_15-42-58")' -- Gu

Re: How to delete old directories with perl script?

2008-04-23 Thread Chas. Owens
all in the same directory, so it is overkill. File::Find is a good choice when we want to work with entire hierarchies of directories. -- Chas. Owens wonkden.net The most important skill a programmer can have is the ability to read. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional c

Re: How to delete old directories with perl script?

2008-04-23 Thread Chas. Owens
On Wed, Apr 23, 2008 at 11:58 PM, Siegfried Heintze (Aditi) <[EMAIL PROTECTED]> wrote: > I have directory names in the format of "-mm-dd_hh-mm-ss". Sometimes I > want to delete all the non-empty directories that are from last week or > earlier. Other times

Re: How to delete old directories with perl script?

2008-04-23 Thread Li, Jialin
I > want to delete all the non-empty directories that are from last week or > earlier. Other times I want to delete all the directories that are over a > week old. > > Is there a script out there already that does this? > > Assuming the answer is no, I started writing a

How to delete old directories with perl script?

2008-04-23 Thread Siegfried Heintze (Aditi)
I have directory names in the format of "-mm-dd_hh-mm-ss". Sometimes I want to delete all the non-empty directories that are from last week or earlier. Other times I want to delete all the directories that are over a week old. Is there a script out there already that does this?

Re: copy ffiles and directories recursively

2008-04-01 Thread alok nath
Hi, There is a small problem now : It now copies the files as directories : #!/usr/bin/perl $startDir = q{c:\test}; $newDir = q{c:\new}; &myReadDir($startDir); exit 0; sub myReadDir { my ($dir) = @_; print "\n\nProcessing $dir \n"

Re: copy ffiles and directories recursively

2008-04-01 Thread John W. Krahn
alok nath wrote: Hi, Hello, I wanted to recursively copy the contents of a directory(both directory and files) from one folder to the other. The below code does only copy of directories but leaves behind files. Can anybody help me how to do that ? http://search.cpan.org/~dmuey/File-Copy

Re: copy ffiles and directories recursively

2008-04-01 Thread Jeff Pang
On 4/1/08, alok nath <[EMAIL PROTECTED]> wrote: > Hi, > I wanted to recursively copy the contents of a directory(both directory and > files) from one folder to the other. use File::Copy from CPAN. > The below code does only copy of directories but leaves behind files. &

copy ffiles and directories recursively

2008-04-01 Thread alok nath
Hi, I wanted to recursively copy the contents of a directory(both directory and files) from one folder to the other. The below code does only copy of directories but leaves behind files. Can anybody help me how to do that ? Regards, Alok #!/usr/bin/perl $startDir = q{c:\test

Re: need to find all the directories which have soft links in it

2008-03-30 Thread nag
can some one please help me with an example to list all the directories and their soft-links. Thanks, Nagesh 2008/3/26 Sandy <[EMAIL PROTECTED]>: > On 26 мар, 07:33, [EMAIL PROTECTED] (Nag) wrote: > > > > I have a parent directory which contains nearly 10 soft-links to

Re: need to find all the directories which have soft links in it

2008-03-26 Thread Sandy
On 26 мар, 07:33, [EMAIL PROTECTED] (Nag) wrote: > > I have a parent directory which contains nearly 10 soft-links to other > directories, the linked directory may also contain soft-links to other > directories.it goes on like that till the directory doesn't contain any >

Re: need to find all the directories which have soft links in it

2008-03-26 Thread Chas. Owens
On Wed, Mar 26, 2008 at 10:33 AM, nag <[EMAIL PROTECTED]> wrote: > Hi all, > > I have a parent directory which contains nearly 10 soft-links to other > directories, the linked directory may also contain soft-links to other > directories.it goes on like that till

need to find all the directories which have soft links in it

2008-03-26 Thread nag
Hi all, I have a parent directory which contains nearly 10 soft-links to other directories, the linked directory may also contain soft-links to other directories.it goes on like that till the directory doesn't contain any soft-links. How can I get the list of all these directories ? T

Chomping directories

2007-11-19 Thread Gianluca Tognin
Hi, Well I got to test check a dir. If I select /etc or /home/user it works. But if I leave a blank, just only ENTER I got the below error. "/home/user exist and is rwx". What I'm missing in my script? - - - - - - - - - - - - - - - - - - - - - - - - - - - - #!/usr/bin/perl use diagnostics; use s

Re: Adding a line in a file inside many directories

2007-06-29 Thread John W. Krahn
[EMAIL PROTECTED] wrote: On Jun 28, 12:00 pm, [EMAIL PROTECTED] (Ved) wrote: Now I have to print a single line at say line number 20 in each of 150 number of kat.s file. Hey, another chance to show off my favorite Perl module, IO::All. Situation is bit complex (atleast for a beginer like me

Re: Adding a line in a file inside many directories

2007-06-29 Thread usenet
;filter(sub{$_->filename eq $file})->all_files(0); This uses File::Find to recurse all directories below $dir and find all files named 'kat.s'. map {print "@$_[$line]\n"} This uses Tie::File to treat the file like an array; I print the line I want (line #20, which is

Re: Adding a line in a file inside many directories

2007-06-29 Thread Tom Phoenix
On 6/28/07, Ved <[EMAIL PROTECTED]> wrote: open (VEDIN, 'list_of_dir.txt') or die "Cannot open 'File.txt' $!"; Why does the error message mention the wrong file name? my @rgstr=; foreach my $file_list (@rgstr) { print $file_list ;#printing list of dir The items in this list haven't

Adding a line in a file inside many directories

2007-06-29 Thread Ved
Hi all, I am a beginer in PERL. What I am trying to do is this: I have a 150 directories, each having a file "kat.s" in them. I have names of all these directories in a text file "list_of_dir.txt". I have to open the each of "kat.s" in all the 150 directories and

Adding a line in a file inside many directories

2007-06-29 Thread Ved
Hi All, Situation is bit complex (atleast for a beginer like me). Directory structure is somewhat like this: testcases--> 150 Directories (names starting with mixed or green.) --- > kat.s i.e. a directrory named testcases has 150 number of directories in it and each of those 150 num

Re: Add directories to @INC

2007-03-31 Thread Robert Hicks
Tom Phoenix wrote: On 3/26/07, Robert Hicks <[EMAIL PROTECTED]> wrote: Jeff Pang wrote: >> I accomplished this by adding the following line to the end of my >> startup.pl file: push(@INC, "Put path to directory here"); >> > > This is not mod_perl list. > Since we discuss about common perl scri

Re: Add directories to @INC

2007-03-26 Thread Jeff Pang
> >This appends the new library path to @INC. The usual method however is to >prepend it to @INC, so the added paths are searched first. That would lead to > > unshift @INC, 'Put path to directory here'; > Someone (including me) has mentioned many times,this couldn't work. You should: BEGIN

Re: Add directories to @INC

2007-03-26 Thread D. Bolliger
Lee Conine am Montag, 26. März 2007 16:03: Hello (just noted Tom Phoenix's answer with the hint to perlfaq8 after writing, but sending anyway...) > I see that there are a lot of people wanting to know how to add > directories to their @INC permanently. > > I accomplished t

Re: Add directories to @INC

2007-03-26 Thread Tom Phoenix
On 3/26/07, Robert Hicks <[EMAIL PROTECTED]> wrote: Jeff Pang wrote: >> I accomplished this by adding the following line to the end of my >> startup.pl file: push(@INC, "Put path to directory here"); >> > > This is not mod_perl list. > Since we discuss about common perl scripts not mod_perl,so

Re: Add directories to @INC

2007-03-26 Thread Robert Hicks
Jeff Pang wrote: I accomplished this by adding the following line to the end of my startup.pl file: push(@INC, "Put path to directory here"); This is not mod_perl list. Since we discuss about common perl scripts not mod_perl,so your way seems not useful here. Instead of being critical may

Re: Add directories to @INC

2007-03-26 Thread Jeff Pang
> >I accomplished this by adding the following line to the end of my >startup.pl file: push(@INC, "Put path to directory here"); > This is not mod_perl list. Since we discuss about common perl scripts not mod_perl,so your way seems not useful here. -- To unsubscribe, e-mail: [EMAIL PROTECTED

Add directories to @INC

2007-03-26 Thread Lee Conine
I see that there are a lot of people wanting to know how to add directories to their @INC permanently. I accomplished this by adding the following line to the end of my startup.pl file: push(@INC, "Put path to directory here"); Restart apache and you should be good to go! Hope this helps.

Re: Creating Directories on Windows

2006-08-09 Thread Rob Dixon
Omega -1911 wrote: > > I recently decided to host a site on one of my machines (Win XP, > Active State 5.8.8) for testing a couple of scripts since my host > objects to installing a few modules. Anyway, can someone explain why > the following code will create directories and the th

Creating Directories on Windows

2006-08-08 Thread Omega -1911
Hello, I recently decided to host a site on one of my machines (Win XP, Active State 5.8.8) for testing a couple of scripts since my host objects to installing a few modules. Anyway, can someone explain why the following code will create directories and the the code below it will not (keep

Re: Create Directories

2006-05-22 Thread Dr.Ruud
SkyBlueshoes schreef: > Another stupid question, search.cpan.org doesn't like me, lol: > > Which module is best for creating a directory and all directories in > between. > > Ex: > > I want to create the directory : \dir1\dir2\dir3\targetdirectory > but none of th

Re: Create Directories

2006-05-22 Thread Anthony Ettinger
File::Spec if you are working cross platform. then "mkdir $path" On 5/22/06, Toby Stuart <[EMAIL PROTECTED]> wrote: > -Original Message- > From: SkyBlueshoes [mailto:[EMAIL PROTECTED] > Sent: Tuesday, 23 May 2006 12:38 PM > To: beginners@perl.org &

RE: Create Directories

2006-05-22 Thread Toby Stuart
> -Original Message- > From: SkyBlueshoes [mailto:[EMAIL PROTECTED] > Sent: Tuesday, 23 May 2006 12:38 PM > To: beginners@perl.org > Subject: Create Directories > > > Another stupid question, search.cpan.org doesn't like me, lol: > > Which module i

Create Directories

2006-05-22 Thread SkyBlueshoes
Another stupid question, search.cpan.org doesn't like me, lol: Which module is best for creating a directory and all directories in between. Ex: I want to create the directory : \dir1\dir2\dir3\targetdirectory but none of the preceding numbered directories exist... Sky Blueshoes

Re: Finding directories within a tree

2005-10-07 Thread Dave Gray
.. > Dir1\Dir1000\Support\100858 > > I am simply interested in finding the directories directley under the Support > dir (ex.119404 from the 1st example) . There is no consistancy to the naming > convention other then Dir1 and Support. Dir2 can be many different values. > > I

Re: RE: Finding directories within a tree

2005-10-07 Thread jason_normandin
That worked perfectley. > > From: "Larsen, Errin M HMMA/IT" <[EMAIL PROTECTED]> > Date: 2005/10/07 Fri PM 02:03:29 EDT > To: > Subject: RE: Finding directories within a tree > > [EMAIL PROTECTED] wrote: > > Good Afternoon > > > > I am att

Re: Finding directories within a tree

2005-10-07 Thread Dave Gray
On 10/7/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > I am receiving numerous amounts of mail but have not filled out any > questionnaires giving away any sort of information. If these letters continue > being sent to me I will be forced to report you to AOL as spam and possibly > other for

Re: Finding directories within a tree

2005-10-07 Thread rangerrickca
inding directories within a tree Hi there! Isn't it possible to use dir - command? (dos-command) which is similar to ls /G - Original Message - From: <[EMAIL PROTECTED]> To: Sent: Friday, October 07, 2005 7:17 PM Subject: Finding directories within a tree > Good

Re: Finding directories within a tree

2005-10-07 Thread Gustav Wiberg
Hi there! Isn't it possible to use dir - command? (dos-command) which is similar to ls /G - Original Message - From: <[EMAIL PROTECTED]> To: Sent: Friday, October 07, 2005 7:17 PM Subject: Finding directories within a tree Good Afternoon I am attempting to develop a

Re: Finding directories within a tree

2005-10-07 Thread Adriano Ferreira
simply interested in finding the directories directley under the Support > dir (ex.119404 from the 1st example) . There is no consistancy to the naming > convention other then Dir1 and Support. Dir2 can be many different values. I think you just need to use glob(). Maybe this perl -e

RE: Finding directories within a tree

2005-10-07 Thread Larsen, Errin M HMMA/IT
t\100858 > > I am simply interested in finding the directories directley under the > Support dir (ex.119404 from the 1st example) . There is no > consistancy to the naming convention other then Dir1 and Support. > Dir2 can be many different values. > > I tried functiona

Finding directories within a tree

2005-10-07 Thread jason_normandin
enourmous ! Basically, I have a file structure similar to: Dir1\Dir2\Support\119404\dirx\diry Dir1\Dir3\Support\119893\dirx Dir1\Dir4\Support\14\dirx\diry\dirz . Dir1\Dir1000\Support\100858 I am simply interested in finding the directories directley under the Support dir (ex.119404 from the 1st

RE: Directories into arrays, again.

2005-08-29 Thread Daniel Kurtz
From: JupiterHost.Net [mailto:[EMAIL PROTECTED] > Or weren't. >>> So its working now then? What changed? <<< Changes to the file system wrought in the shell are not visible to the calling Perl program until the shell's file handle is closed or otherwise reset. Simply had to close() the file h

Re: Directories into arrays, again.

2005-08-26 Thread JupiterHost.Net
Then that would be the code to show :) although I bet strict/warnings/and checking your open's (or die $!;) will show you what is wrong :) <<< I see, however that is still the best practice to be in, especially when asking for assistance since it catches 99.9% of little issues. No, the .

  1   2   3   4   >