Re: fork() question

2005-09-24 Thread Binish A R
rints. From what I understood fork creates two identical processes that become completely independent from each other. What am I missing? Peter It should print Test, but you should wait for a while .. [ ~ 1 sec ] Test is printed by the child process. -- Binish A R

Re: @ARGV

2005-09-18 Thread Binish A R
Hans Ginzel wrote: John W. Krahn napsal(a): arguments. Then how come I cannot access the first element with $ARGV[0]? Are tou not thinking on $0? HG I think @ARGV wont work in command line. Try to write the code in a script and check it out. #!/usr/bin/perl -w print $ARGV[0]; $ per

Re: problems with getpwent

2005-09-17 Thread Binish A R
Gerard Robin wrote: On Sat, Sep 17, 2005 at 08:20:55PM +0530 Binish A R wrote: Hello, I've a doubt with getpwent function. The following code [ getpwent in list context ] is getting into an infinite loop: #!/usr/bin/perl -l while

problems with getpwent

2005-09-17 Thread Binish A R
Hello, I've a doubt with getpwent function. The following code [ getpwent in list context ] is getting into an infinite loop: #!/usr/bin/perl -l while ($ref = [ getpwent() ]) { print $ref->[0]; } Actually its printing the list before going into infinite loop. when i tried the below cod

problem with Net::AIM

2005-09-10 Thread Binish A R
Hello, Has anyone tried sending aim messages with Net::AIM module? I am getting the following message while sending test messages? PARSE: how many args in '2'? I tried google'ing for this message but couldnt find a genuine fix for this. btw I used the test script [ with some modificaton like a

Re: Parsing and HTML file

2005-09-09 Thread Binish A R
Nath, Alok (STSD) wrote: Hi all, I want to read the data from an HTML file say Test.htm.For that I want to use HTML::TableExtract. Can anybody send me some pointers to write the script or give me some sample script ? Thanx, Alok. perldoc HTML::TableExtract :)

Re: catchDate

2005-09-08 Thread Binish A R
Christopher Spears wrote: I want to catch the various parts of the output of the date command. Here is my script: #!/usr/bin/perl -w use strict; my $date = system("date"); $date =~ /(\w+)/; my $day = $1; print "Day: $day\n"; Here is my output: Thu Sep 8 10:22:14 CEST 2005 Day: 0 What i

Re: Need an explanation

