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 strict;" and "use warnings;" at the beginning of the > file: > > > > I see this quite a

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: > > I see this quite a bit on this list (and elsewhere) and I think it

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

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

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 $f

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"; >>> &routine; >>> exit; >>> >>> >>> sub routine { >>>print "$var\n"; >>> } >>> >> >> Hi,you can do it by

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 write it like: use strict; my $var = 20; print "before: $var\n"; $var = routine($va

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
Thanks for your answer! 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 define they as "global" inside my parent-rou

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 routine { my $var = shift; print $var; } -- Books below translated by

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_log") || die "Could not append to $info_log_file. > > Quitting.\n";

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. > Quitting.\n"; > open(ERRLOG,">>$error_log") || die "Could n

RE: 'use strict' and filehandles

2006-08-31 Thread Timothy Johnson
If you want to pass a filehandle like that I would recommend using the FileHandle module. As your script stands, however, you have no reason to pass the filehandle to the subroutine. You can just do a "print ERRLOG $scalar" to print. -Original Message- From: Ted Fines [mailto:[EMAIL

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"; a(); #-

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 main: $b"; > a(); > #-- >

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 which means that they

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's because you didn't tell th

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

2006-03-18 Thread Xavier Noria
On Mar 18, 2006, at 23:58, tom arnall wrote: getting: 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 '

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 a 'perldoc st

Re: Use Strict Question

2006-01-12 Thread Omega -1911
In short, you need to declare your variables in your script. my $OrderFile; my $referer; Instead of just "defining" your variable (example below) $referer = "something"; # TAINTED DATA On 1/12/06, Gerald Wheeler <[EMAIL PROTECTED]> wrote: > > Need a little help... trying to this thing right.

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 variables: > > use strict; > our

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) { print ("$element\n"); } $printarray = 61; } it gives th

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'; > > when I run the main.pl, it reports following error,

Re: use strict and load

2005-07-04 Thread Shobha Deepthi
Youare trying to print the value of $v before its declaration print "value of v is $v\n"; Try defining this variable before this print statement. Shobha Deepthi V The statement below is true. The statement above is false. Ken Killer wrote: I tried to add 'my' before $v, but I got same

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 "conf"; > > use strict; > > print "value of v is $v\n"; > > --

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, > > $v = 'hello'; Have you tried making that my $

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]

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's not necessarily a good ass

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, meaning they

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 "no strict 'subs';

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';" or "refs" or something ,

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; > > print "Search by name: "; > > my $name

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] Subject: Use Strict Err

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 >...snipped >> open(MESSAGE, "$datafile") or die "Can

Re: use strict and filehandles

