in reply to 'or' Bug Bear

It's not $fred, it's fred().

fred is a subroutine, not a variable. You're confusing things, because you're probably thinking that you want the scalar value that the subroutine returns.

Try this, it might make more sense to you:

my $fred = fred(); $fred or die "\n\tThis failed min!!!\n" ;

HTH :-)

Replies are listed 'Best First'.
Re^2: 'or' Bug Bear
by holli (Abbot) on Feb 10, 2005 at 11:54 UTC
    i think the "$" should indicate the perl-shell.

    Update: because when you run the code with the "$" then you get
    Variable "$fred" is not imported at ... (Did you mean &fred instead?) Global symbol "$fred" requires explicit package name at ... Execution of test.pl aborted due to compilation errors.
    instead of the OPīs output.

    Update: Ah. no. itīs the use strict in the wrong place that allows that "$fred". Above error only arises when you move the "use strict;" outside the subroutine. So in the OPīs code, the subroutine does not get called at all!!

    holli, /regexed monk/
      I don't think so, because then the subroutine would have to be called somewhere. Plus, it seems by the rest of the post that the script name is "xxrcor.pl", and it seems that it is called from a bash or something similar.

      But it makes sense, it could be...