[29144] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 388 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Apr 27 16:10:36 2007

Date: Fri, 27 Apr 2007 13:09:08 -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           Fri, 27 Apr 2007     Volume: 11 Number: 388

Today's topics:
    Re: Cant open a file with just a relative path <glex_no-spam@qwest-spam-no.invalid>
    Re: Cant open a file with just a relative path <jgibson@mail.arc.nasa.gov>
    Re: Cant open a file with just a relative path <nikos1337@gmail.com>
    Re: Cant open a file with just a relative path <nikos1337@gmail.com>
    Re: Cant open a file with just a relative path <nikos1337@gmail.com>
    Re: Cant open a file with just a relative path <glex_no-spam@qwest-spam-no.invalid>
    Re: Cant open a file with just a relative path <glex_no-spam@qwest-spam-no.invalid>
    Re: Cant open a file with just a relative path <nikos1337@gmail.com>
    Re: Font question <glex_no-spam@qwest-spam-no.invalid>
    Re: Font question <nobull67@gmail.com>
    Re: Font question <"v.niekerk at hccnet.nl">
    Re: Font question <veatchla@yahoo.com>
    Re: Font question <nobull67@gmail.com>
    Re: Login page perl/CGI <glex_no-spam@qwest-spam-no.invalid>
        Memory Management <shirazk@gmail.com>
        Memory Management <shirazk@gmail.com>
    Re: Passing a single hash to a sub <nowhere@noemail.com>
    Re: Readable/writable database in Perl <ecarlson@vmware.com>
        Samba file access checking? <jaford@watford53.freeserve.co.uk>
    Re: signal HANDLER in perl gaurava@lycos.com
        The Perl Journal <wahab-mail@gmx.de>
        Weird error after a configuration change <nikos1337@gmail.com>
    Re: Weird error after a configuration change <nobull67@gmail.com>
    Re: Weird error after a configuration change <nobull67@gmail.com>
    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 11:50:12 -0500
From: "J. Gleixner" <glex_no-spam@qwest-spam-no.invalid>
Subject: Re: Cant open a file with just a relative path
Message-Id: <463229c4$0$508$815e3792@news.qwest.net>

skieros wrote:
> On Apr 25, 5:57 am, Tad McClellan <t...@augustmail.com> wrote:
>> skieros <nikos1...@gmail.com> wrote:
> 
>>> Wehn i try to use this relative path
>> relative paths do not start with a directory separator character.
>>
>> They are relative to the current directory, hence the "relative"
>> in "relative path".
> 
> Yes my bad.
> 
> i was trying to mention this
> open(FILE, ">>somefolder/somesubfolder/digest.passwd") or die $!;
> 
> which is a relative path but still wont open th file.

Verify that the current working directory is actually what you think it 
should be.

Does the directory "somefolder/somesubfolder" exist, in the current 
working directory?

Does the user running the Web server have permissions to get to that 
directory?

Does the user running the Web server have permissions to write to that 
directory?

Is the file writable by the user running the Web server?


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

Date: Fri, 27 Apr 2007 10:18:37 -0700
From: Jim Gibson <jgibson@mail.arc.nasa.gov>
Subject: Re: Cant open a file with just a relative path
Message-Id: <270420071018373306%jgibson@mail.arc.nasa.gov>

In article <1177673127.696837.306020@t38g2000prd.googlegroups.com>,
skieros <nikos1337@gmail.com> wrote:

> On Apr 25, 5:57 am, Tad McClellan <t...@augustmail.com> wrote:
> > skieros <nikos1...@gmail.com> wrote:
> 
> > > Wehn i try to use this relative path
> >
> > relative paths do not start with a directory separator character.
> >
> > They are relative to the current directory, hence the "relative"
> > in "relative path".
> 
> Yes my bad.
> 
> i was trying to mention this
> open(FILE, ">>somefolder/somesubfolder/digest.passwd") or die $!;
> 
> which is a relative path but still wont open th file.
> 

Use the getcwd() function of the core Cwd module to determine your
default directory:

  use Cwd;
  my $cwd = getcwd();
  print "current directory: $cwd\n";

Use the file text operators -e and -r to see if the file exists and is
readable by your process.

