Re: Moving through tree's using LWP

2011-01-13 Thread Brandon McCaig
On Wed, Jan 12, 2011 at 11:03 AM, Jim Gibson wrote: > Methods and subroutines are not called ("interpolated") within double > quotes. Unless you choose to be dirty and "trick"[1] Perl into doing it anyway: print "@{[ $child->Tag() ]}\n"; Thanks to array dereferencing (i.e., @{} ) an anonymous a

Re: Perl OOP concept in real time scenario

2011-01-13 Thread Shlomi Fish
On Thursday 13 Jan 2011 14:55:10 Sunita Rani Pradhan wrote: > Hi Shlomi > > Thanks for your help . I meant that , in what kind of scenario > we should use OOP features(in perl) ? Well, often you need to create more than one instance of something. In that case, consider creating a class and

Re: doubt in substring

2011-01-13 Thread Shawn H Corey
On 11-01-12 11:27 PM, Sunita Rani Pradhan wrote: I have a string as; $str = "the cat sat on the mat" . How the following command works substr($str , 4, -4) on the string ? What should be the output? TITS (Try It To See) perl -le '$str = "the cat sat on the mat";print substr(

Re: Perl... Logging to console and Log file

2011-01-13 Thread Robert Wohlfarth
Thu, Jan 13, 2011 at 2:15 AM, vasanth wrote: > Kindly help me regarding the issue Im facing with the below perl > script, > > I have a below script which send the message to Console. > > I need to modify this script it send message to a Log file. > > Please find the below steps which i performed

RE: Perl OOP concept in real time scenario

2011-01-13 Thread Sunita Rani Pradhan
Hi Shlomi Thanks for your help . I meant that , in what kind of scenario we should use OOP features(in perl) ? Thanks Sunita -Original Message- From: Shlomi Fish [mailto:shlo...@iglu.org.il] Sent: Thursday, January 13, 2011 6:22 PM To: beginners@perl.org Cc: Sunita Rani Pradha

Re: Perl OOP concept in real time scenario

2011-01-13 Thread Shlomi Fish
Hi Sunita, On Thursday 13 Jan 2011 11:46:38 Sunita Rani Pradhan wrote: > Hi All > > > > Can anyone explain the Perl OOP concept with one real time > example ? How it is useful or required in our programming life? Any link > also would be helpful . First of all, note that I don't un

Re: Return value from function

2011-01-13 Thread John Delacour
At 02:34 -0500 13/01/2011, shawn wilson wrote: I dig what you're saying about always using return. However I don't (have never used / seen) a case where a sub returns last expression. An example maybe? #!/usr/local/bin/perl use strict; use feature qw(say); say &SUB(); sub SUB { my $word = "

Re: Perl... Logging to console and Log file

2011-01-13 Thread shawn wilson
On Jan 13, 2011 4:19 AM, "vasanth" wrote: > > Hi friends, > > Kindly help me regarding the issue Im facing with the below perl > script, > > I have a below script which send the message to Console. > > I need to modify this script it send message to a Log file. > > Please find the below steps whic

Perl OOP concept in real time scenario

2011-01-13 Thread Sunita Rani Pradhan
Hi All Can anyone explain the Perl OOP concept with one real time example ? How it is useful or required in our programming life? Any link also would be helpful . Thanks Sunita

Perl... Logging to console and Log file

2011-01-13 Thread vasanth
Hi friends, Kindly help me regarding the issue Im facing with the below perl script, I have a below script which send the message to Console. I need to modify this script it send message to a Log file. Please find the below steps which i performed to send a message to log. Orginal Script:

Re: Return value from function

2011-01-13 Thread Dr.Ruud
On 2011-01-13 08:18, John W. Krahn wrote: If you want to return a false value it is usually better to use return with no value: return; I prefer subs to normally return a single scalar, which can be a direct value like undef, or a reference to a more complex data structure, etc. If you all

Re: Return value from function

2011-01-13 Thread Dr.Ruud
On 2011-01-12 22:23, Parag Kalra wrote: On shell, successful command returns exit status of 0. As a best practice what status value shall a Perl function return. A function can return other kinds of values too. Going by the fact that Perl function returns the value of last command in it, I