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

Extracting a bit of a scalar variable

2006-04-20 Thread Praveena Vittal
Hi All, I am newbie to PERL.I think this is a very simple question to ask. Is there any way to print a particular bit of a digit after converting to binary form. Thanks in Advance, Praveena -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

print_r

2006-04-20 Thread Johannes Ernst
Some time ago I asked about a print_r implementation in Perl. print_r: print object structures recursively, as in PHP, see http:// php.net/print_r Because nobody seemed to have a good answer, we built our own. It has some issues -- but is probably good enough for many cases. Download from

RE: Help...[CLOSE]

2006-04-20 Thread Dhanashri Bhate
Hi, Thanks Chad, I have learnt a lot from this list, and just wanted to tell Hridyesh that if the questions are proper chances of getting a valuable response are more. Anyways, I'm unsubscribing from the list now, I better google for some time to get my doubts cleared that receiving such emails!

Re: Help...

2006-04-20 Thread Chad Perrin
On Fri, Apr 21, 2006 at 02:57:11PM +0930, Sano Babu wrote: > > If you have time to be rude, then you do have time to be polite as well. He didn't seem rude to me. -- Chad Perrin [ CCD CopyWrite | http://ccd.apotheon.org ] This sig for rent: a Signify v1.14 production from http://www.debian.org

Re: Help...

2006-04-20 Thread Sano Babu
On 4/21/06, hridyesh pant <[EMAIL PROTECTED]> wrote: > > Hi dhanashri, > I will take care in future.. > > Thanks > Hridyesh > > Dhanashri Bhate wrote: [junk snipped] >I myself am not a perl expert, and but I have taken help from the list > quite > >often and it really helps if your subject and m

Re: Help...

2006-04-20 Thread hridyesh pant
Hi dhanashri, I will take care in future.. Thanks Hridyesh Dhanashri Bhate wrote: Hi Hridyesh, Well seems like my mail was offensive! My apologies if you felt that way. If you count the number of mails that come from this news group you'll realize that many people would be first browsing thr

RE: Help...

2006-04-20 Thread Dhanashri Bhate
Hi Hridyesh, Well seems like my mail was offensive! My apologies if you felt that way. If you count the number of mails that come from this news group you'll realize that many people would be first browsing through the subject line and if they have any knowledge of the area mentioned in the subje

Re: Help...

2006-04-20 Thread Chad Perrin
On Thu, Apr 20, 2006 at 05:44:48PM +0530, Dhanashri Bhate wrote: > Hi Hridayesh, > > First of all, give a meaningful subject! > We can pass a value from one perl program to another, the simplest case > being, a.pl returns a value which is accepted by b.pl as a command line > argument! But, you nee

RE:

2006-04-20 Thread Dhanashri Bhate
Well, I am sorry if you found this reply rude, But I genuinely thought that the question didn’t clarify exactly what help the person needs! And if someone really wants to help and gets such a response on asking more details, They are also discouraged to reply to any posts :-) Dhanashri

RE:

2006-04-20 Thread Dhanashri Bhate
Well, I am sorry if you found this reply rude, But I genuinely thought that the question didn’t clarify exactly what help the person needs! And if someone really wants to help and gets such a response on asking more details, They are also discouraged to reply to any posts :-) Dhanashri

Re: arguments

2006-04-20 Thread Wijaya Edward
Hi, > It's probably slower and higher memory usage, but it seems to make > sense. > Any one else have suggestions on how to keep the args straight? > I would document my functions first. Pod is good. The hash ref idea is good for constructors with lots of optional params. Regards, Edward WI

arguments

2006-04-20 Thread Tom Allison
Maybe I'm getting old, but I'm starting to thing that if there is a method/sub/function/whatever that has more than one argument, one should always pass the args as a hash reference. This eliminates the problems of getting the variables out of order. It's probably slower and higher memory usa

Re: Hashes and scope

2006-04-20 Thread Allister
On Thursday 20 April 2006 21:48, Tom Phoenix wrote: > On 4/20/06, Allister <[EMAIL PROTECTED]> wrote: > > %qnums_quests = ($quest_number, $quest_string); > > The assignment operator replaces the entire variable on the left with > the value on the right. If you wish to modify the hash, instead of >

Re: Hashes and scope

2006-04-20 Thread Tom Phoenix
On 4/20/06, Allister <[EMAIL PROTECTED]> wrote: > %qnums_quests = ($quest_number, $quest_string); The assignment operator replaces the entire variable on the left with the value on the right. If you wish to modify the hash, instead of replacing everything it contains, you probably want a stateme

Hashes and scope