Use stat to determine the file permissions of the file in question:

  my $file = '.../digest.passwd';
  my @filestat = stat $file;
  printf "Mode: %o\n", $filestat[2];

Print the variables $> and $< to display your effective and real user
IDs.

Good luck!

-- 
Jim Gibson

 Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
    ** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------        
                http://www.usenet.com


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

Date: 27 Apr 2007 11:30:51 -0700
From: skieros <nikos1337@gmail.com>
Subject: Re: Cant open a file with just a relative path
Message-Id: <1177698651.356406.54030@r30g2000prh.googlegroups.com>

On Apr 27, 7:50 pm, "J. Gleixner" <glex_no-s...@qwest-spam-no.invalid>
wrote:
> skieros wrote:
> > On Apr 25, 5:57 am, Tad McClellan <t...@augustmail.com> wrote:
> >> skieros <nikos1...@gmail.com> wrote:
>
> >>> Wehn i try to use this relative path
> >> relative paths do not start with a directory separator character.
>
> >> They are relative to the current directory, hence the "relative"
> >> in "relative path".
>
> > Yes my bad.
>
> > i was trying to mention this
> > open(FILE, ">>somefolder/somesubfolder/digest.passwd") or die $!;
>
> > which is a relative path but still wont open th file.
>
> Verify that the current working directory is actually what you think it
> should be.
>
> Does the directory "somefolder/somesubfolder" exist, in the current
> working directory?
>
> Does the user running the Web server have permissions to get to that
> directory?
>
> Does the user running the Web server have permissions to write to that
> directory?
>
> Is the file writable by the user running the Web server?

Wait isnt that user you describing Apache itself?!



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

Date: 27 Apr 2007 12:05:07 -0700
From: skieros <nikos1337@gmail.com>
Subject: Re: Cant open a file with just a relative path
Message-Id: <1177700707.886633.245650@r3g2000prh.googlegroups.com>

On Apr 27, 8:18 pm, Jim Gibson <jgib...@mail.arc.nasa.gov> wrote:
> In article <1177673127.696837.306...@t38g2000prd.googlegroups.com>,
>
>
>
> skieros <nikos1...@gmail.com> wrote:
> > On Apr 25, 5:57 am, Tad McClellan <t...@augustmail.com> wrote:
> > > skieros <nikos1...@gmail.com> wrote:
>
> > > > Wehn i try to use this relative path
>
> > > relative paths do not start with a directory separator character.
>
> > > They are relative to the current directory, hence the "relative"
> > > in "relative path".
>
> > Yes my bad.
>
> > i was trying to mention this
> > open(FILE, ">>somefolder/somesubfolder/digest.passwd") or die $!;
>
> > which is a relative path but still wont open th file.
>
> Use the getcwd() function of the core Cwd module to determine your
> default directory:
>
>   use Cwd;
>   my $cwd = getcwd();
>   print "current directory: $cwd\n";
>
> Use the file text operators -e and -r to see if the file exists and is
> readable by your process.
>
> Use stat to determine the file permissions of the file in question:
>
>   my $file = '.../digest.passwd';
>   my @filestat = stat $file;
>   printf "Mode: %o\n", $filestat[2];
>
> Print the variables $> and $< to display your effective and real user
> IDs.
>
> Good luck!

Thank you i wa having that question myself.

Iam on WinXP so do i ahve permission here like i do in linux?

And if so how can i chmod 755 <FILE_IN_QUESTION> on this OS?



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

Date: 27 Apr 2007 12:09:39 -0700
From: skieros <nikos1337@gmail.com>
Subject: Re: Cant open a file with just a relative path
Message-Id: <1177700979.285341.256230@r3g2000prh.googlegroups.com>

