Re: question on reference

2008-04-19 Thread John W. Krahn
Richard Lee wrote: John W. Krahn wrote: Richard Lee wrote: Chas. Owens wrote: They do similar, but different, things. The \ operator takes a reference to a variable and [] operator creates an anonymous array. You can build [] from \ by using a temporary array that goes out of scope. my

Re: question on reference

2008-04-19 Thread Richard Lee
John W. Krahn wrote: Richard Lee wrote: Chas. Owens wrote: They do similar, but different, things. The \ operator takes a reference to a variable and [] operator creates an anonymous array. You can build [] from \ by using a temporary array that goes out of scope. my $linked = [EMAIL PR

Re: question on reference

2008-04-19 Thread John W. Krahn
Richard Lee wrote: Chas. Owens wrote: They do similar, but different, things. The \ operator takes a reference to a variable and [] operator creates an anonymous array. You can build [] from \ by using a temporary array that goes out of scope. my $linked = [EMAIL PROTECTED]; my $independ

Re: question on reference

2008-04-19 Thread Gunnar Hjalmarsson
Richard Lee wrote: why does below not work? while ( my ($key,$value) = each( %{$oj_s} ) ) { print "$key and $value\n"; } assuming that oj_s contains $VAR1 = { 'abc' => '10.0.0.1_1035', 'cde' => '192.168.1.1_1037', 'fgh' => '192.168.100.1_10', } What

Re: question on reference

2008-04-19 Thread Richard Lee
Chas. Owens wrote: On Apr 19, 2008, at 12:39, Richard Lee wrote: what is the difference?? I thought doing [ ] and \ would do the samething snip They do similar, but different, things. The \ operator takes a reference to a variable and [] operator creates an anonymous array. You can build

Re: question on reference

2008-04-19 Thread Richard Lee
Chas. Owens wrote: On Apr 19, 2008, at 12:39, Richard Lee wrote: what is the difference?? I thought doing [ ] and \ would do the samething snip They do similar, but different, things. The \ operator takes a reference to a variable and [] operator creates an anonymous array. You can build

Re: Re: CSV duplicate

2008-04-19 Thread Chas. Owens
On Sat, Apr 19, 2008 at 2:21 PM, Manoj <[EMAIL PROTECTED]> wrote: > Thanks Jeff... :) > Is this all mentioned in any Perl books? snip You can find information about HoH (hash of hashes) and other advanced data structures in The Camel*, The Llama**, and the docs that come with Perl***. * http://w

Re: Substitute Variably hort string into long string at Right Justified possition

2008-04-19 Thread Chas. Owens
On Sat, Apr 19, 2008 at 1:57 PM, Rob Dixon <[EMAIL PROTECTED]> wrote: > Chas. Owens wrote: > > On Sat, Apr 19, 2008 at 1:03 PM, Rob Dixon <[EMAIL PROTECTED]> wrote: > > snip > >> foreach my $i (1 .. ) { > >> my $zfill = substr("$i", -4); > >> my $longer = "dbt${zfill}dsfg"; > >>

RE: CSV duplicate

2008-04-19 Thread Manoj
That was really helpful...still reading... Now I think its still very much distance to the opening door of Perl programming. Thanks all :) -Original Message- From: John W. Krahn [mailto:[EMAIL PROTECTED] Sent: Friday, April 18, 2008 1:38 PM To: Perl Beginners Subject: Re: CSV duplicate

RE: Re: CSV duplicate

2008-04-19 Thread Manoj
Thanks Jeff... :) Is this all mentioned in any Perl books? -Original Message- From: Jeff Pang [mailto:[EMAIL PROTECTED] Sent: Saturday, April 19, 2008 8:47 AM To: Perl Beginners Subject: Re:Re: CSV duplicate =Original Message= >From :[EMAIL PROTECTED]; >To :John W. Krahn <[EMA

Re: Substitute Variably hort string into long string at Right Justified possition

2008-04-19 Thread Rob Dixon
Chas. Owens wrote: > On Sat, Apr 19, 2008 at 1:03 PM, Rob Dixon <[EMAIL PROTECTED]> wrote: > snip >> foreach my $i (1 .. ) { >> my $zfill = substr("$i", -4); >> my $longer = "dbt${zfill}dsfg"; >> print $longer, "\n"; >> } >> >> Rob > snip > > TIMTOWTDI fight! > > for my $i (1 ..

Re: Substitute Variably hort string into long string at Right Justified possition

2008-04-19 Thread Chas. Owens
On Sat, Apr 19, 2008 at 1:03 PM, Rob Dixon <[EMAIL PROTECTED]> wrote: snip > foreach my $i (1 .. ) { > my $zfill = substr("$i", -4); > my $longer = "dbt${zfill}dsfg"; > print $longer, "\n"; > } > > Rob snip TIMTOWTDI fight! for my $i (1 .. ) { my $longer = "0" x (4 - leng

Re: Substitute Variably hort string into long string at Right Justified possition

2008-04-19 Thread Rob Dixon
Paul Nickerson wrote: > In short, I'm looking to do this: integer 4 -> string dbt0004sfg, and > integer 287 -> string dbt0287sfg. > > And now in long, I want to iterate through creating strings to print > the bellow: > dbt0001sfg > dbt0002sfg > ... > dbt0034sfg > ... > dbt2601sfg > ... > > I thin

Re: question on reference

2008-04-19 Thread Chas. Owens
On Apr 19, 2008, at 12:39, Richard Lee wrote: what is the difference?? I thought doing [ ] and \ would do the samething snip They do similar, but different, things. The \ operator takes a reference to a variable and [] operator creates an anonymous array. You can build [] from \ by usi

question on reference

2008-04-19 Thread Richard Lee
what is the difference?? I thought doing [ ] and \ would do the samething #!/usr/bin/perl -w use strict; use Data::Dumper; my %something = ( a => 1, b => 2, c => 3, ); my %something2 = ( a => 1, b => 2, ); sub process_it { my $some