Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Odd behavior of file test

by golux (Chaplain)
on Oct 03, 2017 at 23:34 UTC ( #1200630=note: print w/replies, xml ) Need Help??


in reply to Odd behavior of file test

Hi Trudge,

You'll need to post more of your code (like where you assign to $Cover) for us to be sure, but it certainly looks like $Cover is not getting assigned the way you expect.

If you're reticent to post code, you can always print out the expected value of $Cover, at various lines, with:

printf "Now at line %d: \$Cover = '%s'\n", __LINE__, $Cover;

and see where it's not assigned to the expected value.

Does that help?

say  substr+lc crypt(qw $i3 SI$),4,5

Replies are listed 'Best First'.
Re^2: Odd behavior of file test
by Trudge (Novice) on Oct 04, 2017 at 00:41 UTC

    OK, I've tried your suggestion in several places and it all comes back correctly with 'cover.jpg'. There was a section containing a function call, and I was able to print correctly before, during, and after the function.

    Also tried it in my file-test block and no joy! There is definitely something wonky going on.

Re^2: Odd behavior of file test
by Trudge (Novice) on Oct 04, 2017 at 00:25 UTC

    Hi golux, and thank you for a quick response. Here is where I assign $Cover ...

    my $Cover="cover.jpg";

    which is quite a bit ahead of this section of the script. And I checked again to make sure the file exists - which it does.

    I will take your suggestion and try printing $Cover in various places and post results here.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (9)
As of 2020-11-24 21:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?