2004-01-21 Thread B McKee
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 ...snipped open(MESSAGE, "$datafile") or die "Cannot open datafile: $!"; while (!eof(MESSAGE)) { $page = new CGI(MESSAGE); ...mor

RE: Use strict inside module to apply to entire script?

2004-01-20 Thread Dan Muey
> On Saturday, January 17, 2004, at 06:21 PM, Dan Muey wrote: > > I was curious if it's possible to have a module like so: > > > > package Foo:Monkey; > > > > use strict; > > use warnings; > > You can call "strict->import" like this: > > package Foo::Monkey; > sub import { > fo

Re: use strict and filehandles

2004-01-20 Thread Jan Eden
I had a similar problem passing a filehandle to a sub and learned that I had to use the typeglob instead. HTH, Jan B McKee wrote: >Hi All, >I'm having trouble understanding what use strict is trying to tell me. > >If I have run this program > >-CODE--- >#!/u

Re: Use strict inside module to apply to entire script?

2004-01-18 Thread James Edward Gray II
On Jan 18, 2004, at 12:12 AM, Steve Grazzini wrote: On Saturday, January 17, 2004, at 06:21 PM, Dan Muey wrote: I was curious if it's possible to have a module like so: package Foo:Monkey; use strict; use warnings; You can call "strict->import" like this: package Foo::Monkey; sub import

Re: Use strict inside module to apply to entire script?

2004-01-17 Thread Steve Grazzini
On Saturday, January 17, 2004, at 06:21 PM, Dan Muey wrote: I was curious if it's possible to have a module like so: package Foo:Monkey; use strict; use warnings; You can call "strict->import" like this: package Foo::Monkey; sub import { for my $pragma (qw(strict warnings)) {

Re: Use strict inside module to apply to entire script?

2004-01-17 Thread drieux
On Jan 17, 2004, at 5:20 PM, James Edward Gray II wrote: [..] I believe I read that strict and warnings are supposed to be defaults in Perl 6 modules too. James Ironically it would seem to be the correctish behavior for "use strict" and "use warnings" to be the default when one builds perl so that

Re: Use strict inside module to apply to entire script?

2004-01-17 Thread James Edward Gray II
On Jan 17, 2004, at 6:52 PM, drieux wrote: On Jan 17, 2004, at 3:21 PM, Dan Muey wrote: I was curious if it's possible to have a module like so: package Foo:Monkey; use strict; use warnings; Then in my script: #!/usr/bin/perl use Foo::Monkey; No. Try to think about the Issue of Scoping. I c

Re: Use strict inside module to apply to entire script?

2004-01-17 Thread drieux
On Jan 17, 2004, at 3:21 PM, Dan Muey wrote: I was curious if it's possible to have a module like so: package Foo:Monkey; use strict; use warnings; Then in my script: #!/usr/bin/perl use Foo::Monkey; No. Try to think about the Issue of Scoping. I can appreciate the idea that it would be cool

Re: use strict, global variables, modules

2003-09-04 Thread John W. Krahn
Emil Perhinschi wrote: > > Hi! Hello, > I'm writing a rather complicated script, reading bibtex (my code) and > xml (XML::Grove) files etc. > > I have to "use strict" and "my $variable" in order to keep references in > check, as there are lots of them. > > I want to define some "global" variab

Re: Use strict (beginner question)

2003-04-04 Thread R. Joseph Newton
[EMAIL PROTECTED] wrote: > All, > > I added the "use strict;" statement to my script for the first time and > received the following compilation errors: > Global symbol "$LoginName" requires explicit package name at todaysFiles.pl > line 43. This error means that "$LoginName was declared without

RE: Use strict (beginner question)

2003-04-04 Thread wiggins
On Thu, 3 Apr 2003 14:05:19 -0500, [EMAIL PROTECTED] wrote: > > All, > > I added the "use strict;" statement to my script for the first time and > received the following compilation errors: > Global symbol "$LoginName" requires explicit package n

Re: Use strict (beginner question)

2003-04-04 Thread Morten Liebach
On 2003-04-03 14:05:19 -0500, [EMAIL PROTECTED] wrote: > > All, > > I added the "use strict;" statement to my script for the first time and > received the following compilation errors: > Global symbol "$LoginName" requires explicit package name at todaysFiles.pl > line 43. > Global symbol "$TMPNo

RE: use strict and lib vars

2003-02-18 Thread Paul
> So seems the concensus. I will be trying to adapt a module type > system for it. Feel free to post for assistance. We learn more that way, lol ;o] __ Do you Yahoo!? Yahoo! Shopping - Send Flowers for Valentine's Day http://shopping.yahoo.com

RE: use strict and lib vars

2003-02-18 Thread Dan Muey
Thanks! I 'll give her a go that route. I like the idea just need time to do it then polish it up. Thanks Dan > > > Well, any other ideas on how I can have a hundred scripts > all use the > > same settings and make it easy to change any of them at > will without > > having to go edit a hun

RE: use strict and lib vars

2003-02-18 Thread Dan Muey
So seems the concensus. I will be trying to adapt a module type system for it. Thanks Dan > Dan Muey wrote: > > > > > To share configuration variables in one place for lots and lots of > > scripts to use instead of having to put them in each script > and then > > on echanges and having to g

RE: use strict and lib vars

2003-02-17 Thread Paul
> Well, any other ideas on how I can have a hundred scripts all use the > same settings and make it easy to change any of them at will without > having to go edit a hundred files would be nice. > ... > To share configuration variables in one place for lots and lots of > scripts to use instead of h

Re: use strict and lib vars

