in reply to Re^4: Problems with Hash Keys and Spaces
in thread Problems with Hash Keys and Spaces
Output is:#!/usr/bin/perl use strict; use warnings; my %hash = ("Common SW Component" => "4885"); my $variable = "foo\r"; print "variable ending with carrige return is =$variable=\n"; print "$hash{$variable}\n";
Update:Even without the \r it would fail, simply because the hash value is undef and an attempt is made to print an undefined value.=ariable ending with carrige return is =foo Use of uninitialized value in concatenation (.) or string at try1.pl l +ine 8.
|
|---|