On Wed, 10 Jun 2015 17:49:44 +0530
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
As others have said, to import a selected set of functions or to import
Hi Rakesh,
On Wed, 10 Jun 2015 18:10:12 +0530
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 ge
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
ing 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: ba
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..
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
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
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:
#!/us
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.
> "D" == Derek 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 is not a
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 a
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(My
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
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 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 it seems my
> choice
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 Pe
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;
>
&
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 n
mysqldump' transparent to the code. 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
he utility
'mysqldump' transparent to the code. 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 u
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
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
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("
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 d
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 use
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"
t;A - H", "I - P" and "Q - Z".
>> The spaces
>> are for readability.
>>
>> What I am doing is declaring an array and assigning the value:
>> @array = qw/All "A - H" "I - P" "Q - Z"/;
>> and then pushing the to-be-
re for readability.
What I am doing 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, h
re for readability.
What I am doing 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, h
am doing 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
individu
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 )
>
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 96
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 s
r/bin/perl
Ricardo> use strict;
Ricardo> $|=0;
Ricardo> use vars qw (%WRRConf %DHCPDConf %IPTablesConf %GeneralConf
Ricardo> %DBIConf %NetworkConf %IfCfgConf %WIPLConf
Ricardo> %WANInitConf %LANInitConf
Ricardo>
bold.
# !/usr/bin/perl
use strict;
$|=0;
use vars qw(%WRRConf %DHCPDConf %IPTablesConf %GeneralConf
%DBIConf %NetworkConf %IfCfgConf %WIPLConf
%WANInitConf %LANInitConf
%NetworkRemoteConf %WRRRemoteConf
%DHCPDRemot
Ricardo Pichler wrote:
>
> #!/usr/bin/perl
> use strict;
> $|=0;
> use vars qw (%WRRConf %DHCPDConf %IPTablesConf %GeneralConf
> %DBIConf %NetworkConf %IfCfgConf %WIPLConf
> %WANInitConf %LANInitConf
> %NetworkR
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 %Networ
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 pe
> 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]
F
>>>>> "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. Old
[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
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 (
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 met
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 a
>
> 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 mo
> 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 ``,
l
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]
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
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 wa
if /\b(tcl|java|python)\b/i; # :-)
$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 wor
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
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
Zachary Buckholz wrote:
>
> Original::
> avg_resp_time=> [ qw(@$avg_resp_time[0]
> @$avg_resp_time[1]
> @$avg_resp_time[2]
>
Original::
avg_resp_time=> [ qw(@$avg_resp_time[0]
@$avg_resp_time[1]
@$avg_resp_time[2]
@$avg_resp_tim
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 th
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 );
&g
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]
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
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
On Feb 19, Dennis G. Wicks said:
>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 );
There's no quoting operator that will do th
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,
Denn
> 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 Cha
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
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
--
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
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 acr
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 acr
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.
_
--- 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
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
y like this:
>
>('"stuff",', '"more stuff",', '"even more stuff"') # Note the double
quotes.
Nope, no matter what you do, qw() really splits on whitespace.
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
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/
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('
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",&q
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
75 matches
Mail list logo