split and extraction

2002-01-30 Thread Dhiraj P Nilange
Hi there I want to extract some word after space from some string. Somebody from the mailing list had given me above command. suppose I wanto extract 8th word... #suppose $abc has the string; $abc=split[/\s+/]->[8]; #somebody told me like this. but it doesnt work. if i use some array in th

a very simple question

2002-01-29 Thread Dhiraj P Nilange
Hello actually its very simple to answer for who knows basic perl. Suppose I have a string in $str I wanto extract some part of it based on regex and store it in the same string. how do i do that? say... $str=~ $str /\d\d\s*$/; but this doesnt work. seems some syntax problem.. help -dhiraj

dir/file from ftp site

2002-01-29 Thread Dhiraj P Nilange
I want to connect to a ftp site and in I want to get a list of all files and directories in some given directory. I know how to do that using Net::FTP package. I want to know that after issuing what will be easiest way to check whether each entry in the directory list is a file or a directory? I

Can't locate Net:/FTP.pm in @INC (error)

2002-01-29 Thread Dhiraj P Nilange
Hi. I have ActivePerl on my computer. When I give the following statement :- use Net::FTP; and I try to run the program from command line. The Perl gives error as below:- Can't locate Net:/FTP.pm in @INC (@INC contains F:/Perl/lib .) at line 1. BEGIN failed--compilation aborted at line 1 Th

Re: Re: Re: urgent: How to declare FILE HANDLE locally?

2002-01-27 Thread Dhiraj P Nilange
hello. sorry , i had unncecessarily opened file handle to write (WH). So here is more correct algorithm below. -dhiraj On Mon, 28 Jan 2002 Dhiraj P Nilange wrote : > > Hello,. So here is my recursive > algorithm for you to compare and see. > -Dhiraj > > #starts here >

Re: Re: urgent: How to declare FILE HANDLE locally?

2002-01-27 Thread Dhiraj P Nilange
Hello,. So here is my recursive algorithm for you to compare and see. -Dhiraj #starts here $total=0; open(WH,"> output.txt"); binmode WH,":raw"; explore("."); print "over..!\n"; print "total files=$total"; close WH; sub explore { my($dirname)=@_; my($x); unless($dirname eq "." || $dirname

creating menus in perl

2002-01-26 Thread Dhiraj P Nilange
Hi what function is available in Perl for accepting keyboard scancodes so that I can also process keys like left arrow,right arraw...etc. basically I am thinking of creating menu like interface in Perl. By the way is there any readymade things available in Perl for such purpose? Thanks -Dhira

Answer to Hubert (extracting date)

2002-01-26 Thread Dhiraj P Nilange
Hi Hubert , this is the small script which extracts anything between 2 "(" and ")" brackets. It maybe useful for others to know thats why sending it to mailing list. Regards! -Dhiraj Nilange University of Pune. #starts here $a=" (Jan 12 1990) anything"; @array; $i=0; $brac

chdir problem

2002-01-26 Thread Dhiraj P Nilange
Hello. I have Windows98. I wrote a small script just to change directory. $a=chdir("bin"); print $a; this script prints 1. So chdir returned true after success. But in reality directory is not changed. The directory named "bin" exists in the current directory. Is this problem of portability

directory is not change using "chdir"

2002-01-26 Thread Dhiraj P Nilange
Hello. I have Windows98. I wrote a small script just to change directory. $a=chdir("bin"); print $a; this script prints 1. So chdir returned true after success. But in reality directory is not changed. The directory named "bin" exists in the current directory. Is this problem of portability

urgent: How to declare FILE HANDLE locally?

2002-01-26 Thread Dhiraj P Nilange
Hello I have a very urgent and important question. How do I declare or use file handle locally in PERL? I am writing a recursive sub to locate files in subdirectories. This sub calls itself when it finds directory ; if there are directory under this directory again then again it calls itself. T