Re: Always use strict

2013-08-05 Thread Chankey Pathak
Quoting from Programming Perl book: *use v5.14;* This particular declaration turns on several pragmas including "use strict"; it also enables new features like the *say* verb, which (unlike print) adds a newline for you. The implicit strictures feature was added in v5.12. On Tue, A

Re: Always use strict

2013-08-05 Thread Peter Gordon
version 3 (v5.12.3) built for > darwin-thread-multi-2level > (with 2 registered patches, see perl -V for more detail) My curiosity had been stimulated & I came up with the below before I logged on to email it & read your reply. (I use Cygwin Perl 5.14.0) #!/usr/bin/perl $var = "

Re: Always use strict

2013-08-05 Thread Peter Gordon
it & read your reply. (I use Cygwin Perl 5.14.0) #!/usr/bin/perl $var = "A_Value"; # No error produced. #!/usr/bin/perl use strict; $var = "A_Value" # Output # Global symbol "$var" requires explicit package name at ./t line 4. # Execution of ./t aborted due

Re: Always use strict

2013-08-05 Thread Jim Gibson
On Aug 6, 2013, at 12:09 AM, Peter Gordon wrote: > I'm confused by this documentation. > http://perldoc.perl.org/functions/use.html > Does it mean that: > use 5.12.0; > automatically turns on "use strict;" ? It's pretty easy to find out: 50% echo '$x =

Re: Always use strict

2013-08-05 Thread Andy Bach
On Aug 6, 2013, at 7:09 AM, Peter Gordon wrote: > I'm confused by this documentation. > http://perldoc.perl.org/functions/use.html > Does it mean that: > use 5.12.0; > automatically turns on "use strict;" ? That's the way I read this use VERSION also en

Re: Always use strict

2013-08-05 Thread Peter Gordon
tions/use.html Does it mean that: use 5.12.0; automatically turns on "use strict;" ? -- Peter Gordon, pete...@netspace.net.au on 08/06/2013 -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Always use strict

2013-08-05 Thread Andy Bach
Nice article from the "Perl Maven" http://perlmaven.com/strict From the really useful newsletter http://perlmaven.com/perl-maven-newsletter a Andy Bach (608) 658-1890 Not at my desk

Re: use strict / nostrict

2011-07-14 Thread Paolo Gianrossi
2011/7/14 Shlomi Fish > Hi Marc, > > On Thu, 14 Jul 2011 07:18:55 -0700 > Marc wrote: > > > >> #!/usr/bin/perl > > >> use Text::CSV; > > >> use DBI; > > >> use Data::Dumper; > > > > > > There is no "use stric

Re: use strict / nostrict

2011-07-14 Thread Shlomi Fish
Hi Marc, On Thu, 14 Jul 2011 07:18:55 -0700 Marc wrote: > >> #!/usr/bin/perl > >> use Text::CSV; > >> use DBI; > >> use Data::Dumper; > > > > There is no "use strict;" and "use warnings;" at the beginning of the file: >

Re: use strict / nostrict

2011-07-14 Thread Shawn H Corey
On 11-07-14 10:18 AM, Marc wrote: If these pragmas are as important as they are, why is it that they aren't turned on in Perl by default? How about if we make them the default settings in 5.16 and then add "use nostrict;" and "use nowarnings;" for when someone wants to turn them off? For bac

use strict / nostrict

2011-07-14 Thread Marc
>> #!/usr/bin/perl >> use Text::CSV; >> use DBI; >> use Data::Dumper; > > There is no "use strict;" and "use warnings;" at the beginning of the file: I see this quite a bit on this list (and elsewhere) and I think it's very go

Re: use Strict and using module

2009-11-04 Thread Uri Guttman
> "PR" == Phil Regulski writes: PR> That took care of it. Didn't realize it was a sub in the module. Thanks! regardless of it being a sub, it was in a place that expected a normal value and not a bareword. you can use classnames as barewords in certain places (use, method calls, etc.) but

Re: use Strict and using module

2009-11-04 Thread Phil Regulski
That took care of it. Didn't realize it was a sub in the module. Thanks! Shawn H Corey wrote: Phil Regulski wrote: Error: "Bareword "NetCDF::READ" not allowed while "strict subs" in use..." What is NetCDF::READ, a subroutine? my $ncid = NetCDF::open("${netcdfDir}/REORDER.KATX_