2003-02-17 Thread R. Joseph Newton
Dan Muey wrote: > > To share configuration variables in one place for lots and lots of scripts to use >instead of having to put them in each script and then on echanges and having to go >through a hundred scripts all over the place to change them. > > Someone else already helped me get it nailed

RE: use strict and lib vars

2003-02-17 Thread Dan Muey
> > Dan Muey wrote: > > > I guess my main question would boil down to :: > > > > How can I use variables that get declared in a lib file in a script > > that uses -w and use strict; ? > > > > A more complex example of what I've tried and what I'm > trying to get > > is here :: > > > > On the

Re: use strict and lib vars

2003-02-17 Thread R. Joseph Newton
Dan Muey wrote: > I guess my main question would boil down to :: > > How can I use variables that get declared in a lib file in a script that uses -w and >use strict; ? > > A more complex example of what I've tried and what I'm trying to get is here :: > > On the script below, when use strict is

RE: use strict and lib vars

2003-02-17 Thread Paul
> > > > use vars '$dog'; > > > Personally, because I like typing 2 letters instead of 7. :) > > Ok then if your Perl (>5.6.0) allows it, change the above to: > > our $dog; > > perldoc vars > perldoc -f our > > Save 7 more characters... ;-) lol -- sweet. I'm still trying to get used to our().

RE: use strict and lib vars

2003-02-17 Thread wiggins
On Mon, 17 Feb 2003 11:45:15 -0800 (PST), Paul <[EMAIL PROTECTED]> wrote: > > > --- Dan Muey <[EMAIL PROTECTED]> wrote: > > > use vars '$dog'; > Personally, because I like typing 2 letters instead of 7. :) > Ok then if your Perl (>5.6.0) allows

RE: use strict and lib vars

2003-02-17 Thread Dan Muey
Right on thanks! > > > > --- Dan Muey <[EMAIL PROTECTED]> wrote: > > > > #!/usr/bin/perl -w > > > > use strict; > > > > #my $dog = 'bart'; > > > > eval { > > > > use lib '/home/dmuey'; > > > > require "lib.lib"; > > > > }; > > > > print "Content-type: text/html\n\n"; > > > > prin

RE: use strict and lib vars

2003-02-17 Thread Paul
> > --- Dan Muey <[EMAIL PROTECTED]> wrote: > > > #!/usr/bin/perl -w > > > use strict; > > > #my $dog = 'bart'; > > > eval { > > > use lib '/home/dmuey'; > > > require "lib.lib"; > > > }; > > > print "Content-type: text/html\n\n"; > > > print "Error: $@ :: $dog ::\n"; > > > > > > :

RE: use strict and lib vars

2003-02-17 Thread Dan Muey
> > --- Dan Muey <[EMAIL PROTECTED]> wrote: > > #!/usr/bin/perl -w > > use strict; > > #my $dog = 'bart'; > > eval { > > use lib '/home/dmuey'; > > require "lib.lib"; > > }; > > print "Content-type: text/html\n\n"; > > print "Error: $@ :: $dog ::\n"; > > > > :: lib.lib file is ::

Re: use strict and lib vars

2003-02-17 Thread Paul
--- Dan Muey <[EMAIL PROTECTED]> wrote: > #!/usr/bin/perl -w > use strict; > #my $dog = 'bart'; > eval { > use lib '/home/dmuey'; > require "lib.lib"; > }; > print "Content-type: text/html\n\n"; > print "Error: $@ :: $dog ::\n"; > > :: lib.lib file is :: > > my $dog = 'joe'; > 1;

Re: use strict - config file?

2002-07-11 Thread Peter Scott
At 03:02 PM 7/11/02 -0500, rory oconnor wrote: >Thanks so much for your help Peter. I'm getting a grasp of this. > >However, I have been using a separate file containing subroutines shared >by a few scripts. They have worked previously because I was just >requiring it, and all my variables were

Re: use strict - config file?

2002-07-11 Thread rory oconnor
Thanks so much for your help Peter. I'm getting a grasp of this. However, I have been using a separate file containing subroutines shared by a few scripts. They have worked previously because I was just requiring it, and all my variables were global. I set up my config file as a package (thank