2006-04-20 Thread Allister
Hello, I am trying to assign key/value pairs to a hash from a text input file. I am able to split the text up and assign it to variables and then try and assign it to my hash, but only the last key/value pair ends up in the hash once the the foreach loop has finished. I think it may b

Re: strange errormessage from script run in cron

2006-04-20 Thread John W. Krahn
Bjørge Solli wrote: > On Thursday 20 April 2006 12:01, John W. Krahn wrote: >>Bjørge Solli wrote: >>>I have this as a part of my script: >>> >>>$ncfile = `ls -1 $mersea_cat | head -1`; >>>print $ncfile; >>> >>>It prints the desired first file in $mersea_cat, but _before_ that the ls >>>comm

Re: Coding Styles

2006-04-20 Thread Chas Owens
On 4/20/06, Brent Clark <[EMAIL PROTECTED]> wrote: snip > I really dont want to be a perl programmer that uses another languages > technics etc. snip Yeah, its not like Perl uses techniques from AWK, Sed, Shell, C, Ada, Lisp, Haskell, etc. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additio

Re: Coding Styles

2006-04-20 Thread Brent Clark
Jenda Krynicky wrote: They say you can write Fortran in any language I guess this guy tries to write Cobol. I think thats what im fighting against. I really dont want to be a perl programmer that uses another languages technics etc. And also I dont want to use / write another persons style.

Re: Help...

2006-04-20 Thread JupiterHost.Net
hridyesh pant wrote: Hi, Hello, Is there a way to pass a Value from one perl Program(a.pl) to another Perl program(b.pl). Yes, there are many. Perhaps this will help you resubmit your query in a form that will get you more useable results: http://www.catb.org/~esr/faqs/smart-question

Re: Coding Styles

2006-04-20 Thread JupiterHost.Net
Typically, it's been my experience that the guy signing the paycheck, or the one in charge of the project, is the guy calling the shots. If he wants to utilize a coding technique that is neither secure nor understandable, then he will eventually reap the benefits of his narrow-mindedness. If you h

RE: Coding Styles

