Re: Perl realted question..

2008-01-12 Thread Celejar
On Thu, 10 Jan 2008 13:47:41 -0900 Ken Irving [EMAIL PROTECTED] wrote: On Wed, Jan 09, 2008 at 10:04:19PM -0500, ISHWAR RATTAN wrote: Is there a way to place the last line read when reading from a file? My suspicion is there is no such thing but i do want to confirm.. Just another

Re: Perl realted..?

2008-01-11 Thread pedxing
On Jan 11, 4:20 am, s. keeling [EMAIL PROTECTED] wrote: ISHWAR RATTAN [EMAIL PROTECTED]:  I am coming back toperlafter a long time.  The sample code these days also uses variable attribute my as:     my $inst = Extutils::Installed-new();     my @modules = $inst-modules();  Can any

Re: Perl realted..?

2008-01-11 Thread pedxing
On Jan 11, 4:20 am, s. keeling [EMAIL PROTECTED] wrote: ISHWAR RATTAN [EMAIL PROTECTED]:  I am coming back to perl after a long time.  The sample code these days also uses variable attribute my as:     my $inst = Extutils::Installed-new();     my @modules = $inst-modules();  Can any

Re: Perl realted..?

2008-01-11 Thread Nelson Castillo
On Jan 10, 2008 1:23 PM, Chris Howie [EMAIL PROTECTED] wrote: On Jan 10, 2008 1:11 PM, ISHWAR RATTAN [EMAIL PROTECTED] wrote: I am coming back to perl after a long time. The sample code these days also uses variable attribute my as: my $inst = Extutils::Installed-new(); my

Re: Perl realted..?

2008-01-11 Thread Dave Sherohman
On Fri, Jan 11, 2008 at 01:51:44AM -0800, pedxing wrote: But the point is that scope doesn't change in a loop, but it does in a subroutine. You are incorrect. Every set of { braces } is its own (sub)scope, regardless of whether they are separated out into a sub or not. ~$ perl -w -e ' { my

Re: Perl realted..?

2008-01-11 Thread Chris Howie
On Jan 11, 2008 4:01 AM, pedxing [EMAIL PROTECTED] wrote: #!/usr/bin/perl # this just re-implements tail -1 # # usage: # /this/file /some/text/file.txt # my $last; while( ) { $last = $_; } print $last; - Now, try with the my $last;

[OT] Re: Perl realted..?

2008-01-11 Thread s. keeling
pedxing [EMAIL PROTECTED]: On Jan 11, 4:20 am, s. keeling [EMAIL PROTECTED] wrote:       -            #!/usr/bin/perl            # this just re-implements tail -1            #            # usage:            #   /this/file /some/text/file.txt          

Perl realted..?

2008-01-10 Thread ISHWAR RATTAN
I am coming back to perl after a long time. The sample code these days also uses variable attribute my as: my $inst = Extutils::Installed-new(); my @modules = $inst-modules(); Can any demistify 'my' for me?? -ishwar -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of

Re: Perl realted..?

2008-01-10 Thread Chris Howie
On Jan 10, 2008 1:11 PM, ISHWAR RATTAN [EMAIL PROTECTED] wrote: I am coming back to perl after a long time. The sample code these days also uses variable attribute my as: my $inst = Extutils::Installed-new(); my @modules = $inst-modules(); Can any demistify 'my' for me?? -ishwar

Re: Perl realted..?

2008-01-10 Thread Arthur Furlan
ISHWAR RATTAN escreveu: I am coming back to perl after a long time. The sample code these days also uses variable attribute my as: my $inst = Extutils::Installed-new(); my @modules = $inst-modules(); Can any demistify 'my' for me?? http://perldoc.perl.org/functions/my.html --

Re: Perl realted question..

2008-01-10 Thread Scott Gifford
Dave Sherohman [EMAIL PROTECTED] writes: On Wed, Jan 09, 2008 at 09:45:15PM -0800, Sam wrote: if i read you correctly, you can read the file into an array and use pop, which will return the last element read.Or you could use @array[-1] That's rather wasteful of memory, which becomes a

Re: Perl realted question..

2008-01-10 Thread Ken Irving
On Wed, Jan 09, 2008 at 10:04:19PM -0500, ISHWAR RATTAN wrote: Is there a way to place the last line read when reading from a file? My suspicion is there is no such thing but i do want to confirm.. Just another guess at what you're asking about; perhaps the word placed was intended to be

Re: Perl realted..?

2008-01-10 Thread s. keeling
ISHWAR RATTAN [EMAIL PROTECTED]: I am coming back to perl after a long time. The sample code these days also uses variable attribute my as: my $inst = Extutils::Installed-new(); my @modules = $inst-modules(); Can any demistify 'my' for me??

Perl realted question..

2008-01-09 Thread ISHWAR RATTAN
Is there a way to place the last line read when reading from a file? My suspicion is there is no such thing but i do want to confirm.. -ishwar -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]

Re: Perl realted question..

2008-01-09 Thread Chris Howie
On Jan 9, 2008 10:04 PM, ISHWAR RATTAN [EMAIL PROTECTED] wrote: Is there a way to place the last line read when reading from a file? My suspicion is there is no such thing but i do want to confirm.. What do you mean by place? -- Chris Howie http://www.chrishowie.com

Re: Perl realted question..

2008-01-09 Thread Sam
if i read you correctly, you can read the file into an array and use pop, which will return the last element read.Or you could use @array[-1] On 1/9/08, Chris Howie [EMAIL PROTECTED] wrote: On Jan 9, 2008 10:04 PM, ISHWAR RATTAN [EMAIL PROTECTED] wrote: Is there a way to place the last

Re: Perl realted question..

2008-01-09 Thread Dave Sherohman
On Wed, Jan 09, 2008 at 09:45:15PM -0800, Sam wrote: if i read you correctly, you can read the file into an array and use pop, which will return the last element read.Or you could use @array[-1] That's rather wasteful of memory, which becomes a concern with larger files. If the objective is