Re: use strict - config file?

2002-07-11 Thread Peter Scott
At 01:19 PM 7/11/02 -0500, rory oconnor wrote: >Peter, > >Thanks so much for the help! Unfortunately I am not using 5.6. I'd >like to, but it's not up to me to do the upgrading! Which parts are >5.6-only, and how can I work around? Altered for 5.004... if your perl is older than that, it's tim

Re: use strict - config file?

2002-07-11 Thread rory oconnor
Peter, Thanks so much for the help! Unfortunately I am not using 5.6. I'd like to, but it's not up to me to do the upgrading! Which parts are 5.6-only, and how can I work around? Thanks, Rory On Thu, 2002-07-11 at 13:09, Peter Scott wrote: > At 12:27 PM 7/11/02 -0500, rory oconnor wrote: > >

Re: use strict - config file?

2002-07-11 Thread Peter Scott
At 12:27 PM 7/11/02 -0500, rory oconnor wrote: >I want to "use strict" in a script I'm writing. I have a separate >config file I am using (require "config.pl";) with a bunch of global >variables. But my script doesn't seem to want to recognize those >variables unless they are actually declared i

RE: use strict

2002-05-06 Thread Jason Frisvold
les the world." -- Albert Einstein [1879-1955] -Original Message- From: Bob Showalter [mailto:[EMAIL PROTECTED]] Sent: Monday, May 06, 2002 11:34 AM To: Jason Frisvold; [EMAIL PROTECTED] Subject: RE: use strict > -Original Message- > From: Jason Frisvold [mailto:[EMAIL PRO

RE: use strict

2002-05-06 Thread Bob Showalter
> -Original Message- > From: Jason Frisvold [mailto:[EMAIL PROTECTED]] > Sent: Monday, May 06, 2002 11:19 AM > To: [EMAIL PROTECTED] > Subject: use strict > > > I have a question about 'use strict' ... Yeah, I guess this > counts as > a "duh!" question... :-) > > I put 'use strict'

RE: use strict

2002-05-06 Thread Nikola Janceski
I am going to try to answer this one, (I think I understand it): use strict; package Foo; my $var1; our $var2; package Bar; $Foo::var1; # this how you call var1 from package Foo; $var2; # this how you call var2 (our makes it global across packages [and modules?]) [our == use vars qw()] __END_

Re: use strict

2002-05-06 Thread Jeff 'japhy' Pinyan
On May 6, Jason Frisvold said: >I put 'use strict' at the beginning of one of my scripts... It >basically "broke" the script... (or fixed it, if you want to look at it >that way) The problem is that it wanted explicit package names for >all of the globals... > >So, what is the proper way

RE: use strict and warnings...

2002-03-07 Thread Nikola Janceski
002 12:53 PM To: 'Tanton Gibbs'; Beginners (E-mail) Subject: RE: use strict and warnings... the our works... now I got a crap load of errors with: Can't use string ("main::a") as a SCALAR ref while "strict refs" in use at //TempSorter.pm line 114. I gotta rea

RE: use strict and warnings...

2002-03-07 Thread Nikola Janceski
ED]] Sent: Thursday, March 07, 2002 12:44 PM To: Tanton Gibbs; Nikola Janceski; Beginners (E-mail) Subject: Re: use strict and warnings... OOPS! don't put the comma in the qw! use vars qw(@ISA @EXPORT); - Original Message - From: "Tanton Gibbs" <[EMAIL PROTECTED]

Re: use strict and warnings...

2002-03-07 Thread Jenda Krynicky
From: Nikola Janceski <[EMAIL PROTECTED]> > I am going through my old code and adding: > use strict; > use warnings; > > And I am running into some problems. I created a module (that I know > works). > > [ snip FILE: TempSorter.pm ] > ## Packages used > package TempSorter; > u

Re: use strict and warnings...

2002-03-07 Thread Tanton Gibbs
OOPS! don't put the comma in the qw! use vars qw(@ISA @EXPORT); - Original Message - From: "Tanton Gibbs" <[EMAIL PROTECTED]> To: "Nikola Janceski" <[EMAIL PROTECTED]>; "Beginners (E-mail)" <[EMAIL PROTECTED]> Sent: Thursday, March 0