Re: use Strict and using module

2009-11-04 Thread Shawn H Corey
Phil Regulski wrote: > Error: > "Bareword "NetCDF::READ" not allowed while "strict subs" in use..." > What is NetCDF::READ, a subroutine? > my $ncid = > NetCDF::open("${netcdfDir}/REORDER.KATX_20091104_1651.CEDRIC.Z1.BIN.nc",NetCDF::READ); If it's a sub, try: my $ncid = NetCDF::open("${netcdf

use Strict and using module

2009-11-04 Thread Phil Regulski
########## #!/usr/local/bin/perl # Programming conventions use strict; use warnings; # Modules use NetCDF; # Local require files require "/usr/local/wx/include_files/date-lib.pl"; # Setting directories my $ownerDir = "/home/disk/dagny/regulski"; my $mainD

Re: Use Strict, Perl 5.10 and Global Symbol requires explicit package name

2009-09-29 Thread Soham Das
Shit!! Thanks, How asinine of me. From: Алексеев Александр To: Soham Das Cc: beginners@perl.org Sent: Tuesday, 29 September, 2009 2:52:26 PM Subject: Re: Use Strict, Perl 5.10 and Global Symbol requires explicit package name @dates and %dates are two

Re: Use Strict, Perl 5.10 and Global Symbol requires explicit package name

2009-09-29 Thread Алексеев Александр
@dates and %dates are two different variables in Perl. An error occurs, becouse %dates is not declared. -- Alexandr A Alexeev http://web20.su/ Soham Das пишет: Take a look at the following snippet of code: #!/usr/bin/perl use warnings; use strict; use Tie::Handle::CSV; #Read Market Data my

Use Strict, Perl 5.10 and Global Symbol requires explicit package name

2009-09-29 Thread Soham Das
Take a look at the following snippet of code: #!/usr/bin/perl use warnings; use strict; use Tie::Handle::CSV; #Read Market Data my $file1= shift @ARGV; my $file2= shift @ARGV; my $master_fh=Tie::Handle::CSV->new($file1,header=>1); my $transact_fh=Tie::Handle::CSV->new($file2,header=&

Re: how to search manual for "use strict"

2008-03-13 Thread Prabu Ayyappan
- Original Message From: "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> To: beginners@perl.org Sent: Friday, March 14, 2008 5:14:40 AM Subject: how to search manual for "use strict" Hi, I want to read the installed perl manual on "use strict", so how d

Re: how to search manual for "use strict"

2008-03-13 Thread Mark Wagner
On 3/13/08, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Hi, > I want to read the installed perl manual on "use strict", so how do I search > the perl manual for "use strict" Does "perldoc strict" not work for you? -- Mark -- To unsubscr

how to search manual for "use strict"

2008-03-13 Thread itshardtogetone
Hi, I want to read the installed perl manual on "use strict", so how do I search the perl manual for "use strict" Thanks

Re: Pragmas use strict and use warnings

