Re: Chomp method

2006-04-26 Thread nishanth ev
Hello, The chomp function will chomp off the last character if its a new line. Spaces wont be truncated by chomp. Regards Nishanth > Hello > > I am wondering how the chomp function works. I am > looking to see how > I can truncate new line and/or carriage returns from > a string. Will > chom

Re: Portal Authentication

2006-04-26 Thread nishanth ev
Hello, This has nothing to do with the Perl. You can achieve this through the IIS. Click on domain and then properties in IIS. click on Directory security and there you are. This is the best method rather than through perl. Regards Nishanth --- Chico <[EMAIL PROTECTED]> wrote: > Have a windows

Re: match file name at end of a http url

2006-04-25 Thread nishanth ev
Hello, I tried this and worked. Please let me know in case you find any bugs in this :) $url="http://dev.catalyst.perl.org/wiki/YetAnotherCatalystIntro";; if( $url =~ /\/([\w.]*$)/ ){ print $1; } else{ print "No Match"; } Regards Nishanth --- Tom Phoenix <[EMAIL PROTECTED]> wro

Re: Extracting a bit of a scalar variable

2006-04-20 Thread nishanth ev
Hello Praveena, I recommend you to use pack and unpack function. I believe you can use this to convert the digit to binary and also extract the digit of your choice from the result. perldoc -f pack type this command at your linux console if any to get the help on pack. Regards Nishanth --- Prav

Re: Split function help

2006-04-17 Thread nishanth ev
Hello, In case of linux you have to escape the . and the function name should be split and not Split. Not quite sure about windows. Regards Nishanth --- M Senthil Kumar <[EMAIL PROTECTED]> wrote: > On Mon, 17 Apr 2006, Irfan J Sayed wrote: > > > |i want to split this line in . and store in ar

Re: Learning Perl

2006-04-11 Thread nishanth ev
#!/usr/bin/perl use strict; use diagnostics; my $month; print "\t Enter Month of a year \n"; chomp($month = <>); my %days_month = ( January => 31, February => 28, March => 31 ); print "\t Number of Days in month of $month is $days_month{$month} \n"; ___

Re: Web Interface for Perl programs

2006-04-10 Thread nishanth ev
Hello Sonika, > Now i need to have a web interface to this. > so i have few questions: > 1. perl - cgi or php? go for perl-cgi > 2. how do i execute the perl programs on a different > system than the web > server. If you want to run a subroutine that is located on another server, you can use

Re: date and time in perl

2006-04-10 Thread nishanth ev
Hello, Use this code according to your requirement. #!/usr/bin/perl $no=`date`; print $no; Regards Nish __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com -- To unsubscribe, e-mail: [EMAI

Re: Automatically scheduling the execution of a sub-routine

2006-04-04 Thread nishanth ev
Nishanth --- "Dr.Ruud" <[EMAIL PROTECTED]> wrote: > nishanth ev schreef: > > Dr.Ruud: > >> nishanth ev: > > > Please don't top-post. Please cut the text that you > don't react upon, > especially sigs and tails. > > >>> def

Re: Automatically scheduling the execution of a sub-routine

2006-04-04 Thread nishanth ev
ite to /dev/null: $!"; defined(my $pid = fork) or die "Can't fork: $!"; setsidor die "Can't start a new session: $!"; Enjoy...!!! Regards Nishanth --- "Dr.Ruud" <[EMAIL PROTECTED]> wrote: > nishanth ev schreef: > > &g

Re: Automatically scheduling the execution of a sub-routine

2006-04-03 Thread nishanth ev
Hello, Just create a daemon and then put an infinite loop. Call the subroutines with a sleep set accordingly, so that the subroutine will run only at specified interval. Below is an sample code you can use. Program will run as a daemon and you can kill it using kill -9 Regards Nishanth #!/us

Re: printing a range of ip addresses

2006-03-22 Thread nishanth ev
Edit your loop like this while ($networkpart <= 158){ while ($hostpart <= 256){ print "202.90.".$networkpart.".".$hostpart, "\n"; $hostpart++; } # #Change the $hostpart back to 0 # $hostpart=0; $networkpart++; } --- Harold Castro <[EMAIL PROTECTED]> wrote: > Hi, >

Re: Flushing output

2006-03-14 Thread nishanth ev
Put one line at the starting $|=1; Actually it can be any value other than 0. Regards Nishanth --- Chas Owens <[EMAIL PROTECTED]> wrote: > On 3/13/06, Tommy Grav <[EMAIL PROTECTED]> wrote: > > I am writing some output to a file using printf. > However this output > > is buffered. > > How do I g

Re: how to rewind file?

2006-03-09 Thread nishanth ev
You can use sysseek function. For more info use perldoc perlfunc or the following link http://perldoc.perl.org/functions/sysseek.html Regards Nishanth --- [EMAIL PROTECTED] wrote: > After I use <> operator on s file handle, I need > read it from head again. I > found these is no rewind funct

Re: Stopping a Service with cgi

2006-02-16 Thread nishanth ev
Hello, I have found the right thing for starting the service using cgi. There is a software called super ftp://rpmfind.net/linux/contrib/libc6/i386/super-3.12.1-1.i386.rpm Install this and configure the same. Put relevent entries in /etc/super.tab Your script will run with full root privileges.

Re: Stopping a Service with cgi

2006-02-14 Thread nishanth ev
Hello folks, Thanks a lot for the reply. I dont mean exactly httpd. Any Service will do. I want to start and stop a serviec using cgi script. Say mysql service will do, #!/usr/bin/perl `/etc/rc.d/init.d/mysqld restart`; print"Content-type:text/html\n\n"; print"RESTARTED";

Stopping a Service with cgi

2006-02-14 Thread nishanth ev
hello Friends, Have anyone tried stopping a service say httpd usng a cgi script ? I have set a setuid for the cgi script and the script is in the root cgi-bin directory namely /var/www/cgi-bin/ with ownership root and have the following contents in the file #!/usr/bin/perl $ENV{'PATH'} = '/bin:/u