Re: use strict and warnings...

2002-03-07 Thread Tanton Gibbs
You can either declare them with our (for newer versions of perl) our @ISA = ... our @EXPORT = ... or you can say( for compatibility with older perls) use vars qw(@ISA, @EXPORT); at the top of your file. - Original Message - From: "Nikola Janceski" <[EMAIL PROTECTED]> To: "Beginners (E-

Re: use Strict/use strict (was Re: what have I...)

2002-02-06 Thread Jeff 'japhy' Pinyan
On Feb 6, Jenda Krynicky said: >From: Jeff 'japhy' Pinyan <[EMAIL PROTECTED]> >> On Feb 6, John said: >> >> >#!/usr/bin/perl -w >> > >> >use Strict; >> >> You are using Windows (sorry). Please change that line to >> >> use strict; >> >> Because Windows is case-INsensitive, 'use Strict' loa

Re: use Strict/use strict (was Re: what have I...)

2002-02-06 Thread Jenda Krynicky
From: Jeff 'japhy' Pinyan <[EMAIL PROTECTED]> > On Feb 6, John said: > > >#!/usr/bin/perl -w > > > >use Strict; > > You are using Windows (sorry). Please change that line to > > use strict; > > Because Windows is case-INsensitive, 'use Strict' loads strict.pm, but > because Perl is case-sen

Re: use strict

2002-02-05 Thread dhoubrechts
Octavian Rasnita a écrit : > > Hello all, > I am a new member. please tell me what is used for the following line in a > script: > > use strict; > > I saw that if I use it, this make sometimes my scripts to have errors and > without it, they works. > Thanks! > Teddy, > My dear email address is

Re: use strict

2002-02-05 Thread Dave Benware
Octavian Rasnita wrote: > > Hello all, > I am a new member. please tell me what is used for the following line in a > script: > > use strict; > > I saw that if I use it, this make sometimes my scripts to have errors and > without it, they works. > Thanks! > Teddy, > My dear email address is [EM

Re: use strict

2002-02-05 Thread Frank
On Tue, Feb 05, 2002 at 09:18:17AM -0800, Octavian wrote: > Hello all, > I am a new member. please tell me what is used for the following line in a > script: > > use strict; > > I saw that if I use it, this make sometimes my scripts to have errors and > without it, they works. ---end quoted text

Re: use strict

2002-02-05 Thread Jason Purdy
*chuckle* - this should open a can of worms... be sure to check out the technical explanation: perldoc strict I believe there's also a thread on Perlmonks if you search on 'use strict and warnings' (for some reason, Perlmonks times out on me, so I can't provide the exact link/search term). T

Re: use strict, How to 'globalised' variable within loops. (was => Re: Question!! number of line....)