2007-10-31 Thread Jenda Krynicky
L PROTECTED]> wrote: > > > > snip> Whats the exact purpose of use strict > > > > > > snip > > > > > > The strict pragma has three effects (unless modified by > > > > arguments): 1. most variables must be declared (there are some >

Re: Pragmas use strict and use warnings

2007-10-31 Thread Paul Lalli
On Oct 30, 5:24 pm, [EMAIL PROTECTED] (Jenda Krynicky) wrote: > On 30 Oct 2007 at 10:22, Paul Lalli wrote: > > > > > > > On Oct 30, 11:15 am, [EMAIL PROTECTED] (Chas. Owens) wrote: > > > On 10/30/07, Kaushal Shriyan <[EMAIL PROTECTED]> wrote: > >

Re: Pragmas use strict and use warnings

2007-10-31 Thread Paul Lalli
On Oct 30, 2:23 pm, [EMAIL PROTECTED] (Kevin Viel) wrote: > > -Original Message- > > From: Paul Lalli [mailto:[EMAIL PROTECTED] > > Sent: Tuesday, October 30, 2007 12:23 PM > > To: [EMAIL PROTECTED] > > Subject: Re: Pragmas use strict and use warnings &g

Re: Pragmas use strict and use warnings

2007-10-31 Thread [EMAIL PROTECTED]
On Oct 30, 9:24 pm, [EMAIL PROTECTED] (Jenda Krynicky) wrote: > On 30 Oct 2007 at 10:22, Paul Lalli wrote: > > > > > On Oct 30, 11:15 am, [EMAIL PROTECTED] (Chas. Owens) wrote: > > > On 10/30/07, Kaushal Shriyan <[EMAIL PROTECTED]> wrote: > > > s

RE: Pragmas use strict and use warnings

2007-10-30 Thread Kevin Viel
> -Original Message- > From: Paul Lalli [mailto:[EMAIL PROTECTED] > Sent: Tuesday, October 30, 2007 12:23 PM > To: beginners@perl.org > Subject: Re: Pragmas use strict and use warnings > ...no lexical with that name... ^^^ > ...to declare a

Re: Pragmas use strict and use warnings

2007-10-30 Thread Jenda Krynicky
On 30 Oct 2007 at 10:22, Paul Lalli wrote: > On Oct 30, 11:15 am, [EMAIL PROTECTED] (Chas. Owens) wrote: > > On 10/30/07, Kaushal Shriyan <[EMAIL PROTECTED]> wrote: > > snip> Whats the exact purpose of use strict > > > > snip > > > > The str

Re: Pragmas use strict and use warnings

2007-10-30 Thread Paul Lalli
On Oct 30, 11:15 am, [EMAIL PROTECTED] (Chas. Owens) wrote: > On 10/30/07, Kaushal Shriyan <[EMAIL PROTECTED]> wrote: > snip> Whats the exact purpose of use strict > > snip > > The strict pragma has three effects (unless modified by arguments): > 1. most variables mu

Re: Pragmas use strict and use warnings

2007-10-30 Thread Chas. Owens
On 10/30/07, Kaushal Shriyan <[EMAIL PROTECTED]> wrote: snip > Whats the exact purpose of use strict snip The strict pragma has three effects (unless modified by arguments): 1. most variables must be declared (there are some exceptions) 2. only real references are allowed (symbolic r

Pragmas use strict and use warnings

2007-10-30 Thread Kaushal Shriyan
Hi Whats the exact purpose of use strict and use warnings Pragmas in the Perl Programming Language. I know use warnings turns on all useful warnings. Thanks and Regards Kaushal

Re: perl -s and use strict

2007-03-28 Thread Chas Owens
On 3/29/07, Sarthak Patnaik <[EMAIL PROTECTED]> wrote: snip Is there any workaround for this, so that I can use strict and -s together. snip Short answer: yes, the vars pragma #!/usr/bin/perl -ws use strict; use vars qw($k); print "$k\n" Long answer: It is however a bad id

RE: perl -s and use strict

2007-03-28 Thread Sarthak Patnaik
rom: Sarthak Patnaik [mailto:[EMAIL PROTECTED] Sent: Thursday, March 29, 2007 12:05 PM To: beginners@perl.org Subject: perl -s and use strict Hello, I have a small script: #!/usr/bin/perl -ws use strict; print $k; As I am using "use strict;", it is giving the following message:

Re: perl -s and use strict

2007-03-28 Thread Jeff Pang
> > > >#!/usr/bin/perl -ws > >use strict; > >print $k; > > > >As I am using "use strict;", it is giving the following message: > >Variable "$k" is not imported at ./test.pl line 3. > This is because you didn't declare t

perl -s and use strict

2007-03-28 Thread Sarthak Patnaik
Hello, I have a small script: #!/usr/bin/perl -ws use strict; print $k; As I am using "use strict;", it is giving the following message: Variable "$k" is not imported at ./test.pl line 3. Global symbol "$k" requires explicit package name at .

Re: use strict and local variables

2006-10-16 Thread Rob Dixon
Raphael Brunner wrote: > > On Mon, Oct 16, 2006 at 07:36:13PM +0800, Jeff Pang wrote: >> >> Raphael Brunner wrote: >>> >>> eg: >>> >>> use strict; >>> my $var = 20; >>> >>> print "$var\n"; >>> &

Re: use strict and local variables

2006-10-16 Thread Jeff Pang
>eg: > >use strict; >my $var = 20; > >print "before: $var\n"; >&routine; >print "after: $var\n"; >exit; > > >sub routine { > $var += 1; >> >} > Hi,you don't need the global vars at all.The same way,you can w

Re: use strict and local variables

2006-10-16 Thread Ricardo SIGNES
* Raphael Brunner <[EMAIL PROTECTED]> [2006-10-16T08:38:00] > But, my problem is, i must see this variable after the call of the sub. > I'm sorry for the first example, it was inaccurate. But this is ok (I > think) :) (because I have a lot of variables, which I must change in the > sub, I want to d

Re: use strict and local variables

2006-10-16 Thread Raphael Brunner
nside my parent-routine (in the example: the programm, but by me: the parent-sub)). Thanks for all, Raphael eg: use strict; my $var = 20; print "before: $var\n"; &routine; print "after: $var\n"; exit; sub routine { $var += 1; > >} On Mon, Oct 16, 2006 at 07

Re: use strict and local variables

2006-10-16 Thread Ovid
--- Jeff Pang <[EMAIL PROTECTED]> wrote: > Hi,you can do it by passing the vars to the subroutine like: > > my $var = 20; > &routine($var); > > sub routine { > my $var = shift; > print $var; > } > I'll second this recommendation because it makes the subroutines more flexible (what if th

Re: use strict and local variables

2006-10-16 Thread Jeff Pang
> >eg: > >use strict; >my $var = 20; > >print "$var\n"; >&routine; >exit; > > >sub routine { > print "$var\n"; >} > Hi,you can do it by passing the vars to the subroutine like: my $var = 20; &routine($var); sub ro

use strict and local variables

2006-10-16 Thread Raphael Brunner
Dear Users is there a possibility to use "use strict" and to define variables in the programm, which are also seen in the subroutines called from this block? I want the same value in the var in the subroutine like before, but without it to define as global. What could I do? Thanks for

Re: 'use strict' and filehandles

2006-08-31 Thread Ted Fines
--- Original Message --- > Ted Fines wrote: > > Hi, > > Hello, > > > I'm running into a Cach-22 with 'use strict', and filehandles. > > > > I have a program which opens two log files at the beginning: > > open(INFLOG,">>$info

Re: 'use strict' and filehandles

2006-08-31 Thread John W. Krahn
Ted Fines wrote: > Hi, Hello, > I'm running into a Cach-22 with 'use strict', and filehandles. > > I have a program which opens two log files at the beginning: > open(INFLOG,">>$info_log") || die "Could not append to $info_log_file. > Qui

RE: 'use strict' and filehandles

2006-08-31 Thread Timothy Johnson
lto:[EMAIL PROTECTED] Sent: Thursday, August 31, 2006 12:17 PM To: beginners@perl.org Subject: 'use strict' and filehandles Hi, I'm running into a Cach-22 with 'use strict', and filehandles. I have a program which opens two log files at the beginning: open(INFLOG,"&

'use strict' and filehandles

2006-08-31 Thread Ted Fines
Hi, I'm running into a Cach-22 with 'use strict', and filehandles. I have a program which opens two log files at the beginning: open(INFLOG,">>$info_log") || die "Could not append to $info_log_file. Quitting.\n"; open(ERRLOG,">>$err

Re: under 'use strict', how do you assign a value to a constant used only in a subroutine?

2006-03-18 Thread Randal L. Schwartz
> "Xavier" == Xavier Noria <[EMAIL PROTECTED]> writes: Xavier> Currently Perl has no lexical constants, the idioms to accomplish what you Xavier> want are this one Xavier> { Xavier> my $fake_constant = 50; Xavier> sub my_syb { Xavier> # closure, uses $fake_c

Re: 'use strict' problem with command line argument?

2006-03-18 Thread Mr. Shawn H. Corey
Jeff Pang wrote: Hello,John, As you said, BEGIN blocks are compiled and run first before any code in main and they have lexical scope because of the {} brackets. and in his case: #!/usr/bin/perl -w use strict; print "b in main: $b";

Re: 'use strict' problem with command line argument?

2006-03-18 Thread Jeff Pang
Hello,John, As you said, BEGIN blocks are compiled and run first before any code in main and they have lexical scope because of the {} brackets. and in his case: > > #!/usr/bin/perl -w > use strict; > print "b in mai

Re: 'use strict' problem with command line argument?

2006-03-18 Thread John W. Krahn
tom arnall wrote: > this works: BEGIN blocks are compiled and run first before any code in main and they have lexical scope because of the {} brackets. > #!/usr/bin/perl -w > use strict; > print "b in main: $b"; The variables $a and $b are special in perl

Re: 'use strict' problem with command line argument?

2006-03-18 Thread Mr. Shawn H. Corey
tom arnall wrote: Global symbol "$fn" requires explicit package name at ./v line 3 where line 3 is: my $b = `cat $fn`; is it the case that using a variable as a container for a command line argument, creates a problem for 'use strict'? No, it'

Re: 'use strict' problem with command line argument?

2006-03-18 Thread Xavier Noria
roblem for 'use strict'? I don't understand how the question relates to the trials. To know the answer you just write: use strict; my $fn = shift; my $b = `cat $fn`; Why those convoluted BEGINs with ours() and friends? -- fxn -- To unsubscribe, e-mail: [EMAIL

'use strict' problem with command line argument?

2006-03-18 Thread tom arnall
this works: #!/usr/bin/perl -w use strict; print "b in main: $b"; a(); #-- BEGIN{ our ($b); my ($fn) = @ARGV; $b = `cat $fn`;

Re: under 'use strict', how do you assign a value to a constant used only in a subroutine?

2006-03-18 Thread Xavier Noria
On Mar 18, 2006, at 20:01, tom arnall wrote: under 'use strict', how do you assign a value to a constant used only in a subroutine, without doing the assignment with every execution of the sub', and without making the constant a global variable. by constant i mean a varia

Re: under 'use strict', how do you assign a value to a constant used only in a subroutine?

2006-03-18 Thread Mr. Shawn H. Corey
tom arnall wrote: under 'use strict', how do you assign a value to a constant used only in a subroutine, without doing the assignment with every execution of the sub', and without making the constant a global variable. by constant i mean a variable which never changes value

Re: under 'use strict', how do you assign a value to a constant used only in a subroutine?

2006-03-18 Thread Tom Phoenix
On 3/18/06, tom arnall <[EMAIL PROTECTED]> wrote: > under 'use strict', how do you assign a value to a constant used only in a > subroutine, without doing the assignment with every execution of the sub', > and without making the constant a global variable. by cons

under 'use strict', how do you assign a value to a constant used only in a subroutine?

2006-03-18 Thread tom arnall
under 'use strict', how do you assign a value to a constant used only in a subroutine, without doing the assignment with every execution of the sub', and without making the constant a global variable. by constant i mean a variable which never changes value throughout the script

RE: Use Strict Question

2006-01-12 Thread Timothy Johnson
When you 'use strict', you must declare each variable using my(). my referrers = qw(one two three four); When you do this, be sure to keep in mind that whatever variable you declare will be scoped to the block it is in (or the file, if it is declared outside of a block. Do

Re: Use Strict Question

2006-01-12 Thread Omega -1911
p... trying to this thing right.. > with all these errors one might assume it's simply - forgot to do > something... > > any help in the solution to these errors is greatly appreciated > > "use strict;" is used.. > > # perl

Use Strict Question

2006-01-12 Thread Gerald Wheeler
Need a little help... trying to this thing right.. with all these errors one might assume it's simply - forgot to do something... any help in the solution to these errors is greatly appreciated "use strict;" is used.. # perl -c theta.pl > Variab

Re: use strict, aliases, local

2005-10-03 Thread Peter Scott
On Sun, 02 Oct 2005 21:08:48 +0200, Gerard Robin wrote: > I pick up this example in a tutorial (it is old but it exists and there are > many examples > and most of them are understandable (imho)) because I searched some example > of scripts > which used local. I encounter some problems to figure

Re: use strict, aliases, local

2005-10-02 Thread Gerard Robin
On Sun, Oct 02, 2005 at 08:49:30AM -0400 Jeff 'japhy' Pinyan wrote: ... > > If you REALLY want to use package variables instead of lexicals, then you > need to follow the instructions in the 'strict' documentation for > declaring your global varia

Re: use strict, aliases, local

2005-10-02 Thread Jeff 'japhy' Pinyan
On Oct 2, Gerard Robin said: use warnings; # use strict; $foo = 26; @foo = ("here's", "a", "list"); &testsub (*foo); print ("The value of \$foo is now $foo\n"); sub testsub { local (*printarray) = @_; foreach $element ( @printarray) { prin

use strict, aliases, local

2005-10-02 Thread Gerard Robin
Hello, when I try this example for aliases: use warnings; # use strict; $foo = 26; @foo = ("here's", "a", "list"); &testsub (*foo); print ("The value of \$foo is now $foo\n"); sub testsub { local (*printarray) = @_; foreach $element ( @printa

Re: use strict and load

2005-07-05 Thread Wiggins d'Anconia
Ken Killer wrote: > I load the config file in the main program using do, > > #!perl > do "conf"; > use strict; > print "value of v is $v\n"; > > and the config file has only one line, > > $v = 'hello&#x

Re: use strict and load

2005-07-04 Thread Shobha Deepthi
before $v, but I got same error as before. On 7/5/05, Chris Devers <[EMAIL PROTECTED]> wrote: On Mon, 4 Jul 2005, Ken Killer wrote: I load the config file in the main program using do, #!perl do "conf"; use strict; print "value of v is $v\n"; ---

Re: use strict and load

2005-07-04 Thread Ken Killer
I tried to add 'my' before $v, but I got same error as before. On 7/5/05, Chris Devers <[EMAIL PROTECTED]> wrote: > On Mon, 4 Jul 2005, Ken Killer wrote: > > > I load the config file in the main program using do, > > > > #!perl > > do "c

Re: use strict and load

2005-07-04 Thread Chris Devers
On Mon, 4 Jul 2005, Ken Killer wrote: > I load the config file in the main program using do, > > #!perl > do "conf"; > use strict; > print "value of v is $v\n"; > > and the config file has only one line, > >

use strict and load

2005-07-04 Thread Ken Killer
I load the config file in the main program using do, #!perl do "conf"; use strict; print "value of v is $v\n"; and the config file has only one line, $v = 'hello'; when I run the main.pl, it reports following error, how to

Re: use strict/warnings

2005-03-23 Thread Robert
I typically do: #!/usr/bin/perl #pragmas use strict; use warnings; #modules use Tk; And so on...I just think it organizes better. Robert -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.

Re: use strict/warnings

2005-03-23 Thread Chris Devers
On Wed, 23 Mar 2005, Roberts Mr Richard L wrote: > My superior and I are debating where 'use strict/warnings' should be > placed: prior to any use module statement or after? Anyone? It doesn't really matter a whole lot if the modules are well behaved. But then, that

Re: use strict/warnings

2005-03-23 Thread Wiggins d'Anconia
Roberts Mr Richard L wrote: My superior and I are debating where 'use strict/warnings' should be placed: prior to any use module statement or after? Anyone? Please start a new thread, snip old messages that are not related. Generally it doesn't matter since they are both file scoped

use strict/warnings

2005-03-23 Thread Roberts Mr Richard L
My superior and I are debating where 'use strict/warnings' should be placed: prior to any use module statement or after? Anyone? -Original Message- From: Atul Vohra [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 23, 2005 1:44 PM To: Felix Geerinckx; beginners@perl.org Subjec

Re: why to use 1)use CGI,2)use Strict ,3)use Carp in script

2004-11-04 Thread Jose Alves de Castro
On Thu, 2004-11-04 at 09:31, supriya devburman wrote: > hi Hi > why we r using > 1)use CGI, We only use CGI when we want to use methods from that module (usually on web pages); see `perldoc CGI` for more information on what you can do with it. > 2)use Strict, The correct name is

Re: why to use 1)use CGI,2)use Strict ,3)use Carp in script