On Apr 27, 8:18 pm, Jim Gibson <jgib...@mail.arc.nasa.gov> wrote:
> In article <1177673127.696837.306...@t38g2000prd.googlegroups.com>,
>
>
>
> skieros <nikos1...@gmail.com> wrote:
> > On Apr 25, 5:57 am, Tad McClellan <t...@augustmail.com> wrote:
> > > skieros <nikos1...@gmail.com> wrote:
>
> > > > Wehn i try to use this relative path
>
> > > relative paths do not start with a directory separator character.
>
> > > They are relative to the current directory, hence the "relative"
> > > in "relative path".
>
> > Yes my bad.
>
> > i was trying to mention this
> > open(FILE, ">>somefolder/somesubfolder/digest.passwd") or die $!;
>
> > which is a relative path but still wont open th file.
>
> Use the getcwd() function of the core Cwd module to determine your
> default directory:
>
>   use Cwd;
>   my $cwd = getcwd();
>   print "current directory: $cwd\n";
>
> Use the file text operators -e and -r to see if the file exists and is
> readable by your process.
>
> Use stat to determine the file permissions of the file in question:
>
>   my $file = '.../digest.passwd';
>   my @filestat = stat $file;
>   printf "Mode: %o\n", $filestat[2];
>
> Print the variables $> and $< to display your effective and real user
> IDs.
>
> Good luck!
>
> --
> Jim Gibson
>
>  Posted Via Usenet.com Premium Usenet Newsgroup Services
> ----------------------------------------------------------
>     ** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
> ----------------------------------------------------------
>                http://www.usenet.com

my $file = ">>$ENV{'DOCUMENT_ROOT'}/blabla/blabla/digest.passwd";
my @filestat = stat $file;
printf "Mode: %o\n", $filestat[0], $filestat[1], $filestat[2];

returns mode 0; #dont knwo what is mode 0 though....



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

Date: Fri, 27 Apr 2007 14:16:15 -0500
From: "J. Gleixner" <glex_no-spam@qwest-spam-no.invalid>
Subject: Re: Cant open a file with just a relative path
Message-Id: <46324bff$0$499$815e3792@news.qwest.net>

skieros wrote:
> On Apr 27, 8:18 pm, Jim Gibson <jgib...@mail.arc.nasa.gov> wrote:
[...]
> my $file = ">>$ENV{'DOCUMENT_ROOT'}/blabla/blabla/digest.passwd";
> my @filestat = stat $file;
> printf "Mode: %o\n", $filestat[0], $filestat[1], $filestat[2];
> 
> returns mode 0; #dont knwo what is mode 0 though....

To learn about the stat call:

perldoc -f stat

my $file = "$ENV{'DOCUMENT_ROOT'}/blabla/blabla/digest.passwd";


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

Date: Fri, 27 Apr 2007 14:28:50 -0500
From: "J. Gleixner" <glex_no-spam@qwest-spam-no.invalid>
Subject: Re: Cant open a file with just a relative path
Message-Id: <46324ef2$0$505$815e3792@news.qwest.net>

skieros wrote:
> On Apr 27, 7:50 pm, "J. Gleixner" <glex_no-s...@qwest-spam-no.invalid>
> wrote:

>> Verify that the current working directory is actually what you think it
>> should be.
>>
>> Does the directory "somefolder/somesubfolder" exist, in the current
>> working directory?
>>
>> Does the user running the Web server have permissions to get to that
>> directory?
>>
>> Does the user running the Web server have permissions to write to that
>> directory?
>>
>> Is the file writable by the user running the Web server?
> 
> Wait isnt that user you describing Apache itself?!

Wait, you didn't answer the other questions. :-)

Maybe this will help with the user related questions:
	http://httpd.apache.org/docs/2.0/platform/windows.html

Using stat will help show those permissions.


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

Date: 27 Apr 2007 12:38:35 -0700
From: skieros <nikos1337@gmail.com>
Subject: Re: Cant open a file with just a relative path
Message-Id: <1177702715.269099.53950@u32g2000prd.googlegroups.com>

On Apr 27, 10:28 pm, "J. Gleixner" <glex_no-s...@qwest-spam-
no.invalid> wrote:
> Using stat will help show those permissions.

Iam gettign Mode 0 when i try to printout the results of stat that
filled the array.



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

Date: Fri, 27 Apr 2007 12:18:25 -0500
From: "J. Gleixner" <glex_no-spam@qwest-spam-no.invalid>
Subject: Re: Font question
Message-Id: <46323061$0$502$815e3792@news.qwest.net>

Huub wrote:
> Hi,
> 
> I'm trying to get plain text printed in Courier font. When looking at 
> CPAN, I find about 39 modules for handling fonts, but none for plain 
> text. Is there a module for that? BTW, I used font+courier as a search 
> string in CPAN.

Where medium are you printing it to?


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

