[29145] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 389 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Apr 28 03:10:22 2007

Date: Sat, 28 Apr 2007 00:09:07 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Sat, 28 Apr 2007     Volume: 11 Number: 389

Today's topics:
    Re: Cat file a to *.xls files <tadmc@augustmail.com>
    Re: Cat file a to *.xls files <mjcarman@mchsi.com>
    Re: Cat file a to *.xls files <tadmc@augustmail.com>
        finding invalid method names ivan@0x4849.net
    Re: finding invalid method names <tadmc@augustmail.com>
    Re: finding invalid method names <attn.steven.kuo@gmail.com>
    Re: finding invalid method names <mjcarman@mchsi.com>
    Re: Font question <"v.niekerk at hccnet.nl">
    Re: Font question (Alan Curry)
    Re: Memory Management <mjcarman@mchsi.com>
    Re: Memory Management <shirazk@gmail.com>
    Re: Memory Management <noreply@invalid.net>
    Re: Memory Management <mjcarman@mchsi.com>
    Re: Memory Management <shirazk@gmail.com>
        new CPAN modules on Sat Apr 28 2007 (Randal Schwartz)
        Perl routine for cluster detection <datashaping@gmail.com>
    Re: SQL statement in Perl doesn't work <bart.lateur@pandora.be>
    Re: Weird error after a configuration change <nikos1337@gmail.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Fri, 27 Apr 2007 19:52:23 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Cat file a to *.xls files
Message-Id: <slrnf356m7.h69.tadmc@tadmc30.august.net>

Jim <grace.jim@gmail.com> wrote:
> On Apr 26, 6:54 pm, Tad McClellan <t...@augustmail.com> wrote:
>> Jim <grace....@gmail.com> wrote:
>> > Hi I'm trying to get a perl script to work without much luck.
>>
>> > What I'm trying to do is to:
>>
>> > cat filea.txt to all .xls files in a directory
>>
>> > your help would be appreciated
>>
>> No Perl needed, just use the shell!
>>
>> # untested
>> for file in *.xls; do
>> cat filea.txt >>$file
>> done
>>
>> --
>>     Tad McClellan                          SGML consulting
>>     t...@augustmail.com                   Perl programming
>>     Fort Worth, Texas


It is bad netiquette to quote signatures.


> Thanks Tad, it worked nicely but, what I need is to have the contents
> of filea.txt at the start of the .xls files. Is this possible to do?


# untested
for file in *.xls; do
cat filea.txt $file >tmp
mv tmp $file
done


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: Sat, 28 Apr 2007 02:56:29 GMT
From: Michael Carman <mjcarman@mchsi.com>
Subject: Re: Cat file a to *.xls files
Message-Id: <xJyYh.20726$n_.15410@attbi_s21>

On 4/26/2007 5:54 PM, Tad McClellan wrote:
> Jim <grace.jim@gmail.com> wrote:
>>
>> What I'm trying to do is to:
>>
>> cat filea.txt to all .xls files in a directory
> 
> No Perl needed, just use the shell!
> 
> # untested
> for file in *.xls; do
> cat filea.txt >>$file

I think Tad has been hanging around Abigail too much lately.

-mjc


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

Date: Fri, 27 Apr 2007 23:57:59 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Cat file a to *.xls files
Message-Id: <slrnf35l2n.k58.tadmc@tadmc30.august.net>

Michael Carman <mjcarman@mchsi.com> wrote:
> On 4/26/2007 5:54 PM, Tad McClellan wrote:
>> Jim <grace.jim@gmail.com> wrote:
>>>
>>> What I'm trying to do is to:
>>>
>>> cat filea.txt to all .xls files in a directory
>> 
>> No Perl needed, just use the shell!
>> 
>> # untested
>> for file in *.xls; do
>> cat filea.txt >>$file
>
> I think Tad has been hanging around Abigail too much lately.


