why is empty hashref true?

2008-08-14 Thread Ryan Perry
my %hash=(test=>{}); print "true\n" if $hash{test}; # prints true How can I tell if it's empty? -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

string to perl

2006-08-07 Thread Ryan Perry
I have a string I want to pass to another function and I want that function to evaluate it as perl code: my $str='window.location=" $tableURL ? "$tableURL" : $r->uri . '?' . ($tableKey || $columnsList[0]->{dbName}) . '="+a_marked' sub dothis { my $tableURL='something'; my $

Re: Parsing HL7 records using Perl

2006-05-12 Thread Ryan Perry
A sample of an HL7 file: MSH|^~\&|REG|MCM|BTS||199601121005||ADT^A04|01|P|2.2 EVN|A04|199601121005||01||199601121000 PID|||191919^^^MYHOS^MR~123-45-6789^^^USSSA^SS|253763|SMITH^JOHN^Q|| 19560129|M|||123MAIN^^BUFFALO^NY^98052^""||(123)555-0100||S|M| 10199925^^^MYHOS^AN|123-45-6789 PD1|S|F|No

permanently changing @INC

2006-05-12 Thread Ryan Perry
How can I permanently change @INC? I've seen ways to alter this temporarily, but I want to add a directory forever. Ryan -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

hashref ref ref slice

2006-05-02 Thread Ryan Perry
@[EMAIL PROTECTED]>{text} I want to get all the "text" values for a set of keys in a hashref, but the above code always gives me only the first in @sortedkeys. Thanks for any assistance! Ryan -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

hash keys

2006-05-01 Thread Ryan Perry
Generally, your hash value is larger than you key ( $hash{key}="Some text, maybe a sentence or two"). Is there any reason I should not reverse this relationship? ($hash{"Some text, maybe a sentence or two"}='key') Thanks! -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additiona

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 a

audio

2006-04-08 Thread Ryan Perry
I want to write a program that will play an audio file. How can I do this with perl? An external library or program? Thanks! -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

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 PROTE

how do I know if it's an array?

2005-09-15 Thread Ryan Perry
I have 2 set of options on a web page. first some radios (scalar), then some check boxes (array). How will I know if I have an array or not? Thanks! -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

array of hashes of arrays...

2005-08-16 Thread Ryan Perry
How can I do this correctly? foreach my $col (@columns) { my %{$col} = ( string => "$col", number => [EMAIL PROTECTED] ); push (@graph, \%{$col}); } -- To unsubscribe, e-mail: [EMAIL PROTECTED] F