Re: array ref as subroutine parameter

2012-07-13 Thread timothy adigun
Hi Chris, On Fri, Jul 13, 2012 at 3:28 AM, Shawn H Corey shawnhco...@gmail.comwrote: On 12-07-12 10:25 PM, Chris Stinemetz wrote: I have an anonymous array below and would like to know how to pass the first element to a subroutine as a parameter. push @data,

one liner for removing string from an element of string array

2012-07-13 Thread Nemana, Satya
Hi I have written a small program like this to just print file2 from the second element of the array by removing the .template from the entry (the name file2 can change and can be longer or shorter) use strict; use Data::Dumper; use warnings; my @templates = ( /a/b/c/d/e/f/file1.template,

Re: one liner for removing string from an element of string array

2012-07-13 Thread Ron Bergin
Nemana, Satya wrote: Hi I have written a small program like this to just print file2 from the second element of the array by removing the .template from the entry (the name file2 can change and can be longer or shorter) use strict; use Data::Dumper; use warnings; my @templates = (

Re: one liner for removing string from an element of string array

2012-07-13 Thread Shlomi Fish
Hi Satya, On Fri, 13 Jul 2012 15:38:20 + Nemana, Satya snem...@sonusnet.com wrote: Hi I have written a small program like this to just print file2 from the second element of the array by removing the .template from the entry (the name file2 can change and can be longer or shorter)

Re: one liner for removing string from an element of string array

2012-07-13 Thread Shawn H Corey
On 12-07-13 11:59 AM, Shlomi Fish wrote: See File::Basename -http://perldoc.perl.org/File/Basename.html . In the future, you may wish to use regular expressions for similar task There are a number of modules installed with Perl that make working with file systems easier: perldoc

Re: one liner for removing string from an element of string array

2012-07-13 Thread Uri Guttman
On 07/13/2012 12:27 PM, Shawn H Corey wrote: On 12-07-13 11:59 AM, Shlomi Fish wrote: See File::Basename -http://perldoc.perl.org/File/Basename.html . In the future, you may wish to use regular expressions for similar task There are a number of modules installed with Perl that make working

Re: one liner for removing string from an element of string array

2012-07-13 Thread Shawn H Corey
On 12-07-13 12:32 PM, Uri Guttman wrote: On 07/13/2012 12:27 PM, Shawn H Corey wrote: On 12-07-13 11:59 AM, Shlomi Fish wrote: See File::Basename -http://perldoc.perl.org/File/Basename.html . In the future, you may wish to use regular expressions for similar task There are a number of

Re: one liner for removing string from an element of string array

2012-07-13 Thread Shawn H Corey
On 12-07-13 12:32 PM, Uri Guttman wrote: On 07/13/2012 12:27 PM, Shawn H Corey wrote: On 12-07-13 11:59 AM, Shlomi Fish wrote: See File::Basename -http://perldoc.perl.org/File/Basename.html . In the future, you may wish to use regular expressions for similar task There are a number of

Re: Unicode question

2012-07-13 Thread Manfred Lotz
On Thu, 12 Jul 2012 15:40:55 -0500 Andy Bach afb...@gmail.com wrote: On Thu, Jul 12, 2012 at 3:25 PM, Manfred Lotz manfred.l...@arcor.de wrote: This is really nice. I fumbled with unpack before but have to admit that I didn't know about 'use bytes' which is the key. Couple interesting

Re: Unicode question

2012-07-13 Thread Andy Bach
On Fri, Jul 13, 2012 at 1:17 PM, Manfred Lotz manfred.l...@arcor.de wrote: But if I'm using it in a subroutine then 'use bytes' is only effective in the scope of the subroutine, isn't it? That is how I would use it preferably. Yeah, it appears that way. use is a compile time event (require is