Re: How to grab last element of array from split with no temporary variables?

2011-08-11 Thread John W. Krahn
Peter Scott wrote: On Thu, 11 Aug 2011 16:17:51 -0700, siegfried wrote: This works! Really? I get "find: missing argument to `-exec'" I think your command also renames directories. You want that? Is there a way to do it with less typing? How can I do it without creating a temporary variab

Re: How to grab last element of array from split with no temporary variables?

2011-08-11 Thread Peter Scott
On Thu, 11 Aug 2011 16:17:51 -0700, siegfried wrote: > This works! Really? I get "find: missing argument to `-exec'" I think your command also renames directories. You want that? > Is there a way to do it with less typing? How can I do it > without creating a temporary variable "@p"? Thanks,

Re: How to grab last element of array from split with no temporary variables?

2011-08-11 Thread John W. Krahn
Shawn H Corey wrote: On 11/08/11 07:17 PM, siegfr...@heintze.com wrote: This works! Is there a way to do it with less typing? How can I do it without creating a temporary variable "@p"? Thanks, siegfried find /xyz -exec perl -e 'foreach(@ARGV){ my @p=split "/"; rename $_, "./$p[$#p].txt" } '

Re: How to grab last element of array from split with no temporary variables?

2011-08-11 Thread Jim Bauer
On Thu, 11 Aug 2011 16:17:51 -0700, wrote: > This works! Is there a way to do it with less typing? How can I do it > without creating a temporary variable "@p"? rename($_, sprintf("./%s.txt", (split '/')[-1])); -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands,

Re: How to grab last element of array from split with no temporary variables?

2011-08-11 Thread Jim Gibson
On 8/11/11 Thu Aug 11, 2011 4:17 PM, "siegfr...@heintze.com" scribbled: > This works! Is there a way to do it with less typing? How can I do it > without creating a temporary variable "@p"? > Thanks, > siegfried > > find /xyz -exec perl -e 'foreach(@ARGV){ my @p=split "/"; rename $_, > "./$p[$

Re: How to grab last element of array from split with no temporary variables?

2011-08-11 Thread Shawn H Corey
On 11/08/11 07:17 PM, siegfr...@heintze.com wrote: This works! Is there a way to do it with less typing? How can I do it without creating a temporary variable "@p"? Thanks, siegfried find /xyz -exec perl -e 'foreach(@ARGV){ my @p=split "/"; rename $_, "./$p[$#p].txt" } ' find /xyz -exec pe

How to grab last element of array from split with no temporary variables?

2011-08-11 Thread siegfried
This works! Is there a way to do it with less typing? How can I do it without creating a temporary variable "@p"? Thanks, siegfried find /xyz -exec perl -e 'foreach(@ARGV){ my @p=split "/"; rename $_, "./$p[$#p].txt" } ' -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional

Re: A beginners question regarding Perl on Windows 7

2011-08-11 Thread Murtaza Saif
Yes it works fine with Windows 7. I myself have been using it for a long time now. :) On Thu, Aug 11, 2011 at 7:09 PM, timothy adigun <2teezp...@gmail.com> wrote: > Yes. ActivePerl-5.14.1.1401-MSWin32-x86 works well on Window 7. >

Re: I am going through github perl code

2011-08-11 Thread John W. Krahn
Emeka wrote: Hello All, Hello, What is the purpose of colon here ? sub pop : method { my $self = shift; my ($list) = $self->_prepare(@_); pop @$list; my $result = $list; return $self->_finalize($result); } perldoc perlsub SYNOPSIS To declare subroutines:

I am going through github perl code

2011-08-11 Thread Emeka
Hello All, What is the purpose of colon here ? sub pop : method { my $self = shift; my ($list) = $self->_prepare(@_); pop @$list; my $result = $list; return $self->_finalize($result); } Is this how to do function alias? sub sortBy {&sort_by} # sub sort_by { my $self =

Re: A beginners question regarding Perl on Windows 7

2011-08-11 Thread timothy adigun
Yes. ActivePerl-5.14.1.1401-MSWin32-x86 works well on Window 7.

Re: Problem installing perl module

2011-08-11 Thread Shawn H Corey
On 11/08/11 03:27 AM, Chankey Pathak wrote: I downloaded the Tk module. Unpacked it by zcat Tk800.0_01.tar.gz | tar xf - then cd to that directory (cd Tk-804.029_500) then perl Makefile.PL and I got this output: http://i.stack.imgur.com/FZWWI.png I'm using RHEL6. I installed the missing packages

Problem installing perl module

2011-08-11 Thread Chankey Pathak
I downloaded the Tk module. Unpacked it by zcat Tk800.0_01.tar.gz | tar xf - then cd to that directory (cd Tk-804.029_500) then perl Makefile.PL and I got this output: http://i.stack.imgur.com/FZWWI.png I'm using RHEL6. I installed the missing packages and then the perl Makefile.PL worked fine afte