2004-11-04 Thread Chris Devers
On Thu, 4 Nov 2004, supriya devburman wrote: > [W]hy [are we] using > > 1)use CGI, > 2)use Strict, > 3)use Carp > > in the begining of script sometimes[question mark] What is the use of > [them][question mark] [Are] the files CGI.pm, Strict.pm, [and] Carp.pm > defaul

why to use 1)use CGI,2)use Strict ,3)use Carp in script

2004-11-04 Thread supriya devburman
hi why we r using 1)use CGI, 2)use Strict, 3)use Carp in the begining of script sometimes. What is the use of it.Is the files CGI.pm,Strict.pm,Carp.pm default with PERL. Thnx __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam

Re: "Hash as object attribute"-Problem with "use strict"

2004-07-08 Thread Luis
Oh no, what a simple mistake. :) I thank you so much! Best regards Luis Jeff 'Japhy' Pinyan schrieb: On Jul 7, Luis said: "Can't use string ("1") as a HASH ref while "strict refs" in use at TestObject.pm line 21." sub insertFriends { my $self = @_; The problem is that $self is not what y

Re: "Hash as object attribute"-Problem with "use strict"

2004-07-07 Thread Jeff 'japhy' Pinyan
On Jul 7, Luis said: >"Can't use string ("1") as a HASH ref while "strict refs" in use at >TestObject.pm line 21." > sub insertFriends { > my $self = @_; The problem is that $self is not what you think it is. You have stored the number of elements in @_ into $self. You meant my ($sel

Re: "Hash as object attribute"-Problem with "use strict"

2004-07-07 Thread Luis
explain the problem with the hash. Thanks in advance Luis Luis schrieb: Hi, I have a problem. The following code results a "Can't use string ("1") as a HASH ref while "strict refs" in use at TestObject.pm line 21." Error if I include the "use strict&quo

"Hash as object attribute"-Problem with "use strict"

2004-07-07 Thread Luis
Hi, I have a problem. The following code results a "Can't use string ("1") as a HASH ref while "strict refs" in use at TestObject.pm line 21." Error if I include the "use strict" command. I don't understand why this error occures.

Re: Why didn't 'use strict' catch this error?

2004-05-31 Thread Paul Johnson
name); > > I have a "use UserList" line near the top of this file. I also have > "use strict" and "use warnings". > > I would have expected Perl to complain about the bareword "UserList" in > the second line, or find some other way to compl

Why didn't 'use strict' catch this error?

2004-05-30 Thread Rob Richardson
Greetings! I found the source of the "impossible error". Here are the lines that caused it: my $userList = new UserList($userFile); my $user = UserList->GetUser($logname); I have a "use UserList" line near the top of this file. I also have "use stri

RE: Problem with use strict;

2004-05-20 Thread Jan Eden
MCMULLIN, NANCY wrote on 14.05.2004: >But when I run the same code with use strict commented out - it >works just fine... A little late maybe, but CGI::Carp might be something for you. Its method fatalsToBrowser sends Perl's error messages to your browser window. HTH, Jan -- T

Re: [Perl-beginners] RE: Problem with use strict;

2004-05-14 Thread Remko Lodder
Hi, When I include the line use strict; in any perl program, I get the following error: "Internal Server Error What does occur when you run the file manually? perl -T $filename Perhaps that gives a possible error definition, Personally i tend to use ; use diagnostics; use warnings; use s

RE: Problem with use strict;

2004-05-14 Thread MCMULLIN, NANCY
Okay - got it. It now works prefacing $str = .. with my. Thanks everyone. -Original Message- From: Andrew Gaffney [mailto:[EMAIL PROTECTED] Sent: Friday, May 14, 2004 1:30 PM To: [EMAIL PROTECTED] Subject: Re: Problem with use strict; MCMULLIN, NANCY wrote: > But when I run the s

Re: Problem with use strict;

2004-05-14 Thread Andrew Gaffney
MCMULLIN, NANCY wrote: But when I run the same code with use strict commented out - it works just fine... 'use strict' enforces the use of 'my' or 'our' for variable declarations. If a variable declaration doesn't have that while 'use strict' is in e

RE: Problem with use strict;

2004-05-14 Thread MCMULLIN, NANCY
But when I run the same code with use strict commented out - it works just fine... -Original Message- From: Bob Showalter [mailto:[EMAIL PROTECTED] Sent: Friday, May 14, 2004 1:15 PM To: MCMULLIN, NANCY; [EMAIL PROTECTED] Subject: RE: Problem with use strict; MCMULLIN, NANCY wrote

RE: Problem with use strict;

2004-05-14 Thread Bob Showalter
MCMULLIN, NANCY wrote: > Hi there. > Brand new to PERL so please bear with me. (I'm running Win32/Apache) Hi. It's "Perl", not "PERL". You're excused since you're brand new :~) > > When I include the line > use strict; > in any perl pr

Re: Problem with use strict;

2004-05-14 Thread WilliamGunther
In a message dated 5/14/2004 3:05:01 PM Eastern Daylight Time, [EMAIL PROTECTED] writes: >Hi there. >Brand new to PERL so please bear with me. (I'm running Win32/Apache) > >When I include the line >use strict; >in any perl program, I get the following error: >"In

Problem with use strict;

2004-05-14 Thread MCMULLIN, NANCY
Hi there. Brand new to PERL so please bear with me. (I'm running Win32/Apache) When I include the line use strict; in any perl program, I get the following error: "Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete yo

Re: use strict and stiil do function ref without no strict 'refs';

2004-03-20 Thread JupiterHost.Net
In this case, $func holds a "hard reference", not a "soft reference". The strict pragma only blocks the latter. Here's a simple example: sub howdy { print "Howdy!\n"; } my $func = \&howdy;# hard reference $func->();# fine, even with strictures $func = 'howdy';# soft referen

Re: use strict and stiil do function ref without no strict 'refs';

2004-03-20 Thread James Edward Gray II
On Mar 20, 2004, at 1:20 PM, JupiterHost.Net wrote: Howdy List! I noticed in the source code for the File::Slurp module that it does 'use strict;' and then in sub error {} it calls a function like so : $func->($err_msg); I was curious as to how that is possible without using &quo

Re: use strict and stiil do function ref without no strict 'refs';

2004-03-20 Thread JupiterHost.Net
JupiterHost.Net wrote: Howdy List! I noticed in the source code for the File::Slurp module that it does 'use strict;' and then in sub error {} it calls a function like so : $func->($err_msg); I was curious as to how that is possible without using "no strict 'subs&#x

use strict and stiil do function ref without no strict 'refs';

2004-03-20 Thread JupiterHost.Net
Howdy List! I noticed in the source code for the File::Slurp module that it does 'use strict;' and then in sub error {} it calls a function like so : $func->($err_msg); I was curious as to how that is possible without using "no strict 'subs';" or "refs&qu

Re: syntax of use strict itself

2004-02-23 Thread Randy W. Sims
On 02/23/04 09:42, J Ingersoll wrote: HI One local resident perl expert (speaking at a LUG) suggested modifying use of the strict pragma with vars, as in : #!/usr/bin/perl -w use strict vars; I find however that it's necessary to put 'vars' in quotes to avoid a warni

syntax of use strict itself

2004-02-23 Thread J Ingersoll
HI One local resident perl expert (speaking at a LUG) suggested modifying use of the strict pragma with vars, as in : #!/usr/bin/perl -w use strict vars; I find however that it's necessary to put 'vars' in quotes to avoid a warning message, viz.: Unquoted string "

RE: Use Strict Error

2004-01-23 Thread Wiggins d Anconia
Please bottom post. > 1. You are missing ";" > Type > `egrep $name testing.txt`; > And not > 'egrep $name testing.txt' > > Not the backticks and not quotes ... > There's also no reason to use backticks in void context. perldoc -f system Please use full paths, error check, etc. if you are goi

Re: Use Strict Error

2004-01-23 Thread Rob Dixon
Bill Jastram wrote: > > When I use the following portion of Perl code: > __ > > #!/usr/bin/perl > # use with: > # perl IfThenElse tfcfam (Use all of this at the command line!) > > use strict; > use warnings; > > pr

RE: Use Strict Error

2004-01-23 Thread NYIMI Jose (BMB)
1. You are missing ";" Type `egrep $name testing.txt`; And not 'egrep $name testing.txt' Not the backticks and not quotes ... HTH, José. -Original Message- From: Bill Jastram [mailto:[EMAIL PROTECTED] Sent: Friday, January 23, 2004 4:00 PM To: [EMAIL PROTECTED]

Use Strict Error

2004-01-23 Thread Bill Jastram
When I use the following portion of Perl code: __ #!/usr/bin/perl # use with: # perl IfThenElse tfcfam (Use all of this at the command line!) use strict; use warnings; print "Search by name: "; my $name = ; 'egrep $name testing.

Re: use strict and filehandles

2004-01-22 Thread Peter Scott
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (B McKee) writes: >On Tuesday, January 20, 2004, at 10:34 AM, B McKee wrote: > >> Hi All, >> I'm having trouble understanding what use strict is trying to tell me. >> If I have run this program >...snippe

  1   2   3   4   >