Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic

Re^2: @INC order not followed

by misterperl (Pilgrim)
on Oct 19, 2022 at 13:08 UTC ( #11147517=note: print w/replies, xml ) Need Help??

in reply to Re: @INC order not followed
in thread @INC order not followed

Ahh yes that does make sense, EXCEPT why did the f yield a 2-line file? f is supposed to match on filenames I thought- not grep into files? Why didnt it show me ALL of ?

I learned something here that f doesn't find the first match in @INC order- it finds a random match on eval of the regex? Seems odd NOT to yield match 1 in @INC since that's how Perl will run the files so it would make sense to go to THAT file I would think. Also in the past it went to MY CSV which I guess was just luck.


Replies are listed 'Best First'.
Re^3: @INC order not followed
by Fletch (Bishop) on Oct 19, 2022 at 19:50 UTC

    Because that's not what matched on when it searched for qr/CSV/ on the entire list of loaded "file" names. When you (string?) eval something it stubs in a representation of the location of the eval call and its showing you just the text that got eval'd there.

    And again @INC and its ordering doesn't have anything to do with the order keys returns things for the %main:: stash ( a hash, but it's a special hash). If you have %foo = qw( 2 a 22 b 222 c ) then you similarly can't say what (grep /2/, keys %h)[0] is going to wind up returning.

    The cake is a lie.
    The cake is a lie.
    The cake is a lie.

Re^3: @INC order not followed
by pryrt (Abbot) on Oct 19, 2022 at 21:23 UTC
    Please note that to list a file after you have chosen it with f, you need to use l to list one "page" at a time (more on that can be found in the debugger's help interface -- you will want to h to get the general overview of possible commands, and h l to get more help on l specifically; v might also be of use).

    Caveat: I am not a debugger expert. I actually learned this earlier today when I read your post, and then started playing around in the debugger to replicate. But I knew other monks were much better at the debugger than I, and could explain the f portion of your difficulty, whereas I couldn't. I waited until I read good explanations of that part, but since no one else explained how to see the contents of the file, I thought I'd now share what I learned, one debugger-newb to another.

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (2)
As of 2023-06-09 00:24 GMT
Find Nodes?
    Voting Booth?
    How often do you go to conferences?

    Results (35 votes). Check out past polls.