Date: 27 Apr 2007 10:53:09 -0700
From: Brian McCauley <nobull67@gmail.com>
Subject: Re: Font question
Message-Id: <1177696389.628300.267550@s33g2000prh.googlegroups.com>

On Apr 27, 3:59 pm, Huub <"v.niekerk at hccnet.nl"> wrote:

> I'm trying to get plain text printed in Courier font. When looking at
> CPAN, I find about 39 modules for handling fonts, but none for plain
> text.

Plain text doesn't have a font. The only way you could associate a
fond with a plain text file would be by settings on your print job or
print queue or printer.

A  J. Gleixner  asked: Where medium are you printing it to?

And by what mechanism on what OS?



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

Date: Fri, 27 Apr 2007 20:28:10 +0200
From: Huub <"v.niekerk at hccnet.nl">
Subject: Re: Font question
Message-Id: <463240ba$0$11827$e4fe514c@dreader20.news.xs4all.nl>

> Plain text doesn't have a font. The only way you could associate a
> fond with a plain text file would be by settings on your print job or
> print queue or printer.
> 
> A  J. Gleixner  asked: Where medium are you printing it to?
> 
> And by what mechanism on what OS?
> 

I'm using Fedora 6 and a Perl-script reading from MySQL printing plain 
text to a DeskJet520.
If plain text doesn't have a font, then how can I set this printer to 
print the correct font? It seems to use PCL5, but I haven't been able to 
find a way to use that from Perl.

Thanks for helping.


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

Date: Fri, 27 Apr 2007 14:11:46 -0500
From: l v <veatchla@yahoo.com>
Subject: Re: Font question
Message-Id: <1334ile1hh0c0a@news.supernews.com>

Huub wrote:
>> Plain text doesn't have a font. The only way you could associate a
>> fond with a plain text file would be by settings on your print job or
>> print queue or printer.
>>
>> A  J. Gleixner  asked: Where medium are you printing it to?
>>
>> And by what mechanism on what OS?
>>
> 
> I'm using Fedora 6 and a Perl-script reading from MySQL printing plain 
> text to a DeskJet520.
> If plain text doesn't have a font, then how can I set this printer to 
> print the correct font? It seems to use PCL5, but I haven't been able to 
> find a way to use that from Perl.
> 
> Thanks for helping.

Now that is a different question.

How are you printing to the printer?  You need to tell the printer what 
font to use via a PCL5 command.  Or change the printers default font.

If you send the printer plain text, the printer will print using it's 
default font.  If you are generating the PCL statements to send to the 
printer, then you need to tell the printer to use a different font in 
your print job.

-- 

Len


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

Date: 27 Apr 2007 12:45:43 -0700
From: Brian McCauley <nobull67@gmail.com>
Subject: Re: Font question
Message-Id: <1177703143.033384.46100@t38g2000prd.googlegroups.com>

On Apr 27, 7:28 pm, Huub <"v.niekerk at hccnet.nl"> wrote:
> > Plain text doesn't have a font. The only way you could associate a
> > fond with a plain text file would be by settings on your print job or
> > print queue or printer.
>
> > A  J. Gleixner  asked: Where medium are you printing it to?
>
> > And by what mechanism on what OS?
>
> I'm using Fedora 6 and a Perl-script reading from MySQL printing plain
> text to a DeskJet520.
> If plain text doesn't have a font, then how can I set this printer to
> print the correct font? It seems to use PCL5, but I haven't been able to
> find a way to use that from Perl.

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.

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].

