hashref slices

2006-04-25 Thread Ryan Perry

my $hashref;
my @num=qw( 0 1 2 3 4 5 );
@hashref-[EMAIL PROTECTED] = ('one', 'two', 'three', 'four', 'five', 'six');
print join('\t', keys %{$hashref}), '\n;
print join(\t, values %{$hashref}), '\n;

How do I properly use hashref slices?

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response




Re: hashref slices

2006-04-25 Thread John W. Krahn
Ryan Perry wrote:
 my $hashref;
 my @num=qw( 0 1 2 3 4 5 );
 @hashref-[EMAIL PROTECTED] = ('one', 'two', 'three', 'four', 'five', 'six');

@{ $hashref [EMAIL PROTECTED] = ('one', 'two', 'three', 'four', 'five', 'six');


 print join('\t', keys %{$hashref}), '\n;
 print join(\t, values %{$hashref}), '\n;
 
 How do I properly use hashref slices?

perldoc perlreftut
perldoc perlref
perldoc perldsc
perldoc perllol




John
-- 
use Perl;
program
fulfillment

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response




hashref slices

2006-04-03 Thread Ryan Perry

I wanted to use a hash slice, but I'm using a hashref.  Can I do both?

my @current_Flags=(  $hormone . 'DoseCycle', anotherVar,  
somethingElse );
$flags-[EMAIL PROTECTED]selectrow_array(qq{$SQLstmt});  
#returns an array, $flags is my hashref


Thanks!


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response




Re: hashref slices

2006-04-03 Thread John W. Krahn
Ryan Perry wrote:
 I wanted to use a hash slice, but I'm using a hashref.  Can I do both?

Yes.

 my @current_Flags=(  $hormone . 'DoseCycle', anotherVar,  somethingElse );
 $flags-[EMAIL PROTECTED]selectrow_array(qq{$SQLstmt});  #returns

@{ $flags }{ @current_Flags } = $dbh-selectrow_array-( $SQLstmt );


John
-- 
use Perl;
program
fulfillment

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response