Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: Problem undefining a variable in a loop using a module causing a list to not empty after use of a subroutine

by Khen1950fx (Canon)
on Apr 07, 2010 at 06:10 UTC ( [id://833197]=note: print w/replies, xml ) Need Help??


in reply to Problem undefining a variable in a loop using a module causing a list to not empty after use of a subroutine

I've concentrated on the characters.pl script. This may or may not help, but I'm not getting the errors that I was getting when I first ran it:
#!/usr/bin/perl use strict; use warnings; use diagnostics; foreach my $name (keys my %characters) { my $id = $name; $id =~ s/ /_/g; $id =~ s/[^-\w:.]//g; my $experience = $characters{$name}{'experience'}; my(@classes) = @{$characters{$name}{'classes'};}; print qq[<h1 id="$id">$name</h1>\n]; print "\t<p>" . print_classes($experience, @classes) . "</p>\n"; print "\t<p>Experience: $experience</p>\n"; }
  • Comment on Re: Problem undefining a variable in a loop using a module causing a list to not empty after use of a subroutine
  • Download Code

Replies are listed 'Best First'.
Re^2: Problem undefining a variable in a loop using a module causing a list to not empty after use of a subroutine
by Lady_Aleena (Priest) on Apr 07, 2010 at 06:59 UTC

    I am sorry to say that I can not see the difference other than you putting @classes in parentheses, but it may be that I am tired. Though on the same line there are two semi-colons, one before the closing bracket and one after. Did you want that semi-colon there?

    Have a nice day!
    Lady Aleena

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://833197]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (7)
As of 2024-04-18 02:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found