[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




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

Date: Fri, 27 Apr 2007 10:21:22 -0500
From: "J. Gleixner" <glex_no-spam@qwest-spam-no.invalid>
Subject: Re: Login page perl/CGI
Message-Id: <463214f3$0$513$815e3792@news.qwest.net>

sandy wrote:
> hello,,,,,,,,,
> i am creating login page using Perl/CGI  facing prob... able to
> connect DB but from there facing prob

Try facing North instead of prob.
[...]
> please help me

Create a program that works from the command line, no HTML.  Once
that works, then add in the HTML.

> i am using MySQL as DB user name:root password:xxxx database name:ITS
ahhhh.. the values for your username and password and database aren't 
important..

> and Table is User_login,
> Column 1: User_Name
> Column 2: User_Pass
> 
> --
> #!c:/perl/bin/perl.exe
> use CGI qw(:standard);
> use CGI::Carp qw(warning's fatalsToBrowser);
> use strict;
> use DBI;
> 
> 
> print "Content-type: text/html\n\n";
[...]

sooo.. you're using the CGI module but you aren't using any of CGI's 
modules to help you with your HTML???..  If all you want is the
param method, then you don't need :standard.  If you're going to
include all of the 'standard' methods, then use them.


> my $dbh = DBI->connect("DBI:mysql:database:localhost","its","root",
> { RaiseError => 1,
> AutoCommit => 1 }) or &dienice("Can't connect to database:
> $DBI::errstr");

Read up on what 'RaiseError' does. 'dienice' for a subroutine that 
doesn't actually call die, isn't nice.

No need for '&'.

> my $UserName=param('UserName');
> my $Password=param('Password');
> my $sth = $dbh->prepare("select * from User_Login where User_Name
> = ?") or &dbdie;

Hopefully you're not storing your customer's passwords in clear text. 
Encrypt them, somehow.

> $sth->execute($UserName) or &dbdie;
> if (my $name = $sth->fetchrow_hashref)
> {
> my $sth = $dbh->prepare("select * from user_Login where root = ?") or
> &dbdie;

'where root = ?' ????

You have a column named 'root'?

Maybe...

if( param('UserName') and param('Password') )
{
	my $sql = 'select 1 from user_login where user_name=? and user_pass=?';
	my $sth = $dbh->prepare( $sql );
	$sth->execute( param('UserName'), param('Password') );
etc..
}
else
{
	#print some message here..
}

> $sth->execute($Password) or &dbdie;
> if (my $pass = $sth->fetchrow_hashref)
> {
>  print redirect(- location=>"index.cgi");
>  }
> else { &dienice(qq(The password is invalid. Go to the <a href =
> "passreset.cgi">password reset</a> page to reset your password.)); }
> }
> else { &dienice(qq(Username does not exist. Go to the <a href = "
> custreg.cgi">registration</a> page to register.)); }

If your site has any personal information on it, about the customer, 
then don't provide the reason why it failed.  Just state that the
username or password is not found, in one message.


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

Date: 27 Apr 2007 11:26:48 -0700
From: Shiraz <shirazk@gmail.com>
Subject: Memory Management
Message-Id: <1177698408.752236.64340@t39g2000prd.googlegroups.com>

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? Can anyone please point me to a memory management routing that
is better than what i am using.
Thanks



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

Date: 27 Apr 2007 11:30:36 -0700
From: Shiraz <shirazk@gmail.com>
Subject: Memory Management
Message-Id: <1177698636.108763.42420@s33g2000prh.googlegroups.com>

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? Can anyone please point me to a memory management routing
that
is better than what i am using, specifically something that reserves
memory for the script explicitly and does not let it over flow ( no
out of memory errors )
Thanks



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

Date: 27 Apr 2007 18:53:26 GMT
From: nowhere <nowhere@noemail.com>
Subject: Re: Passing a single hash to a sub
Message-Id: <463246a6$0$17204$39cecf19@news.twtelecom.net>


sub test {
  my ($k,$v,$ref) = @_;

  # this makes a hash %h which is a copy of the hash in $ref
  # also, it is local to this sub (not your intention)
  #my (%h) = %$ref;  
  #$h{$k} = $v;

  # instead, modify the hash in $ref
  $ref->{$k} = $v
}


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

Date: 27 Apr 2007 08:15:49 -0700
From: Eric <ecarlson@vmware.com>
Subject: Re: Readable/writable database in Perl
Message-Id: <1177686949.292776.168270@b40g2000prd.googlegroups.com>

Thanks to everyone who replied to this posting. I think I have enough
to get me going on this adventure.

I apologize for any breech of etiquette I may have committed. I'm not
what you call an ongoing, experienced usenet participant. I'll make
note of the suggestions people offered in regards to posting and
replying. This group has always been helpful in giving me good
direction.

Eric



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

Date: Fri, 27 Apr 2007 17:59:41 GMT
From: Jim Ford <jaford@watford53.freeserve.co.uk>
Subject: Samba file access checking?
Message-Id: <hSqYh.2447$Tu5.46@newsfe6-gui.ntli.net>

I'm checking Samba share files accessed on my Linux machine, using the 
output of smbstatus to get the IP addresses of the machines. This seems 
to me to be a kludgy way of doing it and the data appears to lag the 
actual situation.

Is there a better way of doing this, anyone?

Jim Ford


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

Date: 27 Apr 2007 11:38:48 -0700
From: gaurava@lycos.com
Subject: Re: signal HANDLER in perl
Message-Id: <1177699128.019467.78820@r30g2000prh.googlegroups.com>

thanks that helps. I will try it out.

On Apr 25, 12:22 pm, xhos...@gmail.com wrote:
> xhos...@gmail.com wrote:
>
> > >       if ($kid == $imp_pid) {
> > >          exit();
> > >       }
>
> > If you are only interested in the case in which $kid==$imp_pid, you
> > should probably specify $imp_pid rather than -1 as the first argument to
> > waitpid.
>
> Scratch that.  Perhaps you should use $imp_pid as the first argument to
> waitpid, but perhaps not, depending on how long-running your job is and
> thus the risk of accumulating zombies.
>
> Xho
>
> --
> --------------------http://NewsReader.Com/--------------------
> Usenet Newsgroup Service                        $9.95/Month 30GB




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

Date: Fri, 27 Apr 2007 17:39:07 +0200
From: Mirco Wahab <wahab-mail@gmx.de>
Subject: The Perl Journal
Message-Id: <f0t5r9$42t$1@mlucom4.urz.uni-halle.de>

Regarding the Subject,

what's the status of all the nice old issues?

I accidentally "stumbled" over a innocent
open web site which "shares" all TPJ .pdf-
issues between 11/2002 and 04/2005 (maybe
without knowing that).

Knowing that TPJ got absorbed by CMP
(and killed somewhere in the process)
I looked around in CMP's archive but
only found single Articles that may
have been coming from the TPJ issues.

My Questions: What exactly is the
status of the "real TPJ issues" in
their original pdf format - as they
had been published.

Are they lost for mankind?

Also Randal's (who contributed
much over the decades) site doesn't
mention much.
(www*stonehenge*com\merlyn\PerlJournal\)


Who Knows?

Regards & Thanks


Mirco


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

Date: 27 Apr 2007 12:33:31 -0700
From: skieros <nikos1337@gmail.com>
Subject: Weird error after a configuration change
Message-Id: <1177702411.308386.323540@r3g2000prh.googlegroups.com>

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_REFERER} =
=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/

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.



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

Date: 27 Apr 2007 12:56:14 -0700
From: Brian McCauley <nobull67@gmail.com>
Subject: Re: Weird error after a configuration change
Message-Id: <1177703774.104390.194250@r35g2000prh.googlegroups.com>

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_REFERE=
R} =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!

So you are saying that "all you did" was to remove the referring page
and access the CGI script via a _direct_ URL (i.e. no referrer).

And now when your script tries to perform an operation on the address
of the referring page it finds that this is data item is undefined.

Well yes, er, it would.

This, of course, has nothing to do with Perl.



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

Date: 27 Apr 2007 13:00:48 -0700
From: Brian McCauley <nobull67@gmail.com>
Subject: Re: Weird error after a configuration change
Message-Id: <1177704048.027473.88380@t38g2000prd.googlegroups.com>

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_REFERE=
R} =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.



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

Date: 27 Apr 2007 13:03:22 -0700
From: skieros <nikos1337@gmail.com>
Subject: Re: Weird error after a configuration change
Message-Id: <1177704202.143045.163970@o40g2000prh.googlegroups.com>

On Apr 27, 10: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_REFERE=
R} =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?

#!/usr/bin/perl -w
use strict;
use CGI::Carp qw(fatalsToBrowser);

> > 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!
>
> So you are saying that "all you did" was to remove the referring page
> and access the CGI script via a _direct_ URL (i.e. no referrer).
>
> And now when your script tries to perform an operation on the address
> of the referring page it finds that this is data item is undefined.
>
> Well yes, er, it would.
>
> This, of course, has nothing to do with Perl.

But its a perl error and also admin.pl receives data from index.pl and
check if a param is passed.
my $action    =3D  param('action');




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

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 388
**************************************


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