Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: scope of variables in a sub

by LanX (Saint)
on Sep 23, 2020 at 23:00 UTC ( [id://11122136]=note: print w/replies, xml ) Need Help??


in reply to scope of variables in a sub

You don't show us the input data, which leaves us speculating ...

My (weak) guess is you have an empty match setting $vsowner to undef at some point.

What happens if you change .* to .+ ?

Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery

Replies are listed 'Best First'.
Re^2: scope of variables in a sub
by frontrange (Novice) on Sep 23, 2020 at 23:32 UTC

    No difference, the data comes from a database and there are no empty records in the source, you can see the variables it populates, printed inside the foreach loop, and then untouched till it's printed outside the loop where it is uninitialized.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (5)
As of 2024-04-19 07:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found