2005-08-26 Thread Binish A R
[EMAIL PROTECTED] wrote: while (<>) {   chomp;   next if /^#/;   next if /^$/;   $CONF{(split/=/)[0]}=(split/=/)[1]; } -Original Message- From: Binish A R <[EMAIL PROTECTED]> To: Perl Beginners Cc: [EMAIL PROTECTED]

Re: Need an explanation

2005-08-26 Thread Binish A R
[EMAIL PROTECTED] wrote: maybe this is brief: while (<>) {    chomp;    next if /^#/;    next if /^$/;    my ($var1,$var2)=split /=/;    $CONF{$var1}=$var2; } -Original Message- From: Binish A R <[EMAIL PROTECTED]>

Re: System, shell question

2005-08-26 Thread Binish A R
steve tran wrote: Hello I am a beginner to perl and I have a question if I want to use system or open or backticks to execute a system command, like system("$cmd arg1"); ( with system for instance) and the $cmd which is a prog takes another program called in arg1 , and that program(arg

Need an explanation

2005-08-26 Thread Binish A R
I've a file, which has entries like the following ... IDENTIFIER1=value1; IDENTIFIER2=value2; IDENTIFIER3=value3; etc I've got to parse the above file and am using a hash to do the same ... Here is my code ... while (<>) { chomp; next if /^#/; next if /^$/; %CONF =

Re: Automatic Module install

2005-08-25 Thread Binish A R
Chris Devers wrote: On Fri, 26 Aug 2005, Binish A R wrote: I've my script which uses Expect Module. But the problem is that Expect module isn't installed by default ( at least in the machines that I've checked, viz RH9 ) Can I write some code that will automati

Automatic Module install

2005-08-25 Thread Binish A R
I've my script which uses Expect Module. But the problem is that Expect module isn't installed by default ( at least in the machines that I've checked, viz RH9 ) Can I write some code that will automatically install a module from CPAN if there isn't one? --

Forcing array context

2005-08-20 Thread Binish A R
How can I force array context ... like # echo hello: world | perl -lne '$aref = split(/:/, $_); print $aref' but thatz giving the length of the array ... I want $aref to be a reference ... How is that possible ?? A workaround is to use the following # echo hello: world | perl -lne '@ar = s

Re: Fwd: perl one liiner

2005-08-19 Thread Binish A R
anu p wrote: Note: forwarded message attached. __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com Subject: perl one liiner

Re: How to change the date/time of PC

2005-08-17 Thread Binish A R
Xiaofang Zhou wrote: Hi, I can't find any perl function to change the date/time of PC. The only way I found is `cmd.exe /C date $today`, call DOS function. Any one can give me a clue? Thanks, Xiaofang Zhou [EMAIL PROTECTED] I don't think there is any perl fu

Re: Find string ending with %

2005-08-17 Thread Binish A R
Timothy Johnson wrote: John W. Krahn wrote: [ message rearranged in chronological order. Please do not top-post ] No. If I'm responding to a message in this format, I'll use this format, but there's nothing illegitimate about top-posting. It is the email format that

Re: Emptying a log file....

2005-08-11 Thread Binish A R
Tony Frasketi wrote: Hello Listers Is there any way in perl to effectively clear the contents of an ***existing*** file  (making the file empty) ?  I have a log file that I'd like to empty out after it reaches a certain maximum file size. thanks in advance Tony just openin

Re: Analyze Log

2005-08-11 Thread Binish A R
Nick wrote: Hi There, I am trying to analyze a simple log file and pull 2 pieces of data from it. The log looks as follows: www.example.com 42f3ca1042f8c42f0 7338 0 3638 Where each valie is tab seperated. I want to create a hash with "www.example.com"

Re: help with pack/unpack

2005-08-09 Thread Binish A R
Binish A R wrote: I've a bit string something like 1100110100111 which is the bit representation of A and B together. How can I use unpack/pack to get this characters back? oops small mistake .. the bit representation for AB together is 01010110. Going thru perlpackt

help with pack/unpack

2005-08-09 Thread Binish A R
I've a bit string something like 1100110100111 which is the bit representation of A and B together. How can I use unpack/pack to get this characters back? -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: reference to an array

2005-08-08 Thread Binish A R
David Baird wrote: On 8/8/05, Binish A R <[EMAIL PROTECTED]> wrote: I am a bit confused whether this is possible or not? I would like to have an array reference, the command am using is something like : -- $sth = $dbh->prepare("SELECT * from tablename"); $sth->

reference to an array

2005-08-08 Thread Binish A R
I am a bit confused whether this is possible or not? I would like to have an array reference, the command am using is something like : -- $sth = $dbh->prepare("SELECT * from tablename"); $sth->execute; $aref = $sth->fetchrow_array; -- The last line, viz $aref = $sth->fetchrow_array; I am expec

Re: Compiling perl scripts

2005-08-05 Thread Binish A R
Larsen, Errin M HMMA/IT wrote: Larsen, Errin M HMMA/IT wrote: Binish A R wrote: Does anyone knows how to compile perl scripts to executables? I'm working on RH Linux and would like to know the details. I know that I can use perlcc to do that ... but it isn't compiling anyt

Compiling perl scripts

2005-08-05 Thread Binish A R
Does anyone knows how to compile perl scripts to executables? I'm working on RH Linux and would like to know the details. I know that I can use perlcc to do that ... but it isn't compiling anything other than a simple 'hello world' program :( Is there any other tools besides perlcc ?? Thanks i

Re: Simple question

2005-05-30 Thread Binish A R
Tony Marquis wrote: Very simple question. I'm reading a file and i want to remove all the in each lines. while(FIC) { $test = $_; #remove crlf. ... some code } How can i do that. Try $test =~ s/[\r\f]//g; to remove newlines, use $test =~ s/[\n]//g; -- To unsubscrib

Re: How to upgrade local module using -MCPAN?

2005-05-26 Thread Binish A R
Yu Wang wrote: Hi, All I am curious about how to upgrade local module in 'perl -MCPAN -e shell'? Thanks! Yu Hi, From the CPAN shell, try install MODULENAME force install MODULENAME like install DBI install DBD -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional command