Re: Question about dereferencing

2008-06-10 Thread Jenda Krynicky
From: Christopher Yee Mon <[EMAIL PROTECTED]> > I have a bit of Perl homework where we got a code sample. I can see what > the code sample is doing except for two little bits > > There's a part that has $row->[$i] and a part that has @$row . What do > these two parts mean? $row-

Re: splt and hash problem

2008-06-10 Thread Jenda Krynicky
From: Rob Dixon <[EMAIL PROTECTED]> > I think you're using the tab character for indenting, giving you eight-column > indentation which is too much to show the structure of the blocks properly. > Four-column indenting is recommended. Which assuming you use tabs means you just need to tell the edit

Re: code references - how to

2008-06-10 Thread Rob Dixon
Dermot wrote: > Hi All, > > I was have to create a script to search and find files. The files will > end in 'a.txt', 'b.txt', 'c.txt', so a record could have 123a.txt, > 123b.txt, 123c.txt. > > There may be lots of ways to achieve my goal but I got curious about > how to create a structure that,

Re: code references - how to

2008-06-10 Thread Jenda Krynicky
From: Dermot <[EMAIL PROTECTED]> > I was have to create a script to search and find files. The files will > end in 'a.txt', 'b.txt', 'c.txt', so a record could have 123a.txt, > 123b.txt, 123c.txt. > > There may be lots of ways to achieve my goal but I got curious about > how to c

Re: format number with leading non-zero

2008-06-10 Thread Rob Dixon
William wrote: > > John W. Krahn wrote: >> >> $ perl -le' >> for my $num ( 123, 123456 ) { >> print 1 + $num; >> } >> ' >> 10123 >> 100123456 > > > Thank you, but I think this solution is more descent > > Bob McConnell wrote: >> >> Just insert the literal digit in the format

Re: the file format does not write to the output file

2008-06-10 Thread John W. Krahn
Aruna Goke wrote: If i run the below code it does not right to the voucher.rtf file. Can you guide on the best way to accomplish this. #!/usr/bin/perl use warnings; use strict; my ($pin, $pin1, $pin2, $val); format MINE= Voucher @<<< Voucher @<<< Voucher @<<<

Re: format number with leading non-zero

