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

Re: disambiguating require (or: require loves barewords )

by Anonymous Monk
on Jul 23, 2013 at 13:02 UTC ( [id://1045851]=note: print w/replies, xml ) Need Help??


in reply to disambiguating require (or: require loves join more than catfile)

$ perl -e " use File::Spec::Functions; my $x=q{x}; require +catfile($x +,$x) " Warning: Use of "require" without parentheses is ambiguous at -e line +1.

Replies are listed 'Best First'.
Re^2: disambiguating require (or: require loves barewords )
by Anonymous Monk on Jul 23, 2013 at 13:09 UTC
    $ perl -f -we " use File::Spec::Functions; my $x=q{x}; require catfile +($x,catfile($x,$x)) " syntax error at -e line 1, near "require catfile(" Execution of -e aborted due to compilation errors. $ perl -f -we " use File::Spec::Functions; my $x=q{x}; require scalar( +catfile($x,catfile($x,$x))) " Can't locate x\x\x in @INC

    catfile isn't a builtin, scalar is a builtin, so perl knows scalar isn't a bareword, but it thinks catfile is a bareword :)

      bareword as in modulename

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (4)
As of 2024-03-29 07:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found