Hi,

Please run perldoc Carp at your command prompt.
As you can see, cluck, longmess and shortmess not exported by default.

NAME
    Carp - alternative warn and die for modules

SYNOPSIS
        use Carp;

        # warn user (from perspective of caller)
        carp "string trimmed to 80 chars";

        # die of errors (from perspective of caller)
        croak "We're outta here!";

        # die of errors with stack backtrace
        confess "not implemented";

        # cluck, longmess and shortmess not exported by default
        use Carp qw(cluck longmess shortmess);
        cluck "This is how we got here!";
        $long_message   = longmess( "message from cluck() or confess()" );
        $short_message  = shortmess( "message from carp() or croak()" );


Krzysztof


On 2015-06-10 14:40, rakesh sharma wrote:
Hi Krzysztof

If that was the case , using the subs inside Carp should  not show any
error.
Bu I was not able to use cluck without using qw and was able to use
croak and confess without the qw.
Don't get it

thanks
rakesh

 > Date: Wed, 10 Jun 2015 14:30:28 +0200
 > From: bars0.bars0.ba...@gmail.com
 > To: rakeshsharm...@hotmail.com; beginners@perl.org
 > Subject: Re: When is qw used
 >
 > Hi,
 >
 > As far as I know qw(some list item) will import from Carp module only
 > subs that you've explicitly requested. In this example `some, list,
 > item` will be available in your namespace but not other from Carp module.
 >
 > `use Carp;` will import all of them.
 >
 > Krzysztof
 >
 >
 > On 2015-06-10 14:19, rakesh sharma wrote:
 > > I have seen perl syntax like use Carp qw(some list items)
 > > so when do we need to write like this and why is not the items of the
 > > module getting imported
 > >
 > >
 > > thanks
 > > rakesh
 >
 > --
 > To unsubscribe, e-mail: beginners-unsubscr...@perl.org
 > For additional commands, e-mail: beginners-h...@perl.org
 > http://learn.perl.org/
 >
 >

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to