But when _I_ type of bunch of line noise, it never ends up
being a Perl program.  :-(


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: 27 Apr 2007 22:41:03 GMT
From: ivan@0x4849.net
Subject: finding invalid method names
Message-Id: <20070427184105.839$xr@newsreader.com>

Hi,

I would like to run a command on my perl scripts / modules to find out if
there are any method names that are being called which are not defined.

So for example where I run:

perl -c test.pl

on this script:
1 #!/usr/bin/perl
2 use strict;
3
4 blah_blah_foo();

The result is test.pl syntax OK.

Is there any other program i can run to do a static analysis of perl code
and find these errors?

Thanks,

-- 
Ivan Novick
http://www.0x4849.net


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

Date: Fri, 27 Apr 2007 20:04:22 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: finding invalid method names
Message-Id: <slrnf357cm.h69.tadmc@tadmc30.august.net>

ivan@0x4849.net <ivan@0x4849.net> wrote:
> Hi,
>
> I would like to run a command on my perl scripts / modules to find out if
> there are any method names that are being called which are not defined.
>
> So for example where I run:
>
> perl -c test.pl
>
> on this script:
> 1 #!/usr/bin/perl
> 2 use strict;
> 3
> 4 blah_blah_foo();


There are no method calls anywhere in that code.


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: 27 Apr 2007 17:39:32 -0700
From: "attn.steven.kuo@gmail.com" <attn.steven.kuo@gmail.com>
Subject: Re: finding invalid method names
Message-Id: <1177720772.129746.210260@p77g2000hsh.googlegroups.com>

On Apr 27, 3:41 pm, i...@0x4849.net wrote:
> Hi,
>
> I would like to run a command on my perl scripts / modules to find out if
> there are any method names that are being called which are not defined.
>
> So for example where I run:
>
> perl -c test.pl
>
> on this script:
> 1 #!/usr/bin/perl
> 2 use strict;
> 3
> 4 blah_blah_foo();
>
> The result is test.pl syntax OK.
>
> Is there any other program i can run to do a static analysis of perl code
> and find these errors?


Function names?  I'd use Perl::Critic with
Perl::Critic::StricterSubs.  E.g.,

$  perlcritic -theme "strictersubs" demo.pl
Subroutine "blah_blah_foo" is neither declared nor explicitly imported
at line 4, column 1.  This might be a major bug.  (Severity: 4)

A caveat from the documentation mentions false violations.

In any case, if you use Perl::Critic (static checks) as well as
TAP-based tests (e.g., Devel::Cover, Test::More, Test::Pod::Coverage,
etc.), you (or your boss) should start to feel better about
code quality.

--
Hope this helps,
Steven






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

Date: Sat, 28 Apr 2007 02:51:49 GMT
From: Michael Carman <mjcarman@mchsi.com>
Subject: Re: finding invalid method names
Message-Id: <9FyYh.20720$n_.19482@attbi_s21>

On 4/27/2007 5:41 PM, ivan@0x4849.net wrote:
> 
> I would like to run a command on my perl scripts / modules to find out if
> there are any method names that are being called which are not defined.

Method dispatch happens at runtime. There's really no way for a static analysis
tool to determine whether or not a given method call is valid.

> perl -c test.pl
> 
> on this script:
> 1 #!/usr/bin/perl
> 2 use strict;
> 3
> 4 blah_blah_foo();
> 
> The result is test.pl syntax OK.

Umm, as Tad said, there are no method calls in that code. Did you want to ask
about detecting undefined *subroutines*?

-mjc


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

Date: Fri, 27 Apr 2007 22:20:20 +0200
From: Huub <"v.niekerk at hccnet.nl">
Subject: Re: Font question
Message-Id: <46325b04$0$8660$e4fe514c@dreader31.news.xs4all.nl>

> 
> Are you opening the printer directly as /dev/whatever or are you
> sending the output via lpr? If you are using lpr then there are
> probably switches you can use to specify the font to be used for pain
> text.
> 
> I don't know which of the many lpr implementations available on Linux
> Fedora will install by default.

I'm opening the printer by using lpr.

> 
> If you are talking direct to /dev/whatever (or using lpr in raw mode)
> I don't think there are any PCL modules as such in Perl but there's
> nothing stopping you looking up the escape sequence in a PCL manual
> and manually doing print("\e(s4099T") [1].

I found some escape-sequences in a PCL manual, but I found out that was 
the wrong PCL version so that didn't work.

> 
> [1] That's untested.  I just did a quick Google and glanced at the
> following HP manuals:
> 
> http://h20000.www2.hp.com/bc/docs/support/SupportManual/bpl13210/bpl13210.pdf
> http://lprng.sourceforge.net/DISTRIB/RESOURCES/DOCS/pcl5comp.pdf
> 
> 

Thanks for the links. I'll try the manual print....


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

Date: Fri, 27 Apr 2007 20:30:51 +0000 (UTC)
From: pacman@TheWorld.com (Alan Curry)
Subject: Re: Font question
Message-Id: <f0tmhr$2sj$1@pcls4.std.com>

In article <46325b04$0$8660$e4fe514c@dreader31.news.xs4all.nl>,
Huub  <"v.niekerk at hccnet.nl"> wrote:
>
>I'm opening the printer by using lpr.
>

If your lpr is set up to handle PostScript, you could use enscript[1] which
converts plain text for printing and has a font selection option -f

[1] http://www.iki.fi/mtr/genscript/

-- 
Alan Curry
pacman@world.std.com


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

Date: Fri, 27 Apr 2007 22:22:27 GMT
From: Michael Carman <mjcarman@mchsi.com>
Subject: Re: Memory Management
Message-Id: <CIuYh.81854$_c5.75505@attbi_s22>

On 4/27/2007 1:26 PM, Shiraz wrote:
> I am trying to set aside some memory for my cache (hash/array etc) in my
> script. I use the ulimit and then monitor used mem with Devel::Size and 
> destroy when i am close to my limit. Any ideas on how to do this better?

You don't really do memory management in Perl. Proper programming can reduce the
amount of memory that you use, though. Have you read "perldoc -q memory?"

-mjc


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

Date: 27 Apr 2007 15:36:42 -0700
From: Shiraz <shirazk@gmail.com>
Subject: Re: Memory Management
Message-Id: <1177713401.954024.157780@r3g2000prh.googlegroups.com>

On Apr 27, 5:22 pm, Michael Carman <mjcar...@mchsi.com> wrote:
> On 4/27/2007 1:26 PM, Shiraz wrote:
>
> > I am trying to set aside some memory for my cache (hash/array etc) in my
> > script. I use the ulimit and then monitor used mem with Devel::Size and
> > destroy when i am close to my limit. Any ideas on how to do this better?
>
> You don't really do memory management in Perl. Proper programming can reduce the
> amount of memory that you use, though. Have you read "perldoc -q memory?"
>
> -mjc

Maybe I worded my question wrong and it should be Memory Allocation
and monitor.

I know I can allocate memory space by using  ` $#arr = 999 ` but i am
not sure how much memory it consumes. Basically my goal is to figure
out how to set the max memory a variable can use and how to monitor
when the max has been reached.

I did read the perldoc but that didnt tell me anything about reserving
memory, just to be carefull with it.



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

Date: Fri, 27 Apr 2007 23:28:47 GMT
From: Ala Qumsieh <noreply@invalid.net>
Subject: Re: Memory Management
Message-Id: <PGvYh.19165$JZ3.1226@newssvr13.news.prodigy.net>

Shiraz wrote:

> I know I can allocate memory space by using  ` $#arr = 999 ` but i am
> not sure how much memory it consumes. Basically my goal is to figure
> out how to set the max memory a variable can use and how to monitor
> when the max has been reached.

If I may ask, why are you concerned about this?
If you are really worried about memory consumption that much, then Perl is
probably the wrong language to use.

Having said that, there is a CPAN module that might be of use:

http://search.cpan.org/~tels/Devel-Size-0.67/lib/Devel/Size.pm

I have never used it myself though.

--Ala



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

Date: Sat, 28 Apr 2007 02:41:01 GMT
From: Michael Carman <mjcarman@mchsi.com>
Subject: Re: Memory Management
Message-Id: <ZuyYh.20708$n_.1212@attbi_s21>

On 4/27/2007 5:36 PM, Shiraz wrote:
> 
> I know I can allocate memory space by using  ` $#arr = 999 ` but i am
> not sure how much memory it consumes. Basically my goal is to figure
> out how to set the max memory a variable can use and how to monitor
> when the max has been reached.

'$#arr = 999' will set the size of the array to 1000 elements. That could either
extend or truncate the @arr depending on what length it was beforehand. It
doesn't create a limit, though. Perl will extend the array if (e.g.) you were to
push() another item onto the end.

You can use Devel::Size to find out how much memory a variable is actually
using, but that's independent of the length. An array of 1000 integers would
take less space than an array of 1000 strings. Array elements can be any scalar
value which means you can create an array of hashes of hashes of arrays of...

If you *really* need to continuously monitor the size of an array you could
create a tie() class that used Devel::Size to check the memory consumption every
time you added or modified an element and warn() when it exceeds some threshold.
It would absolutely clobber your performance, though, and I doubt that you
really need to do that. We can probably provide better advice if you tell us
what your real task is.

-mjc


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

Date: 27 Apr 2007 20:18:57 -0700
From: Shiraz <shirazk@gmail.com>
Subject: Re: Memory Management
Message-Id: <1177730337.874961.190110@c35g2000hsg.googlegroups.com>

On Apr 27, 9:41 pm, Michael Carman <mjcar...@mchsi.com> wrote:
> On 4/27/2007 5:36 PM, Shiraz wrote:
>
>
>
> > I know I can allocate memory space by using  ` $#arr = 999 ` but i am
> > not sure how much memory it consumes. Basically my goal is to figure
> > out how to set the max memory a variable can use and how to monitor
> > when the max has been reached.
>
> '$#arr = 999' will set the size of the array to 1000 elements. That could either
> extend or truncate the @arr depending on what length it was beforehand. It
> doesn't create a limit, though. Perl will extend the array if (e.g.) you were to
> push() another item onto the end.
>
> You can use Devel::Size to find out how much memory a variable is actually
> using, but that's independent of the length. An array of 1000 integers would
> take less space than an array of 1000 strings. Array elements can be any scalar
> value which means you can create an array of hashes of hashes of arrays of...
>
> If you *really* need to continuously monitor the size of an array you could
> create a tie() class that used Devel::Size to check the memory consumption every
> time you added or modified an element and warn() when it exceeds some threshold.
> It would absolutely clobber your performance, though, and I doubt that you
> really need to do that. We can probably provide better advice if you tell us
> what your real task is.
>
> -mjc



I need to keep a hash of arrays in memory and keep adding things to it
and when the hash has so many things in it that it can cause a perl
out of memory error, i want to prune it. almost like a cache.



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

Date: Sat, 28 Apr 2007 04:42:09 GMT
From: merlyn@stonehenge.com (Randal Schwartz)
Subject: new CPAN modules on Sat Apr 28 2007
Message-Id: <JH6yE9.1wvG@zorch.sf-bay.org>

The following modules have recently been added to or updated in the
Comprehensive Perl Archive Network (CPAN).  You can install them using the
instructions in the 'perlmodinstall' page included with your Perl
distribution.

Apache-Session-1.82_04
http://search.cpan.org/~chorny/Apache-Session-1.82_04/
A persistence framework for session data
----
Apache2-Modwheel-0.2.1
http://search.cpan.org/~asksh/Apache2-Modwheel-0.2.1/
Use Modwheel with mod_perl2
----
Bot-BasicBot-Pluggable-Module-RT-0.03
http://search.cpan.org/~dams/Bot-BasicBot-Pluggable-Module-RT-0.03/
Retrieves information of RT tickets
----
Bundle-OpenXPKI-0.01
http://search.cpan.org/~alech/Bundle-OpenXPKI-0.01/
A bundle to install modules required for OpenXPKI
----
CGI-Ex-2.10
http://search.cpan.org/~rhandom/CGI-Ex-2.10/
CGI utility suite - makes powerful application writing fun and easy
----
CGI-Ex-Template-XS-0.01
http://search.cpan.org/~rhandom/CGI-Ex-Template-XS-0.01/
XS version of key parts of CGI::Ex::Template
----
Catalyst-Plugin-Authentication-Credential-AOL-0.02
http://search.cpan.org/~miyagawa/Catalyst-Plugin-Authentication-Credential-AOL-0.02/
AOL OpenAuth credential
----
Catalyst-View-TT-ForceUTF8-0.07
http://search.cpan.org/~lyokato/Catalyst-View-TT-ForceUTF8-0.07/
Template View Class with utf8 encoding
----
Class-MethodMaker-2.10
http://search.cpan.org/~schwigon/Class-MethodMaker-2.10/
Create generic methods for OO Perl
----
Coro-3.62
http://search.cpan.org/~mlehmann/Coro-3.62/
coroutine process abstraction
----
DBD-Unify-0.61
http://search.cpan.org/~hmbrand/DBD-Unify-0.61/
DBI driver for Unify database systems
----
DBIx-Class-TimeStamp-0.04
http://search.cpan.org/~jshirley/DBIx-Class-TimeStamp-0.04/
----
DBIx-MoCo-0.13
http://search.cpan.org/~jkondo/DBIx-MoCo-0.13/
Light & Fast Model Component
----
Device-Arduino-LCD-1.02
http://search.cpan.org/~montuori/Device-Arduino-LCD-1.02/
Perl Interface to the PerLCD Arduino Sketch.
----
File-ExtAttr-1.03
http://search.cpan.org/~richdawe/File-ExtAttr-1.03/
Perl extension for accessing extended attributes of files
----
Games-Crossword-Puzzle-0.001
http://search.cpan.org/~rjbs/Games-Crossword-Puzzle-0.001/
six letters for "reusable unit of code"
----
Google-Checkout-1.0.4
http://search.cpan.org/~dzhuo/Google-Checkout-1.0.4/
----
IPC-DirQueue-0.09
http://search.cpan.org/~jmason/IPC-DirQueue-0.09/
disk-based many-to-many task queue
----
Lingua-EN-NameCase-1.14
http://search.cpan.org/~summer/Lingua-EN-NameCase-1.14/
Perl module to fix the case of people's names.
----
Modwheel-0.2.2
http://search.cpan.org/~asksh/Modwheel-0.2.2/
Very extensible publishing-system
----
Net-Pavatar-1.01
http://search.cpan.org/~karjala/Net-Pavatar-1.01/
Pavatar client
----
POE-Component-Client-MogileFS-0.01
http://search.cpan.org/~mock/POE-Component-Client-MogileFS-0.01/
an async MogileFS client for POE
----
Pod-POM-Web-1.04
http://search.cpan.org/~dami/Pod-POM-Web-1.04/
HTML Perldoc server
----
RT-Client-REST-0.28
http://search.cpan.org/~dmitri/RT-Client-REST-0.28/
talk to RT installation using REST protocol.
----
Socialtext-Wikrad-0.04
http://search.cpan.org/~lukec/Socialtext-Wikrad-0.04/
efficient wiki browsing and editing
----
Spreadsheet-Read-0.18
http://search.cpan.org/~hmbrand/Spreadsheet-Read-0.18/
Meta-Wrapper for reading spreadsheet data
----
Sys-Statistics-Linux-0.09_17
http://search.cpan.org/~bloonix/Sys-Statistics-Linux-0.09_17/
Front-end module to collect system statistics
----
Template-Plugin-Shorten-0.02
http://search.cpan.org/~kentaro/Template-Plugin-Shorten-0.02/
Template plugin to shorten/lengthen URLs
----
Text-Restructured-0.003026
http://search.cpan.org/~nodine/Text-Restructured-0.003026/
Perl implementation of reStructuredText parser
----
Text-Restructured-0.003027
http://search.cpan.org/~nodine/Text-Restructured-0.003027/
Perl implementation of reStructuredText parser
----
Tk-Clock-0.18
http://search.cpan.org/~hmbrand/Tk-Clock-0.18/
Clock widget with analog and digital display
----
Tree-Simple-Manager-0.04
http://search.cpan.org/~stevan/Tree-Simple-Manager-0.04/
A class for managing multiple Tree::Simple hierarchies
----
URI-Escape-XS-0.01
http://search.cpan.org/~dankogai/URI-Escape-XS-0.01/
Drop-In replacement for URI::Escape
----
WebService-Careerjet-0.03
http://search.cpan.org/~jeteve/WebService-Careerjet-0.03/
Perl interface to Careerjet's public search API
----
Weed-0.0009
http://search.cpan.org/~hooo/Weed-0.0009/
ist ein englisches Wort f?r Unkraut
----
Weed-0.0012
http://search.cpan.org/~hooo/Weed-0.0012/
ist ein englisches Wort f?r Unkraut
----
XML-Atom-0.25_01
http://search.cpan.org/~miyagawa/XML-Atom-0.25_01/
Atom feed and API implementation
----
package-0.0002
http://search.cpan.org/~hooo/package-0.0002/
makes an alias of the current package
----
package-0.0005
http://search.cpan.org/~hooo/package-0.0005/
makes an alias of the current package


If you're an author of one of these modules, please submit a detailed
announcement to comp.lang.perl.announce, and we'll pass it along.

This message was generated by a Perl program described in my Linux
Magazine column, which can be found on-line (along with more than
200 other freely available past column articles) at
  http://www.stonehenge.com/merlyn/LinuxMag/col82.html

print "Just another Perl hacker," # the original

--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!


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

Date: 27 Apr 2007 22:59:36 -0700
From: "vincent64@yahoo.com" <datashaping@gmail.com>
Subject: Perl routine for cluster detection
Message-Id: <1177739976.102907.86810@n76g2000hsh.googlegroups.com>

Here is some elementary code to detect the presence of a clustering
structure in a 2-dimensional dataset. It's more heuristic than
scientific, so take it with a grain of salt, as even the concept of
cluster is highly fuzzy.

The seed routine creates a cluster of 1000 points, saved in
cluster.txt: each row corresponds to a point; the first column is the
cluster number, and the next two columns are the x and y coordinates.
The cluster number is automatically incremented each time a new call
to seed is made, resulting in the creation of a new cluster. The
distance routine computes the distance between two points, for 100
points randomly selected in the data set previously created
(cluster.txt). The output is a file dist.txt, with one row per pair
of
points, with two fields: the first column is an indicator and is
equal
to 1 if both points belong to the same cluster; the second column is
the distance between the two points. This script illustrates that it
is possible to check whether a data set contains one or two clusters
by looking at the distribution of distances: a gap in the
distribution
means the presence of distinct clusters. It also suggests that the
computational complexity of computing whether a data set contains one
of more clusters is well below O(n), possibly O(n0.5), if one uses
sampling techniques.


Source code: http://datashaping.com/regress.shtml



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

Date: Fri, 27 Apr 2007 20:53:14 GMT
From: Bart Lateur <bart.lateur@pandora.be>
Subject: Re: SQL statement in Perl doesn't work
Message-Id: <5lo433lmackak9t6m3o346jbv8qi26pjej@4ax.com>

Huub wrote:

>select betaald2006 from hvw where lidnr = $record and naam != " " and 
>kenmerk2006 is null
>
>works. The same statement via Perl:
>
>$betaald2006 = "select betaald2006 from hvw where lidnr = $record and 
>naam != ' ' and kenmerk2006 is null";
>
>does not work. 

It's not the same statement. You've changed the quotes.

-- 
	Bart.


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

Date: 27 Apr 2007 16:40:24 -0700
From: Nikos <nikos1337@gmail.com>
Subject: Re: Weird error after a configuration change
Message-Id: <1177717224.866132.68600@u30g2000hsc.googlegroups.com>

On Apr 27, 11:00 pm, Brian McCauley <nobul...@gmail.com> wrote:
> On Apr 27, 8:56 pm, Brian McCauley <nobul...@gmail.com> wrote:
>
>
>
> > On Apr 27, 8:33 pm, skieros <nikos1...@gmail.com> wrote:
>
> > > I have this part of script:
>
> > > ##############################################################
> > > my $action    =3D  param('action');
> > > #=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D REDIRECT TO PROPER SCRIPT =3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> > > if( ($action eq '=CE=9E=E2=80=98=CE=9F=E2=82=AC=CE=9E=CE=8F=CE=9F=C6=
=92=CE=9F=E2=80=9E=CE=9E=CE=8F=CE=9E=C2=BB=CE=9E=C2=AE!') && ($ENV{HTTP_REF=
ERER} =3D~ /
> > > index/) )
> > > ##############################################################
>
> > > and iam gettign thsi error now:
>
> > > [Fri Apr 27 22:28:11 2007] [error] [client 10.0.0.2] [Fri Apr 27
> > > 22:28:11 2007] admin.pl: Use of uninitialized value in string eq at D=
:\
> > > \www\\cgi-bin\\admin.pl line 26., referer:http://dell/
>
> > Hmmm... that's usually a warning. Do you perhaps have as use warnings
> > FATAL in your code?
>
> > > Line 26 is the line with if.
> > > All this happened when i deleted the d:\www\index.html file which was
> > > pointing to d:\www\cgi-bin\index.pl and set apache to load /cgi-bin/
> > > index.pl directly.
>
> > LOL!
>
> Sorry, I was laughing so hard I actually got it totally wrong.
>
> Oops.
>
> I now see there _was_ apparently a referer and the error was
> complaining about $action.
>
> So what was the URL you used to access the script? Did it in fact
> contain a value for action?
>
> > This, of course, has nothing to do with Perl.
>
> This, indeed, is probably still true.

ok, $action actually was NOT undefined it was that i had it as $action
=3D param('something_else_and not correct_var') so i wasnt checking for
the correct posted variable, no error now, except the fact that
referer is stil 'http://dell' although index.pl posts data to
admin.pl....

As matter of fact i tried to pritn the referrrer var in every script
of mine called by another perl cgi script and every tiem the result
was http://dell why?!!



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

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.  

NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice. 

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 V11 Issue 389
**************************************


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