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
On Wed, 10 Jun 2015 17:49:44 +0530
rakesh sharma rakeshsharm...@hotmail.com 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
As others have said, to import a selected set of functions
, 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
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
thanksrakesh
Date: Wed, 10 Jun 2015 14:30:28 +0200
From: bars0.bars0.ba...@gmail.com
;
# 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
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
thanksrakesh
Hi Rakesh,
On Wed, 10 Jun 2015 18:10:12 +0530
rakesh sharma rakeshsharm...@hotmail.com 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
At 11:10 AM -0700 5/26/11, Derek wrote:
Hello, I am getting the following error:
bash: /var/www/html/bugzilla/email_in.pl: line 2: syntax error near
unexpected token `('
bash: /var/www/html/bugzilla/email_in.pl: line 2: `use Cwd
qw(abs_path);'
The contents of this file are:
#!/usr/bin/perl
Hello, I am getting the following error:
bash: /var/www/html/bugzilla/email_in.pl: line 2: syntax error near
unexpected token `('
bash: /var/www/html/bugzilla/email_in.pl: line 2: `use Cwd
qw(abs_path);'
The contents of this file are:
#!/usr/bin/perl
use Cwd qw(abs_path);
Thats all. I know
D == Derek derek...@gmail.com writes:
D Hello, I am getting the following error:
D bash: /var/www/html/bugzilla/email_in.pl: line 2: syntax error near
D unexpected token `('
big clue. what is the first word of that line? it is bash! perl is not
seeing your script for some reason. so this
Mornin' --
Derek Said:
The contents of this file are:
#!/usr/bin/perl
use Cwd qw(abs_path);
If the first line is indeed a blank line, then the default interpreter is
invoked. The '#!' has to the the first two characters on the first line of
your code.
B
On Sat, May 28, 2011 at 12:10 PM
Hi Mimi,
On Monday 12 Apr 2010 02:32:12 Mimi Cafe wrote:
My program is in the same directory as my module directory, but when I use
relative path in use lib, Perl doesn't find the module.
use lib qw(MyModule/), use lib qw(./MyModule/), use lib qw(MyModule) or use
lib qw(./MyModule
My program is in the same directory as my module directory, but when I use
relative path in use lib, Perl doesn't find the module.
use lib qw(MyModule/), use lib qw(./MyModule/), use lib qw(MyModule) or use
lib qw(./MyModule/) # these don't work.
use lib qw(/var/www/cgi-bin/MyProject
I have a feeling this is not a beginners question (I've been hacking
in Perl for many years and UNIX systems for far longer) but it seems my
choices are this list, or perl5-porters which also doesn't seem right.
Isn't there any list where non-beginner questions can be asked?
Anyway.
I have a
Post this on Perl Monks (http://perlmonks.org/) for non-beginner feed back,
Old Gray Bear
On Tue, Mar 30, 2010 at 2:38 PM, Paul Smith p...@mad-scientist.net wrote:
I have a feeling this is not a beginners question (I've been hacking
in Perl for many years and UNIX systems for far longer) but
package MyConfig;
use constant (DOCUMENT_ROOT = /var/www/);
require Exporter;
our @ISA = qw(Exporter);
our @EXPORT_OK = qw(DOCUMENT_ROOT); # This works
#our @EXPORT_OK = (DOCUMENT_ROOT); # But this does not work
1;
use MyConfig qw(DOCUMENT_ROOT);
print DOCUMENT_ROOT;
# If I do not use qw , I
William wrote:
package MyConfig;
use constant (DOCUMENT_ROOT = /var/www/);
require Exporter;
our @ISA = qw(Exporter);
our @EXPORT_OK = qw(DOCUMENT_ROOT); # This works
#our @EXPORT_OK = (DOCUMENT_ROOT); # But this does not work
1;
use MyConfig qw(DOCUMENT_ROOT);
print DOCUMENT_ROOT
Hello,
I want to give a date (the year, the day, the hour and the minute) to a
file. So, I use localtime function. But I don't understand how to use
localtime (after reading the documentation on this function). Can you
help me with this function?
Next, I want to use a shell command, so I
try the POSIX::strftime,this use the same datetime format as shell's
date command.
perl -e '
use POSIX qw/strftime/;
print strftime(%y%m%d %H:%M,localtime); '
070903 21:51
2007/9/3, Shams Fantar [EMAIL PROTECTED]:
Hello,
I want to give a date (the year, the day, the hour and the minute
Jeff Pang wrote:
try the POSIX::strftime,this use the same datetime format as shell's
date command.
perl -e '
use POSIX qw/strftime/;
print strftime(%y%m%d %H:%M,localtime); '
070903 21:51
Okay. All right.
use POSIX qw(strftime);
my $date1 = strftime(%y/%m/%d %H:%M,localtime);
my $FILE
2007/9/3, Shams Fantar [EMAIL PROTECTED]:
Jeff Pang wrote:
try the POSIX::strftime,this use the same datetime format as shell's
date command.
perl -e '
use POSIX qw/strftime/;
print strftime(%y%m%d %H:%M,localtime); '
070903 21:51
Okay. All right.
use POSIX qw(strftime);
my
Jeff Pang wrote:
2007/9/3, Shams Fantar [EMAIL PROTECTED]:
Jeff Pang wrote:
try the POSIX::strftime,this use the same datetime format as shell's
date command.
perl -e '
use POSIX qw/strftime/;
print strftime(%y%m%d %H:%M,localtime); '
070903 21:51
Okay. All right.
use POSIX
with this function?
Next, I want to use a shell command, so I use the Shell function[2], and
I must use the 'mysqldump' command :
mysqldump -u root -p *** --all-databases $FILE
The Shell module may be used to make this system call to the utility
'mysqldump' transparent to the code. Like this:
use Shell qw
. Like this:
use Shell qw( mysqldump );
my $content = mysqldump( qw( -u root -p *** --all-databases ) );
The mysqldump() function gets all the output produced by the utility
'mysqldump'. But there's very much to be gained by using Shell. And
unless your script is very small, it's
and assigning the value:
@array = qw/All A - H I - P Q - Z/;
and then pushing the to-be-determined values onto the array later on. However,
when I print this all out while testing, I get each letter, hyphen and quote as
individual elements. I've tried escaping different ways to no avail.
I've looked
is declaring an array and assigning the value:
@array = qw/All A - H I - P Q - Z/;
and then pushing the to-be-determined values onto the array later on. However,
when I print this all out while testing, I get each letter, hyphen and quote as
individual elements. I've tried escaping different ways
is declaring an array and assigning the value:
@array = qw/All A - H I - P Q - Z/;
and then pushing the to-be-determined values onto the array later on. However,
when I print this all out while testing, I get each letter, hyphen and quote as
individual elements. I've tried escaping different ways
On Aug 9, 11:58 am, [EMAIL PROTECTED] (Mathew Snyder) wrote:
What I am doing is declaring an array and assigning the value:
@array = qw/All A - H I - P Q - Z/;
You don't want qw{} here. Just do it the brute-force way:
@array = (All, A - H, I - P, Q - Z);
--
The best way to get a good
Gohaku wrote:
Hi everyone,
Hello,
I was just curious if there is someway to add a variable when using qw.
I am trying to do the following:
#Testing qw
$string_variable = abc;
@array = qw( string_literal1 string_literal2 $string_variable )
print join( ,@array);
#Would like to see
Hi everyone,
I was just curious if there is someway to add a variable when using qw.
I am trying to do the following:
#Testing qw
$string_variable = abc;
@array = qw( string_literal1 string_literal2 $string_variable )
print join( ,@array);
#Would like to see:
#string_literal1 string_literal2
gohaku [EMAIL PROTECTED] wrote:
: Hi everyone,
: I was just curious if there is someway to add a
: variable when using qw. I am trying to do the
: following:
[snip]
my $foo = 'bar';
my @arr = ( qw(foo bar), $foo );
HTH,
Charles K. Clarkson
--
Mobile Homes Specialist
254 968-8328
When using this module and Im printing out a checkbox group:
print checkbox_group(-name='hdel',-values=[$hostname]),;
is there a way to sneak through a hidden value $hostip in there somehow
aswell?
--
Kind Regards,
Otto
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands,
Hi,
I am making use of use CGI qw(:standard); to create my form. I need to
amend the size of a submit button and need to tell the button which script
to call (ie. action=test.cgi). Where can I find documentation on all the
attributes of the components, or an example for my two queries would
On Fri, 11 Jun 2004, Werner Otto wrote:
I am making use of use CGI qw(:standard); to create my form. I need to
amend the size of a submit button and need to tell the button which script
to call (ie. action=test.cgi). Where can I find documentation on all the
attributes of the components
On 11 Jun 2004, at 09:57, Werner Otto wrote:
I am making use of use CGI qw(:standard); to create my form. I need to
amend the size of a submit button
print $query-submit(-name='button_name',
-size=15,
-value='value');
and need to tell the button
Owen Cook wrote:
On Fri, 11 Jun 2004, Werner Otto wrote:
I am making use of use CGI qw(:standard); to create my form. I need to
amend the size of a submit button and need to tell the button which script
to call (ie. action=test.cgi). Where can I find documentation on all the
attributes
Hi, I'm beginner in the perl world, I having see very files .pl to learn and I have
one question...
In this script, what do make the parts in bold?
#!/usr/bin/perl
use strict;
$|=0;
use vars qw (%WRRConf %DHCPDConf %IPTablesConf %GeneralConf
%DBIConf %NetworkConf
Ricardo Pichler wrote:
#!/usr/bin/perl
use strict;
$|=0;
use vars qw (%WRRConf %DHCPDConf %IPTablesConf %GeneralConf
%DBIConf %NetworkConf %IfCfgConf %WIPLConf
%WANInitConf %LANInitConf
%NetworkRemoteConf %WRRRemoteConf
.
# !/usr/bin/perl
use strict;
$|=0;
use vars qw(%WRRConf %DHCPDConf %IPTablesConf %GeneralConf
%DBIConf %NetworkConf %IfCfgConf %WIPLConf
%WANInitConf %LANInitConf
%NetworkRemoteConf %WRRRemoteConf
%DHCPDRemoteConf
qw (%WRRConf %DHCPDConf %IPTablesConf %GeneralConf
Ricardo %DBIConf %NetworkConf %IfCfgConf %WIPLConf
Ricardo %WANInitConf %LANInitConf
Ricardo %NetworkRemoteConf %WRRRemoteConf %DHCPDRemoteConf
Ricardo
What does this line mean?
use CGI qw(:cgi-lib :standard);
I know that use CGI; means to use CGI module but what does qw(:cgi-lib
:standard) that follow use CGI mean?
Thanks,
YBS
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Yehezkiel B Syamsuhadi [EMAIL PROTECTED] asked:
What does this line mean?
use CGI qw(:cgi-lib :standard);
The qw operator makes a text into a list by splitting at
the whitespace.
That list is passed to the module as an argument. In
CGI.pm's case these arguments are used to specify what
On Nov 5, Dan Anderson said:
I've noticed that in code examples something like the following will be
used:
use Data::Dump qw(dump);
foo-bar qw(foo bar);
(Syntax may not be 100% correct).
Am I correct in assuming that if I have a subroutine foo (or method if
called with a package name), and I
[sorry about that first post, I got ^X-happy]
On Nov 5, Dan Anderson said:
use Data::Dump qw(dump);
foo-bar qw(foo bar);
Am I correct in assuming that if I have a subroutine foo (or method if
called with a package name), and I use qw() it takes all words seperated
by spaces, and passes them
Dan == Dan Anderson [EMAIL PROTECTED] writes:
Dan So: foo-bar qw(foo bar); is equivalent to foo-bar(foo,bar); ?
Only in recent Perls. The mapping of qw(...) to a (...) list at compile
time is a modern addition. Older Perls replaced it with a runtime
split on the string, and probably would
Dan So: foo-bar qw(foo bar); is equivalent to foo-bar(foo,bar); ?
Only in recent Perls.
Do you know exactly how recent? Are we talking 5 or better or 3 or
better?
Thanks in advance,
-Dan
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
On Nov 6, Dan Anderson said:
Dan So: foo-bar qw(foo bar); is equivalent to foo-bar(foo,bar); ?
Only in recent Perls.
Do you know exactly how recent? Are we talking 5 or better or 3 or
better?
Without check perldeltas, I'd say 5.6.
--
Jeff japhy Pinyan [EMAIL PROTECTED] http
I've noticed that in code examples something like the following will be
used:
use Data::Dump qw(dump);
foo-bar qw(foo bar);
(Syntax may not be 100% correct).
Am I correct in assuming that if I have a subroutine foo (or method if
called with a package name), and I use qw() it takes all words
Dan Anderson wrote:
I've noticed that in code examples something like the following will be
used:
use Data::Dump qw(dump);
foo-bar qw(foo bar);
(Syntax may not be 100% correct).
Am I correct in assuming that if I have a subroutine foo (or method if
called with a package name), and I use
Is qw for holding list of data and qx is for running commands?
Do they both indicate a list context?
Thanks,
John
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Is qw for holding list of data and qx is for running commands?
yes.
Do they both indicate a list context?
no.
qw{word word} is the same as ('word', 'word')... and qx{foo bar} is the same
as `foo bar`. qx{} is just there if you need an alternate syntax to ``,
like if you needed to use
Is qw for holding list of data and qx is for running
commands? Do they both indicate a list context? Thanks, John
perldoc -f qq
perlop Regexp Quote-Like Operators
my @stuff = qw(hi bye joe mama);
my @cmdln = qx(cat monkey.txt| grep fred);
my $cmdln = qx(cat monkey.txt| grep fred
Hi all,
What is the diff between
use Carp qw(cluck);
Carp::cluck(hello);
and
use Carp;
Carp::Cluck(hello);
I had assumed that when I 'use Carp qw ( cluck )' I will be able to use
only the cluck function of Carp but when I tried it out I found it was
not so. Then where does the difference
From: Ramprasad [EMAIL PROTECTED]
What is the diff between
use Carp qw(cluck);
Carp::cluck(hello);
and
use Carp;
Carp::Cluck(hello);
The difference is that in the first case the cluck() is imported into
the current package/namespace so you may write just
cluck(hello
hello
perl -e print qq(@INC)
prints the library paths.
Can somebody tell me what does qq do here?
Also, what does qw do in the following statement?
use HTTP::Request::Common qw(GET POST);
--rp
_
Send and receive Hotmail on your
read the Regexp Quote-Like Operators section of the perlop manpage
-Original Message-
From: Rum Pel [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, September 17, 2002 2:48 PM
To: [EMAIL PROTECTED]
Subject: qq/qw
hello
perl -e print qq(@INC)
prints the library paths.
Can
; # :-)
$baz = \n;# a one-character string
i.e. qq is just like double quotes.
qw/STRING/
Evaluates to a list of the words extracted out of
STRING, using embedded whitespace as the word
delimiters. It can
Original::
avg_resp_time= [ qw(@$avg_resp_time[0]
@$avg_resp_time[1]
@$avg_resp_time[2]
@$avg_resp_time[3
Zachary Buckholz wrote:
Original::
avg_resp_time= [ qw(@$avg_resp_time[0]
@$avg_resp_time[1]
@$avg_resp_time[2]
@$avg_resp_time[3
On Wednesday, April 17, 2002, at 04:59 , A. Rivera wrote:
@data = (test1,test2,test3,test4);
print $data[1];
my @data = qw/test1 test2 test3 test4/ ;
gives us all a chance to remember that since hubris and
laziness are two of our three virtues why quote
and comma that which can be done
Greetings;
I can get qw to work for things like
@n = qw( john jacob jingleheimer schmidt );
but something like
@n = qw( $names );
doesn't work. I get the literal string $names in @n!
What does the equivalent of qw(???) for a variable?
Many TIA!
Dennis
--
To unsubscribe, e
qw( john jacob $name ) is equivelent to
('john', 'jacob', '$name') notice the single quote. The single quotes does
not interpolate (use the special meanings of special charaters, so the $
doesn't designate a varible name it's just a $ character).
see man perlop
or perldoc perlop
-Original
What does the equivalent of qw(???) for a variable?
You mean like:
my @array = ($var1, $var2, $var3);
Jonathan Paton
__
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http
Greetings;
No, I mean if $names contains Jesus Mary Joseph and I do
my @n = qw( $names );
I want the same results as if I had done
my @n = qw( Jesus Mary Joseph );
Obviously qw() does not work this way, but I can't find the
equivalent that does.
Thanks,
Dennis
}On Feb 19
you want split then..
my $names = Jesus Mary Joseph;
my @n = split /\s+/, $names;
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 19, 2002 3:08 PM
To: [EMAIL PROTECTED]
Subject: Re: qw for variables?
Greetings;
No, I mean if $names
Dennis G. Wicks wrote:
Greetings;
No, I mean if $names contains Jesus Mary Joseph and I do
my @n = qw( $names );
I want the same results as if I had done
my @n = qw( Jesus Mary Joseph );
Obviously qw() does not work this way, but I can't find the
equivalent that does.
Thanks
The split did the trick, and cut out a few lines of code
also. I had already done some splits and joins to get ready
for qw() which I can n ow delete!
Thanks for the help everyone!
Dennis
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
In article [EMAIL PROTECTED] wrote Dennis G. Wicks [EMAIL PROTECTED]:
Greetings;
I can get qw to work for things like
@n = qw( john jacob jingleheimer schmidt );
but something like
@n = qw( $names );
doesn't work. I get the literal string $names in @n!
What
hi dear team...
I wish all of you be healthy.
do you know ...what is the acronym of qw that
use in Object-Oriented ??
thx.
Best regards. Nafiseh Saberi
www.iraninfocenter.net
www.sorna.net
Beaty is in the eye of the beholder.
_
On Wed, 5 Dec 2001, nafiseh saberi wrote:
Date: Wed, 5 Dec 2001 12:00:17 +0330
From: nafiseh saberi [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: acronym of qw
hi dear team...
I wish all of you be healthy.
do you know ...what is the acronym of qw that
i believe quote word
use
On Wed, 5 Dec 2001, nafiseh saberi wrote:
Date: Wed, 5 Dec 2001 12:00:17 +0330
From: nafiseh saberi [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: acronym of qw
hi dear team...
I wish all of you be healthy.
do you know ...what is the acronym of qw that
use in Object-Oriented ??
its
At 12:00 PM 12/5/01 +0330, nafiseh saberi wrote:
do you know ...what is the acronym of qw that
use in Object-Oriented ??
It stands for quote words.
--
Peter Scott
Pacific Systems Design Technologies
http://www.perldebugged.com
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional
I have written this:
system qw( /usr/lib/lpd/pio/etc/piomisc_ext mkpq_remote_ext -q $qname
-h $newhost.$domain.ko.com -r jfsrvrsap -t bsd -d $qname
Jetforms NT Server TEMPORARY );
Nevermind what I am doing (adding a remote print queue), I am mainly
interested in using the qw
On Thu, 4 Oct 2001, Gary L. Armstrong wrote:
system qw( /usr/lib/lpd/pio/etc/piomisc_ext mkpq_remote_ext -q $qname
-h $newhost.$domain.ko.com -r jfsrvrsap -t bsd -d $qname
Jetforms NT Server TEMPORARY );
Nevermind what I am doing (adding a remote print queue), I am mainly
--- Gary L. Armstrong [EMAIL PROTECTED] wrote:
I have written this:
system qw( /usr/lib/lpd/pio/etc/piomisc_ext mkpq_remote_ext -q $qname
-h $newhost.$domain.ko.com -r jfsrvrsap -t bsd -d $qname
Jetforms NT Server TEMPORARY );
Nevermind what I am doing (adding a remote
tell
I'll be writing far fewer ksh scripts from now on. Good job, Larry
friends.
-=GLA=-
--- Gary L. Armstrong [EMAIL PROTECTED] wrote:
I have written this:
system qw( /usr/lib/lpd/pio/etc/piomisc_ext mkpq_remote_ext -q $qname
-h $newhost.$domain.ko.com -r jfsrvrsap -t bsd -d $qname
i'm trying to work my way throuh an existing script and it says
@array = qw(stuff, more stuff, even more stuff);
what does the qw do?
thanks, nichole
It's a shortcut for assigning words to an array. That statement would return
an array that looks roughly like this:
('stuff,', 'more stuff,', 'even more stuff') # Note the double quotes.
Something like (stuff,more stuff,even more stuff); # was likely
intended, without qw().
Search for 'qw
Here is the documentation on it.
( http://www.perldoc.com/perl5.6/pod/perlop.html#qw%2fSTRING%2f )
qw/STRING/
Evaluates to a list of the words extracted out of STRING, using embedded
whitespace as the word delimiters. It can be understood as being roughly
equivalent to:
split(' ', q
On Wed, May 30, 2001 at 03:38:35PM -0500, Nichole Bialczyk wrote:
i'm trying to work my way throuh an existing script and it says
@array = qw(stuff, more stuff, even more stuff);
what does the qw do?
perldoc perlop:
qw/STRING/
Returns a list of the words extracted
On May 30, Jeffrey Goff said:
It's a shortcut for assigning words to an array. That statement would return
an array that looks roughly like this:
('stuff,', 'more stuff,', 'even more stuff') # Note the double quotes.
Nope, no matter what you do, qw() really splits on whitespace.
friday
this:
('stuff,', 'more stuff,', 'even more stuff') # Note the double
quotes.
Nope, no matter what you do, qw() really splits on whitespace.
On Wed, May 30, 2001 at 03:38:35PM -0500, Nichole Bialczyk wrote:
i'm trying to work my way throuh an existing script and it says
@array = qw(stuff, more stuff, even more stuff);
what does the qw do?
In your example, it's a broken way of trying to say:
$array[0] = stuff;
$array[1] = more
--- Nichole Bialczyk [EMAIL PROTECTED] wrote:
i'm trying to work my way throuh an existing script and it says
@array = qw(stuff, more stuff, even more stuff);
That looks like a typo, though they may have actually wanted the quotes
and commas in the strings if you run that under -w, it'll
84 matches
Mail list logo