[19428] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 1623 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Aug 27 03:05:35 2001

Date: Mon, 27 Aug 2001 00:05:07 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <998895907-v10-i1623@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Mon, 27 Aug 2001     Volume: 10 Number: 1623

Today's topics:
    Re: $1 as subroutine parameter - problems <samneric@tigerriverOMIT-THIS.com>
    Re: CGI redirect <guymal@__NOSPAM__hotmail.com>
    Re: CGI redirect <samneric@tigerriverOMIT-THIS.com>
    Re: CODE reference to member function of package Confus <iltzu@sci.invalid>
    Re: Comma's at end of list can break program?? (David Combs)
    Re: Counters <iltzu@sci.invalid>
    Re: form post to https server, best method <mbudash@sonic.net>
    Re: fwd: Sex or perl? <britne_yspears@hotmail.com>
    Re: Perl 101 Question -- Simple text formatting <ibroemer@home.com>
    Re: Perl 101 Question <goldbb2@earthlink.net>
    Re: Perl rookie question!  Setting up perl to work with <iltzu@sci.invalid>
    Re: Read/write specific line of file (Ian Boreham)
    Re: simple <iltzu@sci.invalid>
    Re: SQL (MySQL) Windows <goldbb2@earthlink.net>
    Re: warnings with cgi will crash Win32 perl core <godzilla@stomp.stomp.tokyo>
    Re: warnings with cgi will crash Win32 perl core <godzilla@stomp.stomp.tokyo>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Mon, 27 Aug 2001 02:31:48 -0400
From: Samneric <samneric@tigerriverOMIT-THIS.com>
Subject: Re: $1 as subroutine parameter - problems
Message-Id: <MPG.15f3b35ff07af45298969b@news.onemain.com>

Markus Laire wrote:
> Samneric <samneric@tigerriverOMIT-THIS.com> wrote in
> news:MPG.15f22a059cb3a5c998969a@news.onemain.com: 
> 
> > And you're doing all this just to extract/print the first 3 characters
> > of a string...
> 
> As I said, that example was only to illustrate the problem. Actual code is 
> too large to post so I made small example which shows main points of the 
> problem.

Sorry. I'm moving a website to a new server and was reading during long 
uploads. I was also hassled by a missing telnet access which complicated some 
installs.

It hit me later that you weren't demonstrating your "optimised" coding 
standards, but were instead using the match to pre-initialise $1 before 
passing it to test(). The comment above the sub also had led me to believe that 
was your actual base intention in your real code. Guess you caught my 
frustration :)

Bart Lateur had written:
> test("$1")
> will make a temporary copy of it.

You seem to like that solution. With respect to preserving the variable being 
passed, it's effectively the same as using "test($1)" with "my ($copy) = @_;" 
except that the latter will allow you to remember what you're doing when you 
come back to it in 6 months when "tightness" has less value than clarity.


------------------------------

Date: Sun, 26 Aug 2001 09:50:53 +0200
From: "Guy" <guymal@__NOSPAM__hotmail.com>
Subject: Re: CGI redirect
Message-Id: <3b889cc3@news.barak.net.il>