2008-06-10 Thread William
> $ perl -le' > for my $num ( 123, 123456 ) { > print 1 + $num; > } > ' > 10123 > 100123456 > > > > John > -- Thank you, but I think this solution is more descent > Just insert the literal digit in the format and trim the size > accordingly. > > sprintf("1%08d", $numbe

the file format does not write to the output file

2008-06-10 Thread Aruna Goke
If i run the below code it does not right to the voucher.rtf file. Can you guide on the best way to accomplish this. #!/usr/bin/perl use warnings; use strict; my ($pin, $pin1, $pin2, $val); format MINE= Voucher @<<< Voucher @<<< Voucher @<<< $val,

Re: code references - how to

2008-06-10 Thread John W. Krahn
Dermot wrote: Hi All, Hello, I was have to create a script to search and find files. The files will end in 'a.txt', 'b.txt', 'c.txt', so a record could have 123a.txt, 123b.txt, 123c.txt. There may be lots of ways to achieve my goal but I got curious about how to create a structure that, for

Re: format number with leading non-zero

2008-06-10 Thread John W. Krahn
William wrote: Hello, Hello, I want to format a number to become a 9 digits representation, every time it must have an integer 1 at the front. E.g 123 become 10123 123456 become 100123456 $ perl -le' for my $num ( 123, 123456 ) { print 1 + $num; } ' 10123 1001234

Re: format number with leading non-zero

2008-06-10 Thread William
Thank you very much, I don't if the solution is so simple. Hehe - Original Message > From: Bob McConnell <[EMAIL PROTECTED]> > To: beginner perl mailling list > Sent: Tuesday, June 10, 2008 23:40:29 > Subject: RE: format number with leading non-zero > > Just insert the literal digit in

Re: Question about dereferencing

2008-06-10 Thread Rob Dixon
Christopher Yee Mon wrote: > > I have a bit of Perl homework where we got a code sample. I can see what > the code sample is doing except for two little bits > > There's a part that has $row->[$i] and a part that has @$row . What do > these two parts mean? > > The code sample turns csv into fixe

Question about dereferencing

2008-06-10 Thread Christopher Yee Mon
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi, I have a bit of Perl homework where we got a code sample. I can see what the code sample is doing except for two little bits There's a part that has $row->[$i] and a part that has @$row . What do these two parts mean? The code sample turns csv

RE: format number with leading non-zero

2008-06-10 Thread Bob McConnell
Just insert the literal digit in the format and trim the size accordingly. sprintf("1%08d", $number); Bob McConnell -Original Message- From: William [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 10, 2008 11:05 AM To: beginner perl mailling list Subject: format number with leading non-ze

about init.d and perl

2008-06-10 Thread Rajnikant
This might not be good place to post such question, please direct me to some useful mailing list if you know. Here I'm trying to start one process from init.d directory (at system boot-up time as a service). I'm able to start that process at boot up time. This process in turn starts 2 more proces

format number with leading non-zero

2008-06-10 Thread William
Hello, I want to format a number to become a 9 digits representation, every time it must have an integer 1 at the front. E.g 123 become 10123 123456 become 100123456 If I use sprintf I can only make it to have leading zero such as sprintf("%09d", $number); Thanks. William Send instant

Re: splt and hash problem

2008-06-10 Thread Rob Dixon
Rob Dixon wrote: > > Johnson, Reginald (GTS) wrote: >> >> Thanks for assistance Rob. By adding the parentheses in the split I get >> the expected results. Yes I do need to cleanup the code. The lines that >> are indented are only for debugging, so I am going to delete them >> anyways. I will keep y

Re: splt and hash problem

2008-06-10 Thread Rob Dixon
Johnson, Reginald (GTS) wrote: > > Thanks for assistance Rob. By adding the parentheses in the split I get > the expected results. Yes I do need to cleanup the code. The lines that > are indented are only for debugging, so I am going to delete them > anyways. I will keep your suggestions in mind fo

RE: splt and hash problem

2008-06-10 Thread Johnson, Reginald (GTS)
Thanks for assistance Rob. By adding the parentheses in the split I get the expected results. Yes I do need to cleanup the code. The lines that are indented are only for debugging, so I am going to delete them anyways. I will keep your suggestions in mind for my next post. Is commenting the closing

Re: Analyze code

2008-06-10 Thread Rob Dixon
Rodrick Brown wrote: > Can someone take a look at the following sample code and let me know if you > see any areas I can improve upon I tend to use the same structure when > parsing txt files and before I commit this convention into memory maybe one > of you guru's could let me know what I can impr

Analyze code

2008-06-10 Thread Rodrick Brown
Can someone take a look at the following sample code and let me know if you see any areas I can improve upon I tend to use the same structure when parsing txt files and before I commit this convention into memory maybe one of you guru's could let me know what I can improve upon. Thanks #!/usr/bi

code references - how to

2008-06-10 Thread Dermot
Hi All, I was have to create a script to search and find files. The files will end in 'a.txt', 'b.txt', 'c.txt', so a record could have 123a.txt, 123b.txt, 123c.txt. There may be lots of ways to achieve my goal but I got curious about how to create a structure that, for each record would store th

Re: Looping through an anonymous array of arrays

2008-06-10 Thread Rob Dixon
Rodrick Brown wrote: > > my $arrayRef = [ 1, 2, 3, ['a', 'b', 'c', ["Hello"] ]]; > > I have no problem returning single elements but how would one walk this list > of elements with say a for loop? use strict; use warnings; my $arrayRef = [ 1, 2, 3, ['a', 'b', 'c', ["Hello"] ]]; my @flat = $arra

ByteLodaer Module for perl 5.10

2008-06-10 Thread sivasakthi
Hi All, I have installed perl 5.10 in to my Linux(FC9) box. I can't able to detect ByteLoader Module Searching from google i have got the info of ByteLoader is not in build in perl 5.10.. I need rpm or source of ByteLoder module.. Also searched in CPAN ..no use.. could you help me? Thanks, S

Re: how to manipulate word using perl

2008-06-10 Thread John W. Krahn
Thomas Bätzler wrote: Gowri Chandra Sekhar Barla, TLS, Chennai wrote: I facing a problem to substitute extensions of file with " = " For example: In a file I have names of some files a.txt b.txt c.txt I want them to a= b= c= Do you just want to change the text in that file, or is tha