Re: sub local variable changes global variable.

2011-10-17 Thread Rob Dixon
On 16/10/2011 00:08, JPH wrote: I am passin a two-dimensional array to a sub and when the sub returns, the original array has changed. Eventually I want to pass the array into a recursive sub, so I want to find a way to circumvent this behaviour. Notice how my global is @a and the sub local is

Adding

2011-10-17 Thread Csanyi Pal
Hi, my goal is to get in a directory the following: PIC1.JPG renamed as Gyermekolimpia_Ujvidek_001.jpg PIC2.JPG renamed as Gyermekolimpia_Ujvidek_002.jpg ... PIC00223.JPG renamed as Gyermekolimpia_Ujvidek_223.jpg So far I get this to work: rename -n

Re: Adding

2011-10-17 Thread Leo Susanto
s/.+(\d{3}).jpg/Gyermekolimpia_Ujvidek_$1.jpg/i On Mon, Oct 17, 2011 at 11:46 AM, Csanyi Pal csanyi...@gmail.com wrote: Hi, my goal is to get in a directory the following: PIC1.JPG renamed as Gyermekolimpia_Ujvidek_001.jpg PIC2.JPG renamed as Gyermekolimpia_Ujvidek_002.jpg  ...

Re: Adding \.JPG$/\.jpg/ to a perlregexp

2011-10-17 Thread Csanyi Pal
Leo Susanto leosusa...@gmail.com writes: On Mon, Oct 17, 2011 at 11:46 AM, Csanyi Pal csanyi...@gmail.com wrote: my goal is to get in a directory the following: PIC1.JPG renamed as Gyermekolimpia_Ujvidek_001.jpg PIC2.JPG renamed as Gyermekolimpia_Ujvidek_002.jpg  ... PIC00223.JPG

Re: Adding \.JPG$/\.jpg/ to a perlregexp

2011-10-17 Thread Leo Susanto
http://perldoc.perl.org/perlre.html s/.+(\d{3}).jpg/Gyermekolimpia_Ujvidek_$1.jpg/i From your requirement: PIC1.JPG renamed as Gyermekolimpia_Ujvidek_001.jpg 1. the 3 last digits should be extracted: .+(\d{3}).jpg 2. rename everything before the 3 digits to: 'Gyermekolimpia_Ujvidek_':

Re: Adding \.JPG$/\.jpg/ to a perlregexp

2011-10-17 Thread Rob Coops
On Mon, Oct 17, 2011 at 9:07 PM, Csanyi Pal csanyi...@gmail.com wrote: Leo Susanto leosusa...@gmail.com writes: On Mon, Oct 17, 2011 at 11:46 AM, Csanyi Pal csanyi...@gmail.com wrote: my goal is to get in a directory the following: PIC1.JPG renamed as Gyermekolimpia_Ujvidek_001.jpg

regex help

2011-10-17 Thread Chris Stinemetz
Hello, I am getting the following error when I am trying to use regex to match a pattern and then access the memory variables: Any insight as to what I am doing wrong is greatly appreciated. Thank you, Chris Use of uninitialized value $1 in hash element at ./heh.pl line 22, $fh line 1211. Use

Re: regex help

2011-10-17 Thread Leo Susanto
From looking at the regex  if ($line =~ /17|18|19|20|21+:(\d+):(\d+)+\n+\n+CELL\s+(\d+)\s+(.+?),.+?HEH/){ against the data 10/17/11 18:25:20 #578030  25 REPT:CELL 221 CDM 2, CRC, HEH     SUPPRESSED MSGS: 0     ERROR TYPE: ONEBTS MODULAR CELL ERROR     SET: MLG BANDWIDTH CHANGE     MLG

Re: regex help

2011-10-17 Thread Brian Fraser
On Tue, Oct 18, 2011 at 12:32 AM, Chris Stinemetz chrisstinem...@gmail.comwrote: /17|18|19|20|21+:(\d+):(\d+)+\n+\n+CELL\s+(\d+)\s+(.+?),.+?HEH/ Spot the issue: / 17#Or | 18#Or | 19#Or | 20#Or | 21+:(\d+):(\d+)+\n+\n+CELL\s+(\d+)\s+(.+?),.+?HEH /x For anything