"Michael Budash" <mbudash@sonic.net> wrote in message
news:mbudash-D8C354.00423925082001@news.sonic.net...
> In article <9m6oo5$alt$1@news.netvision.net.il>, "Guy"
> <guymal@__NOSPAM_hotmail.com> wrote:
>
> > "Michael Budash" <mbudash@sonic.net> wrote in message
> > news:mbudash-C673C4.23485221082001@news.sonic.net...
> > > In article <3b832ff4@news.barak.net.il>, "Guy"
> > > <guymal@__NOSPAM__hotmail.com> wrote:
> > >
> > > > How can I redirect to a url, using POST, and pass it some
parameters?
> > > >
> > > > I'm using CGI.pm to open a saved query:
> > > > open(OLD_Q,"$saved_query_path")|| die "Error: $! in file:
> > > > ".__FILE__."
> > > > line:
> > > > ".__LINE__."Cannot open saved query $saved_query_path \n";
> > > >   my $old_query=new CGI(OLD_Q);
> > > > close(OLD_Q);
> > > >
> > > > and I would like to redirect to a url as if the user submitted a
form
> > > > (the
> > > > parameters from the saved query) to the new url:
> > > >
> > > > print
> > > > $old_query->redirect("http://my-server.com/cgi-bin/a-script.pl");
> > > > #but
> > > > I need to pass all saved parameters using POST
> > > >
> > > > What I basically need is how to do something like this:
> > > > my $one=$old_query->param('param_1');
> > > > my $two=$old_query->param('param_2');
> > > > print
> > > >
> >
$old_query->redirect("http://my-server.com/cgi-bin/a-script.pl?param_1=$on
> > > > e&
> > > > param_2=$two....");
> > > >
> > > > but using POST.
> > >
> > > use the LWP perl module (which can be found at
> > > http://www.perl.com/CPAN-local/modules/by-module/LWP/ as libwww-perl)
> > >
> >
> > LWP would be used to open a connection from the web server to another
> > url.
> > What I need is to redirect the USER to another url (just like the CGI.pm
> > redirect function).
>
> trust me, you want LWP in a POST scenario. i do it all the time... read
> the LWP docs (type: perldoc lwpcook)... or not, it's your choice...
>

I've read the LWP documentation several times and used the module many
times.
Let me explain what I'm trying to achieve:
The user goes to a script at a certain url (doesn't matter if the user's
request is post or get).
The script on the server opens a saved query, sends the contents of the
saved query back to the client, and "tells" the client to open a connection
to a different url/script and post the saved query it received there.

Is this even possible?
I read the excellent article that Alan wrote
(http://ppewww.ph.gla.ac.uk/~flavell/www/post-redirect.html) but it didn't
address anything similar to what I need (where the client gets the query
from the server and then posts it somewhere else).

Thanks again,
Guy




------------------------------

Date: Mon, 27 Aug 2001 03:03:04 -0400
From: Samneric <samneric@tigerriverOMIT-THIS.com>
Subject: Re: CGI redirect
Message-Id: <MPG.15f3ba9ef3194cfc98969d@news.onemain.com>

Guy wrote:
> Let me explain what I'm trying to achieve:
> The user goes to a script at a certain url (doesn't matter if the user's
> request is post or get).
> The script on the server opens a saved query, sends the contents of the
> saved query back to the client, and "tells" the client to open a connection
> to a different url/script and post the saved query it received there.
> Is this even possible?

The client in this case is a browser, right? That's a cgi-specific question. 
Whether you choose to impliment your cgi in perl or in compiled C, your 
question still involves POSTing forms via http to webservers running scripts 
that process those forms.

You'll get fuller answers in comp.infosystems.www.authoring.cgi where your 
question is on-topic, but I'll start you off if you promise to finally take it 
there.

Okay? Fine...

Ask in CIWAC how you can use the DOM "onLoad()" method in a <BODY> tag to cause 
a browser to automatically POST a form containing hidden fields.

Include your quoted post above.


------------------------------

Date: 27 Aug 2001 04:24:18 GMT
From: Ilmari Karonen <iltzu@sci.invalid>
Subject: Re: CODE reference to member function of package Confusing..
Message-Id: <998885871.15413@itz.pp.sci.fi>

In article <87elq8e3vn.fsf@abra.ru>, Ilya Martynov wrote:
>
>KP> $obj->set_handler('on_clicked',\&clicked);
>
>KP> this work with most programs. Users can set callback handlers to their 
>KP> functions. But when I try to bind the callback to my method in a package
>KP> I can't do something like this:
>
>KP> $obj->set_handler('on_clicked', \&{$self->clicked} );
>
>$obj->set_handler('on_clicked', sub {$self->clicked} );

If the callback can accept parameters, the correct code is

  $obj->set_handler('on_clicked', sub { $self->clicked(@_) } );

$self should also be a lexical variable, i.e. declared using "my".
Otherwise unexpected things may happen.  What's actually going on is
that we're creating a new, anonymous subroutine that does the method
call.  Such subroutines act as closures, which means they remember the
lexical variables that were in scope when they were created.

-- 
Ilmari Karonen -- http://www.sci.fi/~iltzu/
"Get real!  This is a discussion group, not a helpdesk.  You post something,
we discuss its implications.  If the discussion happens to answer a question
you've asked, that's incidental."           -- nobull in comp.lang.perl.misc





------------------------------

Date: 27 Aug 2001 06:39:08 GMT
From: dkcombs@panix.com (David Combs)
Subject: Re: Comma's at end of list can break program??
Message-Id: <9mcpuc$qlh$1@news.panix.com>

In article <9la4tu$pg5$1@charity.cs.utexas.edu>,
Logan Shaw <logan@cs.utexas.edu> wrote:
>
>That's the best reason I've seen so far.  The increased beauty and
>utility of that may even offset the increased ugliness (IMHO) of the
>syntactically superfluous comma.

You ever try putting the commas on the LEFT.

To me, it's kinda neat; give a try and see
how you like it.

David



------------------------------

Date: 27 Aug 2001 05:10:32 GMT
From: Ilmari Karonen <iltzu@sci.invalid>
Subject: Re: Counters
Message-Id: <998888369.16364@itz.pp.sci.fi>

In article <6O8g7.11559$in6.1700104@news6-win.server.ntlworld.com>, GBs wrote:
>This may confuse you, but do you know of a graphical access counter script
>that can display a different digit image depending on where that digit is in
>the final count number.  For example...

No, I don't.  Sorry.  In fact, I don't know any access counter scripts
at all.  Well, I know they exists, I even know there's one at a site I
maintain, and presumably it even works.  I think I looked at it once to
see if there were any security issues, which there weren't.


>The 0 would be tenthousands0.jpg, the 2 would be thousands2.jpg, the 5 would
>be hundreds5.jpg, the 8 would be tens8.jpg and the nine would be units9.jpg
>so that I could make each number a different colours.

Sounds reasonable.  Me, I'd go for "0e4.jpg", "2e3.jpg", "5e2.jpg",
"8e1.jpg" and "9e0.jpg", but not everyone likes exponential notation.


>If you don't know of any exact script that can do this, does anyone know how
>I could modify an existing script from somewhere like cgiresources.com so
>that I could do this?

Probably quite easily, if you know enough Perl and the script is cleanly
written.  I wouldn't count on that.  It might be faster to write one
from scratch.  The Perl FAQ contains code to handle the file locking
issues, and I believe someone else in this thread showed how to turn a
number into a list of filenames.  HTMLifying it is left as an exercise.

-- 
Ilmari Karonen -- http://www.sci.fi/~iltzu/
"Get real!  This is a discussion group, not a helpdesk.  You post something,
we discuss its implications.  If the discussion happens to answer a question
you've asked, that's incidental."           -- nobull in comp.lang.perl.misc



------------------------------

Date: Mon, 27 Aug 2001 04:41:36 GMT
From: Michael Budash <mbudash@sonic.net>
Subject: Re: form post to https server, best method
Message-Id: <mbudash-6EBD86.21413726082001@news.sonic.net>

In article <3B89899A.CF8C41A0@rochester.rr.com>, Bob Walton 
<bwalton@rochester.rr.com> wrote:

> Nitin G wrote:
> > 
> > am looking at implementing a solution where I need to post some data to 
> > a
> > https server. Before I went down a path that led to nowhere, I wanted 
> > to get
> > input from people who might have implemented a similar solution. What's 
> > the
> > best recommended module to use for handling such a situation?
> ...
> > -Nitin
> 
> I would start with the LWP module.  The following should be very
> helpful:
> 
>    perldoc lwpcook
> 
> You might have to get the Crypt::SSLeay module.

which itself requires openssl... the whole system is easy to install and 
works great...
 
hth-
-- 
Michael Budash ~~~~~~~~~~ mbudash@sonic.net


------------------------------

Date: Mon, 27 Aug 2001 06:02:33 +0100
From: "Listy" <britne_yspears@hotmail.com>
Subject: Re: fwd: Sex or perl?
Message-Id: <998888498.227652@eos.uk.clara.net>


"Brian A. Stumm" <bs@bs-linux.com> wrote in message
news:Pine.LNX.4.21.0108262009150.3683-100000@bdslppp62.spkn.uswest.net...
> > > Which comes to the last question... what does this whole post have to
> > > do
> > > with sex?  Well, which is better?  Sex or Perl?
> >
> >
> >
> I found this to be a very interesting read, however the author has one
> major flaw in this essay. The author mistakenly associated "free
> software" with "no charge" software. The ideals of the Free Software
> Foundation, Open Source and the GPL do not dictate providing software at
> no charge. Rather it pertains to the free exchange of source code.
>
> Linus Torvalds *did* profit from the operating system he created.
>
> The Open Source Software movement provides a venue for little known
> programmers (newcomers) to make a name for themselves in the
> industry. Thus many of these newcomers release their code for "No
> Charge". Even though they do not profit directly it may lead to a good
> job, or investors/backers who want to form a company based on the talents
> or ideas of the programmer.
>
> But to answer the question, Sex is better. Eventually Perl will be
> outdated and obsolete. Sex ensures that their will be future programmers
> creating newer, better software...
>

Is there any topic you cannot twist to fit your Linux insanity?

--


Listener[AsS]

I fear going anywhere near the one called "Listy"  -  Bemsha of AGHLTFC





------------------------------

Date: Mon, 27 Aug 2001 05:01:24 GMT
From: Jimmy <ibroemer@home.com>
Subject: Re: Perl 101 Question -- Simple text formatting
Message-Id: <3B89D465.1778BC13@home.com>

My apologies for not choosing a better subject line.

Jimmy wrote:

> Hi all... It's been a few years since I've written, Perl.  And if ever
> the expression "Use it or loose it" applies, it's in programming!
>
> I'm trying to solve what should be a pretty simple problem.  If you can
> help, please read on.
>
> I have a couple of hundred text files that are not formatted very well.
> Here's an example:
>
> ~~~ Begin file
>
>                                  MARY HAD A LITTLE LAMB
>
>                                  Mary had a little lamb,
>                                  her fleece was white as snow.
>                                  And everywhere that Mary went,
>                                  The Lamb was sure to go.
>
>                                  The End.
>
> ~~~End file
>
> I would like to run a script that will parse these files, and create the
> following type of format in a new directory:
>
> ~~~ Begin file
>  MARY HAD A LITTLE LAMB
>
> Mary had a little lamb,
> her fleece was white as snow.
> And everywhere that Mary went,
> The Lamb was sure to go.
>
> The End.
> ~~~End file
>
> So basically, removing unnessecary white spaces and blank lines that
> precede and follow the text.  One more thing, the blank lines could very
> well have spaces in them, too.
>
> If anybody could show me a simple, easy script that I could run to
> produce this desired output, I would be most greatful.
>
> Thanks very much.
>
> Jimmy



------------------------------

Date: Mon, 27 Aug 2001 03:04:20 -0400
From: Benjamin Goldberg <goldbb2@earthlink.net>
Subject: Re: Perl 101 Question
Message-Id: <3B89F0F4.F3458A6D@earthlink.net>

Jimmy wrote:
> 
> Hi all... It's been a few years since I've written, Perl.  And if ever
> the expression "Use it or loose it" applies, it's in programming!
> 
> I'm trying to solve what should be a pretty simple problem.  If you
> can help, please read on.
> 
> I have a couple of hundred text files that are not formatted very
> well.
> Here's an example:
[snip]

Sure.

#!/usr/bin/perl -wp
use strict;
# slurp it all in.  We already have the first line, due to -p
$_. = do { local $/; <DATA> };
# remove leading blank lines,
# Replace whitespace-only lines with empty lines.
s/^\s+\n//; s/^[ \t]+$//mg;
# Remove trailing whitespace.  Remove trailing empty lines.
$_ = reverse $_; s/^[ \t]+//mg; s/^\n\n+/\n/; $_ = reverse $_;
# Expand tabs
1 while( s[(?<=^([^\t\n]*))(\t+)][' 'x(length($2)*8-length($1)%8)]me );
# Match and remove common whitespace prefix.
m/\A( +).*\n(?:\1(?>.*)\n|\n)*\z/ && s/^$1//mg;
# put tabs back in.
s/^((?: {8})+)/"\t" x (length($1)>>3)/gme;
__DATA__



                                 MARY HAD A LITTLE LAMB

                                 Mary had a little lamb,
                                 her fleece was white as snow.
                                 And everywhere that Mary went,
                                 The Lamb was sure to go.

                                 The End.


The code removes leading blank lines, trailing blank lines, trailing
whitespace and blocks of leading whitespace which are common to all
non-empty lines.  If not all the lines in the file are indented the
same, then the ones which are further in than the rest will remain
further in than the rest... eg:

input:
        This is indented by 8 spaces
                This is in by 16 spaces.
        This is by 8.
        So's this.
        etc.

output:

This is indented by 8 spaces
        This is in by 16 spaces.
This is by 8.
So's this.
etc.

So it has the same format as it originally had, just better aligned.

-- 
I'm not a programmer but I play one on TV...


------------------------------

Date: 27 Aug 2001 05:26:30 GMT
From: Ilmari Karonen <iltzu@sci.invalid>
Subject: Re: Perl rookie question!  Setting up perl to work with IIS or Personal Web Server
Message-Id: <998889645.17231@itz.pp.sci.fi>

In article <9m2hgs$14cg@newton.cc.rl.ac.uk>, S Warhurst wrote:
>
>4) Don't tell me what to do.. you are nobody to me, so fuck you.

And I'd expect _you_ are now a nobody -- an invisible nobody -- to quite
a few of this newsgroup's -- and the world's -- leading Perl experts.

All those with an itchy plonk finger, that is.

-- 
Ilmari Karonen -- http://www.sci.fi/~iltzu/
"Get real!  This is a discussion group, not a helpdesk.  You post something,
we discuss its implications.  If the discussion happens to answer a question
you've asked, that's incidental."           -- nobull in comp.lang.perl.misc



------------------------------

Date: 26 Aug 2001 21:36:54 -0700
From: ianb@ot.com.au (Ian Boreham)
Subject: Re: Read/write specific line of file
Message-Id: <f02c4576.0108262036.15d54071@posting.google.com>

mariorizzuti@yahoo.com (Mario Rizzuti) wrote in message news:<42f3ee2.0108250937.7540ed5a@posting.google.com>...

> > If you can make extra files, you could create an index file which maps
> > line numbers to file offsets; then you could seek() to the desired place
> > in your file quickly (and since the index file entries would have
> > constant length, finding the right one also only requires a seek() and a
> > read()).
> 
> Mantaining an index file has just a problem: when the length of a
> record changes, all the offsets of the records following need to be
> updated. This can be an huge task if the records are a lot.

You could use a hierarchical index, in which offsets are maintained as
relative offsets from  a parent index (whose offset itself may be
relative to its parent etc). That way, you would only need to adjust
(by the same amount - the delta in the record length) the later
siblings of the record itself and the later siblings of its parent
(and its parent's parent etc). This should dramatically reduce the
number of values to change, although lookup would involve summing a
series of offsets.

But as another poster has already mentioned, if your files are large
and changed frequently, variable-length records are going to be
painful.

Regards,


Ian


------------------------------

Date: 27 Aug 2001 04:52:49 GMT
From: Ilmari Karonen <iltzu@sci.invalid>
Subject: Re: simple
Message-Id: <998887153.15788@itz.pp.sci.fi>

In article <3B814165.772AE294@yahoo.com>, John Porter wrote:
>
>Now, here's OWTDI in perl:
>
>sub sep::TIESCALAR { bless [ ' ', "\t", '-' ], $_[0] }
>sub sep::FETCH { shift @{$_[0]} || ' ' }
>
>while (<>) {
>  tie $", 'sep';
>  split;
>  print "@_[3,0,1,2,4,8..$#_]\n";
>}

That's.. I don't know.  Either awesome or utterly revolting.  Or both.

Let me try to beat that..

  {
      package sep;
      use overload '""' => sub { chop ${+shift} or ' ' };
  }
  while (<>) {
      local $" = bless \(my $sep = "-\t "), 'sep';
      split;
      print "@_[3,0,1,2,4,8..$#_]\n";
  }

Neither of these work on perl 5.005, by the way.

-- 
Ilmari Karonen -- http://www.sci.fi/~iltzu/
"Get real!  This is a discussion group, not a helpdesk.  You post something,
we discuss its implications.  If the discussion happens to answer a question
you've asked, that's incidental."           -- nobull in comp.lang.perl.misc



------------------------------

Date: Mon, 27 Aug 2001 00:18:01 -0400
From: Benjamin Goldberg <goldbb2@earthlink.net>
Subject: Re: SQL (MySQL) Windows
Message-Id: <3B89C9F9.4E249934@earthlink.net>

Paul Fortescue wrote:
[snip]
> I have installed DBI.pm in the /lib, and have used "use DBI::mysql" as
> you suggest. Therefore I have installed mysql.pm in /lib/DBI.
> 
> It contains # -*- perl -*-
> 

Begin your program with
#! perl -w

To enable warnings.

> package Mysql;

Is the script a program which is being run, or a module which something
else is going to use or require?

If it's not intended to be a module, then you don't want a package
statement.  The default package, "main" is fine.

> 
> use 5.004;
> use strict;
> 
> require Carp;

Do you ever use the functions "carp" or "croak" ?
If not, then don't "require" or "use" Carp

> require DynaLoader;

I seriously doubt that you're using DynaLoader.  Get rid of this line.

> require Exporter;

Is the script a program which is being run, or a module which something
else is going to use or require?

> require DBI;

This you need [sorta], since you're using DBI.
Actually, what you need is "use DBI;" not "require DBI;"

> require Mysql::Statement;

What do you use this for?

> require DBD::mysql;

The DBI package will automatically require the appropriate DBD::whatever
modules when you call connect.  Get rid of this line.

> 
> and now I get Compilation failed in require at
> C:/Perl/lib/DBI/mySQL.pm line 11.
> whgich appears to be the line "require DBI".

Why is this program which you are writing inside of the DBI heirarchy?

Also, you do realize that perl is case-sensitive even if winblows isn't?
If you name your module Mysql, then the filename should be Mysql.pm
If you name your module mySQL, then the filename should be mySQL.pm

Also, if "C:/Perl/lib/" is in @INC, and if you plan on being able to
load this module into a script with "use Mysql;" then the file should be
named "C:/Perl/lib/Mysql.pm", and if you want it to be findable when
it's in that DBI directory, you need to have the package statement as
"package DBI::Mysql", and load it with "use DBI::Mysql" ...

Personally, though, I would suggest NOT writing it as a module unless
you absolutely need to... and as early as you are in learning perl, I'm
quite certain that you don't need to.

> I have DBI.pm in the /lib and also in /lib/DBI just in case I really
> don't understand!

DBI.pm needs to be in one place -- one occurance in any of the
directories mentioned in the @INC at the time of the require.

To find out what the @INC is by default, type "perl -Mfoobar" and look
at the error message.  All the places it tried to find it will be shown.

If you have "/lib" in @INC, then "use DBI" will find the file
"/lib/DBI.pm", and "use DBI::DBI" will find the file "/lib/DBI/DBI.pm"

> So I am still stuck, but appreciate your comments! I think I have
> everything I need except some experience of how Perl looks for modules
> :)

I would suggest you read the documentation.  Then reread it.  Keep doing
so until you completely understand it.

-- 
I'm not a programmer but I play one on TV...


------------------------------

Date: Sun, 26 Aug 2001 22:42:13 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: warnings with cgi will crash Win32 perl core
Message-Id: <3B89DDB5.88B342C6@stomp.stomp.tokyo>

Godzilla! wrote:
 
> I have been playing around with warnings in the format
> of -w to discover how many other ways use of warnings
> screws up a Perl script. They are numerous.
 
(snipped)

I have attached a simple script which well displays
how erratic is the behavior of warnings. A quick
glance at this structure of my test script and, an
equally quick glance at this warnings generated
message, discloses significantly erratic behavior
of perl core warnings.

On warnings crashing Apache and Windows9.x systems,
this one is hard to analyze and, for my purposes,
isn't worth a lot of effort; I already know perl
core warnings are messed up.

My best presumption, based on observed behavior,
is perl core warnings cannot deal with large and
complex scripts such as I write.

My script under test is a four-thousand line script
at one-hundred-twenty kilobytes. Only warnings
messages generated pertain to unitialized values
of environmental variables and this screwy message
about "...not stayed shared...." for the first
nested variable within a sub-routine, within a
nested loop mechanism and similar devices.

These messages about unitialized environmental
variables should only show up when working from
a command line. Nonetheless, in this complex script,
those warnings are hooked in. How, I don't know.

Clearly warnings are FUBAR when it comes to nesting
my scoped variables; totally FUBAR.

For large complex cgi scripts, warnings do in fact
unlink an Apache web server, become an infinitely
running process unlinked from the command process
as a rogue child and, slowly consume RAM memory.

I never use strict nor use warnings, for any reason.
These problems discovered via testing motivated by
idle curiosity, well support my notion both strict
and warnings are not worth a flying hoot's ass.

Ironically, so many Perl 5 Cargo Cultists claim you
cannot develop scripts over twenty or so lines without
use of strict and warnings. Nonetheless, I have written
a four-thousand line script which works perfect, without
ever using strict nor warnings during development.

Then again, there are those here who claim nobody can
write more than ten lines of Perl code per day.

There is ironic humor. Running my script with warnings
only generated false and erratic warning messages; no
errors were found.

As to strict, I am certain if I run one of my scripts
using strict, perl core will suffer critical mass
attainment, begin melt down and eventually lead to
events which will devastate half of our known universe.


There is a warning about warnings; use warnings at your own risk.


Godzilla!
--

#!perl -w

&Nest_1;

sub Nest_1
 {
  my ($nest_1) = "nest one";
  print "Nest 1: $nest_1\n";
  my (@Array_1) = qw (nest_one);
  print "@Array_1\n";

  &Nest_2;

  sub Nest_2
   {
    my ($nest_2) = "nest two";
    print "Nest 2: $nest_1\n";
    my (@Array_2) = qw (nest_two);
    print "@Array_2\n";

    &Nest_3;

    sub Nest_3
     {
      my ($nest_3) = "nest three";
      print "Nest 3: $nest_3\n";
      my (@Array_3) = qw (nest_three);
      print "@Array_3\n";
     }
   }
 }

exit;


Variable "$nest_1" will not stay shared at test1.pl line 18.

Nest 1: nest one
nest_one
Nest 2: nest one
nest_two
Nest 3: nest three
nest_three


------------------------------

Date: Sun, 26 Aug 2001 23:00:22 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: warnings with cgi will crash Win32 perl core
Message-Id: <3B89E1F6.B297711@stomp.stomp.tokyo>

Godzilla! wrote:
 
> Godzilla! wrote:
 

>  unitialized

>  unitialized

uninitialized

uninitialized

uninitiated

uninitiated


* likes slipping past nonexistent words *


Godzilla!  Queen Of Consistent Erronia.


------------------------------

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>


Administrivia:

The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc.  For subscription or unsubscription requests, send
the single line:

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.

For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V10 Issue 1623
***************************************


home help back first fref pref prev next nref lref last post