2001-12-29 Thread Michael R. Wolf
"Leon" <[EMAIL PROTECTED]> writes: [...] > (1)how to make a variable within loops non-lexical as in this eg:- > while (){ > my $count++; # how to globalised this variable? $count++; # NO "my", therefore implicitly global. > }; > > (2)how to make a variable availab

Re: use strict and filehandles

2001-10-28 Thread Jan
Ah, ok, thats it, but by now I rewrote it with my $compu = new FileHandle, but I'm in rouble with getc or sysread operations on the handle. I'll put a commented working version on my hp: Jan-Kirchhoff.de asap. thanks for the help to everybody, Jan Am Sonntag, 28. Oktober 2001 04:12 schrieb [EMA

Re: use strict and filehandles

2001-10-27 Thread rich+ml
IIRC the warning is intentionally suppressed if the alleged 'reserved word' is uppercase, i.e. it will complain about "open f,$file" but not "open F, $file". On Sat, 27 Oct 2001, Jan wrote: > Date: Sat, 27 Oct 2001 20:39:48 +0200 > From: Jan <[EMAIL PROTECTED]> > To: [EMAIL PROTECTED] > Subject:

Re: use strict and filehandles

2001-10-27 Thread Brett W. McCoy
On Sat, 27 Oct 2001, Jan wrote: > sub open > { > open("compu","+<$port") || die "opening $port failed: $!"; > system("stty 19200 -echo cstopb cbreak -parenb cs8 parodd < $port"); > compu->autoflush(1); > print "\nopened interface on port --> $port\n"; > } Where I am getting confused is how you a

Re: use strict and filehandles

2001-10-27 Thread Jan
Uh, ok, wait, let me catch a working version one of the versions I coded... dunno if it works how I want it to work, but produces the error... -- #!/usr/bin/perl use strict; use warnings; use IO::Handle; ### my $port; my $loop; my $start; my $reset; my $setdi

Re: use strict and filehandles

2001-10-27 Thread Brett W. McCoy
On Sat, 27 Oct 2001, Jan wrote: > i just coded a little programm as an interface between a hardware interface > on the serial port and a database, but when i use strict, perl always makes > complaints like: > > Unquoted string "iface" may clash with future reserved word at > iface2dbgeneric.pl li

Re: use strict and foreach

2001-10-26 Thread Jeff 'japhy' Pinyan
On Oct 26, [EMAIL PROTECTED] said: >use strict; >use FileHandle; >use constant CONSOLE => 'STDOUT'; Instead of the string 'STDOUT', use *STDOUT or even \*STDOUT. -- Jeff "japhy" Pinyan [EMAIL PROTECTED] http://www.pobox.com/~japhy/ RPI Acacia brother #734 http://www.perlmonks.org/

Re: 'use strict' kills Oracle spooling...

2001-06-26 Thread Michael Fowler
On Tue, Jun 26, 2001 at 05:17:00PM -0400, [EMAIL PROTECTED] wrote: > Does anyone familiar with 'use strict' know what may be going on? (Please > don't make fun of the way I'm accessing the database. It works, and > besides, I've been too lazy to learn about the DBI package/module thing.) I can f

Re: use strict

2001-06-25 Thread Jeff 'japhy' Pinyan
On Jun 25, Silvio Luis Leite Santana said: >Ok, japhy, thanks. > >So you're telling me Perl wouldn't allow >any spaces "inside" keywords? > >What about when $_ be evaluated? The spaces >of the line > >$CAMEL--;if(d efined($_=shift(@dromedary1))&&/\S/){ > >will still be there, won't they? S

Re: use strict

2001-06-25 Thread Peter Scott
At 04:12 PM 6/25/01 -0300, Silvio Luis Leite Santana wrote: >So you're telling me Perl wouldn't allow >any spaces "inside" keywords? > >What about when $_ be evaluated? The spaces >of the line > > $CAMEL--;if(d efined($_=shift(@dromedary1))&&/\S/){ > >will still be there, won't they? You k

Re: use strict

2001-06-25 Thread Silvio Luis Leite Santana
Ok, japhy, thanks. So you're telling me Perl wouldn't allow any spaces "inside" keywords? What about when $_ be evaluated? The spaces of the line $CAMEL--;if(d efined($_=shift(@dromedary1))&&/\S/){ will still be there, won't they? Thanks Silvio Jeff 'japhy' Pinyan wrote: > > On Jun 2

Re: use strict

2001-06-25 Thread Jeff 'japhy' Pinyan
On Jun 25, Silvio Luis Leite Santana said: >I'd like to know how can a program like >the 'camel program' be compiled and run, >because there are spaces spliting keywords! The secret is on line 2. >0 use strict; >1 >2 $_='ev See, the main source of this

Re: use strict

2001-06-18 Thread David H. Adler
On Mon, Jun 18, 2001 at 01:46:34PM -0700, Peter Lemus wrote: > HI, > > My unix system keeps saying I have a problem when I > say > use strict; > can you not use strict on unix? Please advice. What is the problem that it's telling you about? With no further information, I would *guess* that yo

Re: use strict

2001-06-18 Thread Brett W. McCoy
On Mon, 18 Jun 2001, Peter Lemus wrote: > My unix system keeps saying I have a problem when I > say > use strict; > can you not use strict on unix? Please advice. Yes, you can use strict on Unix (which Unix flavour?). What is the exact error message you are getting? Are you sure the porblem i

  1   2   >