2006-04-20 Thread Ron Goral
> -Original Message- > From: Brent Clark [mailto:[EMAIL PROTECTED] > Sent: Thursday, 20 April, 2006 09:39 > To: Perl FAq > Subject: Coding Styles > > > Hi all > > > I seem to be having a few run ins with the "Project Leader", in > terms of my coding style. > > Im very much for modularizin

Re: Coding Styles

2006-04-20 Thread JupiterHost.Net
Brent Clark wrote: Hi all Howdy, I seem to be having a few run ins with the "Project Leader", in terms of my coding style. Im very much for modularizing my work - hence the OO concept. That is creating packages using return in my subroutine etc (Oh and using strict) But the ex Cobol Proj

Re: strange errormessage from script run in cron

2006-04-20 Thread Chad Perrin
On Thu, Apr 20, 2006 at 01:34:18PM +0200, Bjørge Solli wrote: > > Still wondering why that errormessage was printed though, but not very > important any more. I'm curious, as well. If someone knows why that happened, I'd like to know. -- Chad Perrin [ CCD CopyWrite | http://ccd.apotheon.org ]

Coding Styles

2006-04-20 Thread Brent Clark
Hi all I seem to be having a few run ins with the "Project Leader", in terms of my coding style. Im very much for modularizing my work - hence the OO concept. That is creating packages using return in my subroutine etc (Oh and using strict) But the ex Cobol Project Leader does not want .pm. V

Re: debugging question

2006-04-20 Thread Peter Scott
On Thu, 20 Apr 2006 11:15:02 +0200, Gergely Buday wrote: > Is there a way to debug concurrent perl programs, i.e. programs that > use fork()? E.g. I would like to watch the main process. At a naive > try I got strange error messages. Do it from an xterm that has the TERM environment variable set

Re: debugging question

2006-04-20 Thread Peter Scott
On Thu, 20 Apr 2006 11:15:02 +0200, Gergely Buday wrote: > Is there a way to debug concurrent perl programs, i.e. programs that > use fork()? E.g. I would like to watch the main process. At a naive > try I got strange error messages. Correction to my previous post; TERM should be set to 'xterm'.

Re: perl cgi problem

2006-04-20 Thread Mr. Shawn H. Corey
On Thu, 2006-20-04 at 13:08 +0100, Dermot Paikkos wrote: > On 20 Apr 2006 at 11:54, Saurabh Singhvi wrote: > > > Hi > > > > I am getting 500 internal server errors when i use > > > > #!/usr/bin/perl -wT > > > > in cgi's. It goes away if i remove the T part. So what could be the > > problem?/ >

RE: Help...

2006-04-20 Thread Dhanashri Bhate
Hi Hridayesh, First of all, give a meaningful subject! We can pass a value from one perl program to another, the simplest case being, a.pl returns a value which is accepted by b.pl as a command line argument! But, you need to describe exactly what u want to do! And what you have tried till now. Th

Re: perl cgi problem

2006-04-20 Thread Dermot Paikkos
On 20 Apr 2006 at 11:54, Saurabh Singhvi wrote: > Hi > > I am getting 500 internal server errors when i use > > #!/usr/bin/perl -wT > > in cgi's. It goes away if i remove the T part. So what could be the > problem?/ Something is tainted. Check the web-server error log for the perl error. Hav

perl cgi problem

2006-04-20 Thread Saurabh Singhvi
Hi I am getting 500 internal server errors when i use #!/usr/bin/perl -wT in cgi's. It goes away if i remove the T part. So what could be the problem?/ thanks Saurabh

Re: strange errormessage from script run in cron

2006-04-20 Thread Bjørge Solli
On Thursday 20 April 2006 12:01, John W. Krahn wrote: > Bjørge Solli wrote: > > I have this as a part of my script: > > > > $ncfile = `ls -1 $mersea_cat | head -1`; > > print $ncfile; > > > > It prints the desired first file in $mersea_cat, but _before_ that the ls > > command prints an err

Help...

2006-04-20 Thread hridyesh pant
Hi, Is there a way to pass a Value from one perl Program(a.pl) to another Perl program(b.pl). Regards hridyesh -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: strange errormessage from script run in cron

2006-04-20 Thread John W. Krahn
Bjørge Solli wrote: > I have this as a part of my script: > > $ncfile = `ls -1 $mersea_cat | head -1`; > print $ncfile; > > It prints the desired first file in $mersea_cat, but _before_ that the ls > command prints an errormessage to stderr: > > ls: write error: Broken pipe Why not jus

debugging question

2006-04-20 Thread Gergely Buday
Is there a way to debug concurrent perl programs, i.e. programs that use fork()? E.g. I would like to watch the main process. At a naive try I got strange error messages. - Gergely -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

strange errormessage from script run in cron

2006-04-20 Thread Bjørge Solli
I have this as a part of my script: $ncfile = `ls -1 $mersea_cat | head -1`; print $ncfile; It prints the desired first file in $mersea_cat, but _before_ that the ls command prints an errormessage to stderr: ls: write error: Broken pipe I do not get this error when I run the command/sc

Re: golf

2006-04-20 Thread Chad Perrin
On Thu, Apr 20, 2006 at 09:15:12AM +0200, Dr.Ruud wrote: > Chad Perrin schreef: > > > This is kind of a frivolous question, but . . . is there some way to > > golf this? > > > > while (<>) { > > s/\n/ /; > > print; > > } > > Create a file called (for example) "-p" with somewhat like this

Class::DBI is slow?

2006-04-20 Thread Ankur Gupta
Hi All, My first try with Class::DBI and DBI modules and I find that making a query using Class::DBI takes much much more time than compared to DBI. Is it me who is doing something wrong or Class::DBI is always slower(I have kind of feeling that its me who is doing something wrong). Also, I have

RE: LWP gives garbage characters

2006-04-20 Thread Thomas Bätzler
Hi, tom arnall <[EMAIL PROTECTED]> wrote: > i am trying to spider a site with LWP but get garbage > characters when i do: > > $result = $ua->get($url,%header); > my $page = $res1->content; > > 'lynx' however gives a clean result. It would be helpful to have the URL of the page you

Re: LWP gives garbage characters

2006-04-20 Thread Tom Phoenix
On 4/20/06, tom arnall <[EMAIL PROTECTED]> wrote: > i am trying to spider a site with LWP but get garbage characters These days, that probably means that somebody is using the wrong character set. It might be the site's fault, or yours, or LWP's. > 'lynx' however gives a clean result. Things ar

Re: golf

2006-04-20 Thread Dr.Ruud
Chad Perrin schreef: > This is kind of a frivolous question, but . . . is there some way to > golf this? > > while (<>) { > s/\n/ /; > print; > } Create a file called (for example) "-p" with somewhat like this: #!/usr/bin/perl -p y/\n/ / It can run on itself: -p -p -- Affijn, Ruud

LWP gives garbage characters

2006-04-20 Thread tom arnall
i am trying to spider a site with LWP but get garbage characters when i do: $result = $ua->get($url,%header); my $page = $res1->content; 'lynx' however gives a clean result. thanks, tom arnall north spit, ca -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional comma