Could this be the old carrage return/linefeed problem?

Windows puts both a carriage return and a linefeed after each return.
Unix uses only one of them.
Mac OS (7-9.21) uses the other.

I don't have an ascii chart handy, but maybe someone else could shed more 
light on this.



On Thursday 23 January 2003 10:45, Matt Schneider wrote:
> After you read it in from a file do you chomp (@list_names)?  If you don't
> then there is a "\n" on the end that the hash function will see and say
> that there is no data associated with that key.  Perl Windows may
> automatically ignore this I don't know.
>
> Matt Schneider
> Programmer/System Administrator
> SKLD Information Services, LLC
>
>
>
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, January 23, 2003 8:36 AM
> To: [EMAIL PROTECTED]
> Subject: [Perl-unix-users] Hash in win and Unix
>
>
> Ok, for those of you that ask for an example:
> in windows I read a file and store as hash, let's say %gen.
>
>  @keys=%gen;
> print $keys[0];#will produce the rigth thing, 'At1G0100'
>
> But if in Unix I read a list from a file, let's say @list_names
>  print $list_names[34];# will produce 'At1G0100', and
>  print $gen{$list_names[34]}; #won't work, again not in unix but fine
> in windows.
>  print $gen{$keys[0]};# it will work fine, printing the contents of the
> hash.
>
> Thanks for the interest.
> Pablo T.
>
> _______________________________________________
> Perl-Unix-Users mailing list
> [EMAIL PROTECTED]
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
> _______________________________________________
> Perl-Unix-Users mailing list
> [EMAIL PROTECTED]
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

_______________________________________________
Perl-Unix-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to