Ing. Branislav Gerzo wrote:

Hello beginners@perl.org,

anyone could me help with:

use strict;
use warnings;
my %kw = ();
my $kw = \%kw;
for my $cat (split(/\//, 'something/other/foo/bar')) { $kw->{cnt}++; 
$kw->{cat${kw->{cnt}}} = $cat }

Change this line to

 for my $cat (split(/\//, 'something/other/foo/bar')) { $kw->{cnt}++; $kw->{"cat" 
. $kw->{cnt}} = $cat }

This should work.



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




Reply via email to