Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister

Re: how to debug an 'undef' that cannot be?

by greengaroo (Hermit)
on Mar 05, 2013 at 15:02 UTC ( #1021839=note: print w/replies, xml ) Need Help??

in reply to how to debug an 'undef' that cannot be?

Just to re-phrase what my fellow monks already pointed out, your problem is that you have two different $dev variable. When you use "my" in front of a variable, its scope becomes the current block. In the main program it's not a problem but in a while loop like you did, or any other kind of blocks, the variable will cease to exists at the end of said block, and will be recreated for each iteration, and it will never alter the content of the original variable defined outside of this block.

In clear: remove the "my" besides your $dev variable inside your while loop because it creates a separate variable, not related to the one you think you are using.

Good luck!

Testing never proves the absence of faults, it only shows their presence.

Replies are listed 'Best First'.
Re^2: how to debug an 'undef' that cannot be?
by perl-diddler (Hermit) on Mar 05, 2013 at 20:39 UTC

    Data: smugbatch-006-2.1.3.x86_64.rpm smugbatch-006-2.4.1.x86_64.rpm Error: cannot stat, already deleted?) path=/Share/suse/distribution/12.1/repo +/oss/suse/test2/smugbatch-6-2.1.3.x86_64.rpm, dev=(undef)

    of course 'V' == "006"

    *sigh*...thanks all!

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1021839]
[LanX]: hmm could be a myth since the root of throne is Greek
[LanX]: erix : the one armed who spent his last years in Dorn castle was a prince of Oranie ;)
[erix]: why does that tell against the Kaiser-story?
[erix]: ah, of course, makes sense

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (8)
As of 2017-12-15 16:28 GMT
Find Nodes?
    Voting Booth?
    What programming language do you hate the most?

    Results (439 votes). Check out past polls.