Urgent IIS server - File Upload problem.

2001-11-11 Thread Rajeev Rumale



Dear friends,

I have received this error while uploading a file via cgi.
The code used has been working fine on the internal servers but gives the
following error on the ISP server.

Software error:
CGI open of tmpfile: Permission denied

For help, please send mail to this site's webmaster, giving this error
message and the time and date of the error. Content-type: text/html

Software error:
[Mon Nov 12 14:28:32 2001] C:\Inetpub\wwwroot\cgi-bin\fileUpload.pl: CGI
open of tmpfile: Permission denied
Compilation failed in require at C:\Inetpub\wwwroot\cgi-bin\fileUpload.pl
line 12.

For help, please send mail to this site's webmaster, giving this error
message and the time and date of the error.

with regards

Rajeev Rumale



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: $variable manipulation question

2001-10-02 Thread Rajeev Rumale

Wow !,  And I never thought we can use "split //"  

This solution
 print join ' ', split //, $input;
shows the beauty of Perl :-)

Rajeev

- Original Message - 
From: "Bob Showalter" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, October 02, 2001 9:06 PM
Subject: RE: $variable manipulation question


> > -Original Message-
> > From: Shannon Murdoch [mailto:[EMAIL PROTECTED]]
> > Sent: Tuesday, October 02, 2001 6:51 AM
> > To: [EMAIL PROTECTED]
> > Subject: Re: $variable manipulation question
> > 
> > 
> > I found a solution not long after using a loop of sorts. (and 
> > killed two
> > birds with one stone, as my next step was to put each item 
> > (space delimited)
> > into an array).
> > I made a loop saying, 'as long as $input still has characters 
> > in it, put
> > each one (one at a time) into the @front_chars array, then 
> > reverse the list
> > order so it's normal again.'
> > 
> > $input = "1234";
> > 
> > while($input ne undef){
> > push(@front_chars,chop($input));
> > }
> > @front_chars = reverse @front_chars;
> > 
> > Not sure if this is helpful to anyone, but it helped me
> 
> How did that help you? Now you have an array of individual
> characters, gotten the hard way. Using split() is the way
> to do this (see perldoc -f split):
> 
>@chars = split //, $input;
> 
> To print this list out with spaces between, you can:
> 
>$" = ' '; # this is the default
>print "@chars";   # double quotes required here
> 
> or
> 
>print join ' ', @chars;
> 
> The split and join can be combined to elminate the intermediate
> array:
> 
>print join ' ', split //, $input;
> 
> Which was brian's solution.
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: $variable manipulation question

2001-10-02 Thread Rajeev Rumale

Thats Great !
Yes this is infact helped me.
I was trying it in a much complicated way.

regards

Rajeev Rumale




- Original Message -
From: "Shannon Murdoch" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, October 02, 2001 6:50 PM
Subject: Re: $variable manipulation question


> I found a solution not long after using a loop of sorts. (and killed two
> birds with one stone, as my next step was to put each item (space
delimited)
> into an array).
> I made a loop saying, 'as long as $input still has characters in it, put
> each one (one at a time) into the @front_chars array, then reverse the
list
> order so it's normal again.'
>
> $input = "1234";
>
> while($input ne undef){
> push(@front_chars,chop($input));
> }
> @front_chars = reverse @front_chars;
>
> Not sure if this is helpful to anyone, but it helped me
>
>
> > Hi all,
> >
> > I'm trying to get a string (held in a variable) to have all it's
characters
> > spaced apart by a ' ' space.
> >
> > ie.   $input's content changes from '1234' to '1 2 3 4'
> >
> > Is there some way to do this?
> >
> > cheers,
> > -Shannon
> >
>
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Stylesheet line not working

2001-10-01 Thread Rajeev Rumale

Yeup ! The the "TYPE" declaration is very important !.
We tend to ignore such things when we use MS platforms...:-(
Thanks for correcting me Michael .

with Regards

Rajeev Rumale



- Original Message -
From: "Michael D. Risser" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, October 01, 2001 9:17 PM
Subject: Re: Stylesheet line not working


> On Monday 01 October 2001 05:26 am, Rajeev Rumale wrote:
> > Check out the path and location.
> >
> > As per you current code the location of stylesheet should in the
directory
> > where the script is lies.
> > As gernally all scripts are in cgi-bin which might have only execute
> > permission.
> >
> >
> > its better to have the style sheet into a seprate directory in website
> > root(say "styles").
> >
> > Then you can write
> > 
> >
> >
> > this should work perfectly.
> >
> > Rajeev Rumale
> >
> > - Original Message -
> > From: "Brett W. McCoy" <[EMAIL PROTECTED]>
> > To: "Gary L. Armstrong" <[EMAIL PROTECTED]>
> > Cc: <[EMAIL PROTECTED]>
> > Sent: Monday, October 01, 2001 3:42 AM
> > Subject: Re: Stylesheet line not working
> >
> > > On Sun, 30 Sep 2001, Gary L. Armstrong wrote:
> > > > I have skimmed through the Llama and Camel and I don't know why this
> >
> > should
> >
> > > > not work:
> > > >
> > > > #startcode
> > > > print < > > >
> > > >  > > > "http://www.w3.org/TR/xhtml1/DTD/transitional.dtd";>
> > > >
> > > > 
> > > > 
> > > > Geek Shop -- A Web Page
> > > > 
> > > > 
> > > > ...blahblahblah...
> > > > BLOCK1
> > > > #endcode
> > > >
> > > > Actually the whole thing works fine (hooray, my first CGI) except
that
> >
> > it's
> >
> > > > not finding my style1.css, and before I start messing around with it
> > > > too much, I thought I'd find out if any of you might throw me a
bone.
> > >
> > > Where is the style1.css file?  Going by the above code, it should be
in
> > > the document root of the web server, not in the cgi-bin directory.  In
> > > the HTML that is output, its context is still that of the web server,
not
> > > the CGI script.
> > >
> > > -- Brett
> > >
http://www.chapelperilous.net/
> >
> 
> > > It's not hard to admit errors that are [only] cosmetically wrong.
> > > -- J.K. Galbraith
> > >
> > >
> > > --
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
>
> I have found that some browsers do not like the style tag in the form you
are
> sending they prefer
>
> 
>
> For some reason they require the TYPE attribute to be present.
> --
> Michael D. Risser
> Software Engineer
> =
> Machine Vision Products, Inc.
> www.visionpro.com
> [EMAIL PROTECTED]
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: formating variables again...

2001-10-01 Thread Rajeev Rumale

I would have done it like this.

$var = 34.5678;
$var=~/((\d+).(\d{0,2}))/;
$var = $1;
$var=~s/\./,/sg;
printf (" The formated value is : $var");

---OUTPUT
 The formated value is : 34.56


Well there may be better and more straigth forward ways, I was just trying
to get used to Patterns and subsititution.

with regards

Rajeev Rumale




- Original Message -
From: "Wagner Garcia Campagner" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, October 01, 2001 9:18 PM
Subject: formating variables again...


> Hi,
>
> I have a variable $var = 34.5678
>
> If I
>
> printf ("%.2f", $var);
>
> Then $var = 34.56
>
> Is there a way for me to format $var to became 34,56 instead of 34.56 ???
>
> Thanks,
> Wagner.
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Stylesheet line not working

2001-10-01 Thread Rajeev Rumale

Check out the path and location.

As per you current code the location of stylesheet should in the directory
where the script is lies.
As gernally all scripts are in cgi-bin which might have only execute
permission.


its better to have the style sheet into a seprate directory in website
root(say "styles").

Then you can write



this should work perfectly.

Rajeev Rumale

- Original Message -
From: "Brett W. McCoy" <[EMAIL PROTECTED]>
To: "Gary L. Armstrong" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Monday, October 01, 2001 3:42 AM
Subject: Re: Stylesheet line not working


> On Sun, 30 Sep 2001, Gary L. Armstrong wrote:
>
> > I have skimmed through the Llama and Camel and I don't know why this
should
> > not work:
> >
> > #startcode
> > print < >
> >  > "http://www.w3.org/TR/xhtml1/DTD/transitional.dtd";>
> >
> > 
> > 
> > Geek Shop -- A Web Page
> > 
> > 
> > ...blahblahblah...
> > BLOCK1
> > #endcode
> >
> > Actually the whole thing works fine (hooray, my first CGI) except that
it's
> > not finding my style1.css, and before I start messing around with it too
> > much, I thought I'd find out if any of you might throw me a bone.
>
> Where is the style1.css file?  Going by the above code, it should be in
> the document root of the web server, not in the cgi-bin directory.  In the
> HTML that is output, its context is still that of the web server, not the
> CGI script.
>
> -- Brett
>   http://www.chapelperilous.net/
> 
> It's not hard to admit errors that are [only] cosmetically wrong.
> -- J.K. Galbraith
>
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: processing/displaying data within

2001-09-29 Thread Rajeev Rumale


there is another simple way.  Just put the value of textarea into a "pre"
tag.

for example.  print qq{$value};

But more important thing is you need to keep in mind always.

Incase if you are have charcters other than just alphabets and numbers then
have to convert few chars to HTML specific for example.
"&" to "&"
and if there are multiple consecutive spaces  then replace them with
" "

But you need to very careful with "<" and ">"  as they would corrupt the
HTML code. Just change them
">" to ">"
"<" to "<"

Hope You got the answer.

regards

Rajeev Rumale
- Original Message -
From: "Stephan Tinnemeyer" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, September 29, 2001 4:28 AM
Subject: Re: processing/displaying data within 


> Chad,
>
> try to set wrap=physical:
>
> 
>
> Cheers
>
> Stephan
> --
> Dipl.-Chem. Stephan Tinnemeyer
> Lindenallee 20
> 24105 Kiel
> Germany
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Boolean operators...

2001-09-28 Thread Rajeev Rumale

Well franck , I could not get you logic in the first attempt.
Genrally password are associatied with users so the comparions shoud be
if  ( $user1 eq "myself" && $password1 eq "pass1")  {
print " "
}


incase you need to if there "either" of user1 or user 2 then it should be

if  ( $user1 eq "myself" && $password1 eq "pass1")  || ( $user1 eq
"yourself" && $password1 eq "pass2")  {
print "dfdfsafsa";
}

I cannot imagine a situation where you need to check "user1" and "user2".
Well may in some multiuser programs this may be required, but don;t have
much experience with that.

I would not be surprised if this not what you were looking for.  Actaull you
should elaborate the problem to a greater extent, then only you can expect
correct anwers

Rajeev Rumale



> Hi,
>
> I'm trying to do a comparisson with boolean operators and it is not
> working...
>
> Example:
> $user1
> $user2
> $password1
> $password2 (this are the variables)...
>
> The comparisson:
>
> if (( $user1 ne "myself" || $password1 ne "pass1") && ( $user2 ne
"yourself"
> || $password2 ne "pass2")) {
>
> print "dfdfsafsa";
>
> }
>
> it is not working is these boolean operators right???
>
> Thanks in advance,
> Wagner
>
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Volunteer Project

2001-09-20 Thread Rajeev Rumale

Hi Teresa,

Can include me also in your list.

Rajeev Rumale

- Original Message - 
From: "Bradley M. Handy" <[EMAIL PROTECTED]>
To: "Teresa Raymond" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Thursday, September 20, 2001 7:47 PM
Subject: RE: Volunteer Project


> Send me the details of the project and I'll look it over.  Right now I'm
> pretty busy, but I've wanted to work on a volunteer for a while now.
> 
> Bradley M. Handy
> Senior Programmer/Owner
> Jack-of-all-trades Programming Services
> --www.jack-of-all-trades.net
> --mailto:[EMAIL PROTECTED]
> 
> > -Original Message-
> > From: Teresa Raymond [mailto:[EMAIL PROTECTED]]
> > Sent: Thursday, September 20, 2001 9:41 AM
> > To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> > Subject: Volunteer Project
> >
> >
> > Is anyone interested in doing a volunteer project for
> > www.selfhelpmagazine.com with me?  This is a project that involves a
> > SQL database which I have zero experience with but have bought the
> > Programming the Perl DBI book.
> >
> >
> > ---
> > -  Teresa Raymond -
> > -  [EMAIL PROTECTED]   -
> > -  http://www.mariposanet.com -
> > ---
> >
> > --
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> 
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: upload file

2001-09-10 Thread Rajeev Rumale

Yea its matter of choice.
If you want you can use the file name which is submitted ($filename) or you
can write have your own file name assigned to it.

The later option is genrally used when you want to be sure that no existing
file is  over written.

As the Perl gurus always says, "U can do it in many ways."

Rajeev


- Original Message -
From: "Konstantin" <[EMAIL PROTECTED]>
To: "Rajeev Rumale" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Monday, September 10, 2001 4:46 PM
Subject: Re: upload file


> Thank you very much. Now I get the file. But how do I get the name of the
> file now? Is it the matter of choice : the file or its name?:)
>
>
> - Original Message -
> From: Rajeev Rumale <[EMAIL PROTECTED]>
> To: Konstantin <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
> Sent: Thursday, September 20, 2001 9:07 AM
> Subject: Re: upload file
>
>
> > Check out your form tag in the html page.
> >
> > does all the params set properly it should be something like this.
> >
> >  > enctype="multipart/form-data" method="POST">
> >
> > The last param "enctype" is a must for file input type. which is
genrally
> > not their for normal forms
> >
> > let me know if you get it.
> >
> > regards
> >
> > Rajeev
> >
> >
> >
> >
> >
> >
> >
> > - Original Message -
> > From: "Konstantin" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Sunday, September 09, 2001 7:35 PM
> > Subject: upload file
> >
> >
> > Hi.
> >
> > I'm trying to upload file with the next code:
> >
> > #!/usr/bin/perl
> > use DBI;
> > use CGI qw/:standard/;
> > no strict;
> > use constant MAX_FILE_SIZE => 1_048_576;
> > use constant BUFFER_SIZE => 16_384;
> > my $buffer = "";
> >
> > my $cgi=new CGI;
> >
> > my $filename=$cgi->param('picture') || die ("No file name received.");
> > my $file=$cgi->upload('picture') || die ("No file received.");
> > $filename =~ s/^.*[\\|\/]//g;
> > $filename=~s/://g;
> >
> > open(OUTPUT,">d:/pics/".$filename) || die ("Can not open output file");
> >
> > binmode OUTPUT;
> > binmode INPUT;
> > my ($buffer,$bytesread);
> >
> > while($bytesread=read($file,$buffer,1024) ){
> > print OUTFILE $buffer;
> >  }
> >
> > close INPUT;
> > close OUTFILE;
> >
> > I get error message "No file received." so the execution of line
> > my $file=$cgi->upload('picture')
> > fails. Can anybody please help?
> >
> > Thanks  in advance.
> >
> >
> >
> > --
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
>
>


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: upload file

2001-09-09 Thread Rajeev Rumale

Check out your form tag in the html page.

does all the params set properly it should be something like this.



The last param "enctype" is a must for file input type. which is genrally
not their for normal forms

let me know if you get it.

regards

Rajeev







- Original Message -
From: "Konstantin" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, September 09, 2001 7:35 PM
Subject: upload file


Hi.

I'm trying to upload file with the next code:

#!/usr/bin/perl
use DBI;
use CGI qw/:standard/;
no strict;
use constant MAX_FILE_SIZE => 1_048_576;
use constant BUFFER_SIZE => 16_384;
my $buffer = "";

my $cgi=new CGI;

my $filename=$cgi->param('picture') || die ("No file name received.");
my $file=$cgi->upload('picture') || die ("No file received.");
$filename =~ s/^.*[\\|\/]//g;
$filename=~s/://g;

open(OUTPUT,">d:/pics/".$filename) || die ("Can not open output file");

binmode OUTPUT;
binmode INPUT;
my ($buffer,$bytesread);

while($bytesread=read($file,$buffer,1024) ){
print OUTFILE $buffer;
 }

close INPUT;
close OUTFILE;

I get error message "No file received." so the execution of line
my $file=$cgi->upload('picture')
fails. Can anybody please help?

Thanks  in advance.



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Urgent !!! installing Storable.pm

2001-09-06 Thread Rajeev Rumale

Hi,

I need to install and use the Storable.pm in my machine.  I am useing Active Perl on 
Win2k machine.

I have not done this before.  Its urgent, kindly let me know the procedure for same.

rajeev



Script compliation Sequence.

2001-09-06 Thread Rajeev Rumale

Hello EveryBody

I needed some advice for all.

I am working on a untilty which needs to perform server functions.

I am bit confused with compliation sequency of scripts, when we use "do",
"require" or "use" to include into our scripts.

I have written a library  file which contains all the common routines, and
include this in evey other script i write.

This file is very very long running around 3000 lines.  But most of the
scripts use around 10% of the libraray routines only.

As per my understanding when ever any script is invoked it will complie both
the script and the included files.  This is done each time the script is
invoke.

I would like to know if I can group this subroutines into different files
and include only the relevant routines an and when required depending upon
coditions at runtime.

This will keep the files size to be less and will also avoid unnecessary
compilation time.

with regards

Rajeev Rumale







That means I



Since not every sub routine is required




-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Extened - Re: securing sensitive information in CGI scripts

2001-09-05 Thread Rajeev Rumale

>
> Why do you need to store them there?  If you can answer that for us, we
can give you much better
> advice on how to secure it.


Good point I should have included in the question itself.

Well many time we don't get acess to directries outside the website root.
Expecially in case of shared servers.

Regards

Rajeev


- Original Message -
From: "Curtis Poe" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, September 05, 2001 11:53 PM
Subject: Re: Extened - Re: securing sensitive information in CGI scripts


> --- Rajeev Rumale <[EMAIL PROTECTED]> wrote:
> > I need to store some uploaded files from the "visitors" into some
> > directories which are inside website root.
>
> Rajeev,
>
> Why do you need to store them there?  If you can answer that for us, we
can give you much better
> advice on how to secure it.
>
> Cheers,
> Curtis "Ovid" Poe
>
> =
> Senior Programmer
> Onsite! Technology (http://www.onsitetech.com/)
> "Ovid" on http://www.perlmonks.org/
>
> __
> Do You Yahoo!?
> Get email alerts & NEW webcam video instant messaging with Yahoo!
Messenger
> http://im.yahoo.com
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Extened - Re: securing sensitive information in CGI scripts

2001-09-04 Thread Rajeev Rumale

Greetings to all,

This is really a good thread we have.

How ever as the title is not restricting to database security. I would like
to add my concern to it.

I need to store some uploaded files from the "visitors" into some
directories which are inside website root.

Since the files submited are confidential info We need to protect it from
people directly accessing the files depending upon the ownership rights (the
actual owner, site admin, site operator,  other authorised user).

Any suggestions for same .

Thanking in advance.

Rajeev Rumale




-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Http Session - cookie Problem

2001-08-28 Thread Rajeev Rumale

Greetings every body,

I have am working on a web based application which requires authenticaion.
I am using some especial cookies to reference the session values which are
maintained sepeartely.  The the cookie values are set to some expriey time.
This works fine, therotical as well as practically.

But since the cookie is not passed on to the server even if the brower is
close and a new session is started.  This causes a data mix-up.  Can I
somehow make the cookie expire if the browser instance is shut down.

with regards

Rajeev Rumale

~~~
Rajeev RumalePhone : (65)
8831530 (office)
MyAngel.Net Pte Ltd., Fax  : (65) 338
9710
17 Hong Kong Street,  Email :
[EMAIL PROTECTED]
#01-01,   ICQ   :
121001541
Singapore 059660   Website :
ww.myangel.net
~~~



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: getting the calling function name.

2001-08-06 Thread Rajeev Rumale

Thanks  Dwalu,

But the what i need is the grep the name of the sub which is calling the
loging sub.
As you have suggested "caller" only gives only the name of current sub
routine that is &debugLogger it self.
And I had to do call the "caller" before calling the "debugLogger" and pass
all the info to it.

What i need is the the name of the sub rotuine which is "calling" the sub
"&debuLogger".

Consider the following subs


sub someSub{
statement 1;
statement 2;
statement 3;
&debugLogger($message);
&anotherSub;
}

sub anotherSub{
statement 1;
statement 2;
statement 3;
&debugLogger($message);
}


sub debugLogger {

my $message = "@_";

 $sub_name = ""; #  Get the subroutine name.This is what i need to grep.

open (LOGGER, ">> my.log") || die " unable to ope the log file";
print LOGGER "\n";
print LOGGER "\nCalled from $sub_name.";
print LOGGER "\n$message";
print LOGGER "\n";
close LOGGER;

}



So if the sub "someSub" is called
The information I expect in the file is .


called from someSub
Here is the message.
----

----
called from anotherSub
Here is the message.



with regards

Rajeev Rumale


-
Artificial Intelligence is no match for Natural Stupidity.
--------
-


- Original Message -
From: "Dwalu Z. Khasu" <[EMAIL PROTECTED]>
To: "Rajeev Rumale" <[EMAIL PROTECTED]>
Cc: "Beginners-Cgi (E-mail)" <[EMAIL PROTECTED]>
Sent: Monday, August 06, 2001 3:47 PM
Subject: Re: getting the calling function name.


> See perldoc -f caller
>
>
> On Mon, 6 Aug 2001, Rajeev Rumale wrote:
>
> =>Hello Every Body,
> =>
> =>I need some help.
> =>I am using a sub routine to log all the messages to be used for
debugging
> =>purpose.
> =>ie. &debugLogger($debug_message);
> =>Since very similare kind of messages are genrated at serveral places, I
add
> =>the function name.
> =>i.e., &debugLogger("inside xxxxx  \n $debug_message");
> =>
> =>I feel it would be better as a prgramming style if sub debugLog is able
to
> =>find the name of the "calling function" or the name of the function
> =>"calling" this sub and genrate the appropriate message.
> =>
> =>
> =>with regards
> =>
> =>
> =>Rajeev Rumale
> =>
> =>
> =>***
> => "The human race has one really effective weapon, and that is
laughter."
> =>***
> =>
> =>
> =>
> =>--
> =>To unsubscribe, e-mail: [EMAIL PROTECTED]
> =>For additional commands, e-mail: [EMAIL PROTECTED]
> =>
> =>
>
>


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




getting the calling function name.

2001-08-06 Thread Rajeev Rumale

Hello Every Body,

I need some help.
I am using a sub routine to log all the messages to be used for debugging
purpose.
ie. &debugLogger($debug_message);
Since very similare kind of messages are genrated at serveral places, I add
the function name.
i.e., &debugLogger("inside x  \n $debug_message");

I feel it would be better as a prgramming style if sub debugLog is able to
find the name of the "calling function" or the name of the function
"calling" this sub and genrate the appropriate message.


with regards


Rajeev Rumale


***
 "The human race has one really effective weapon, and that is laughter."
***



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: CGI : Netscape and IE difference.

2001-08-05 Thread Rajeev Rumale

Thank You very much for the reply.
So does it mean that using cgi-->params is better than doing &readParse?

regards

Rajeev

***
"The human race has one really effective weapon, and that is laughter."
***




- Original Message -
From: "fliptop" <[EMAIL PROTECTED]>
To: "Rajeev Rumale" <[EMAIL PROTECTED]>
Cc: "Beginners-Cgi (E-mail)" <[EMAIL PROTECTED]>
Sent: Friday, August 03, 2001 8:04 PM
Subject: Re: CGI : Netscape and IE difference.


> [reply posted only to beginners-cgi]
>
> Rajeev Rumale wrote:
> >
> > If we use IE we get all the values appended to gether into a singel
field
> > name.
> > But when the same form is submitted from netscape(4.0).  it give only
the
> > first field value.  I wonder what happends to the others.
> >
> > I am attaching both the html form and perl script.
>
> ?  i only saw the perl, no html was attached.  the following works, no
> matter what browser submitted it:
> (i assumed your checkbox 's are named 'foo')
>
>
> use CGI;
> my $cgi = new CGI;
> print $cgi->header();
>
> my @values = $cgi->param('foo');
>
> unless (@values) {
>   print "no values were submitted.";
> }
> elsif (scalar(@values) == 1) {
>   print "there's one parameter named 'foo', its value is $values[0]";
> }
> else {
>   print "there's ", scalar(@values), " parameters named 'foo'.",
> "their values are:";
>
>   foreach (@values) {
> print "$_";
>   }
> }
>


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Sub String extraction

2001-08-02 Thread Rajeev Rumale

Thanks Flip,

Actually I got the thing write by putting "?" operator. The pattern I am
looking for now is

  $title = (   $lines =~s/(.{0,}?)<\/product>/ ) ? $1 : 'No Title';


I will look into the package you have mentioned.  I am sure every one on the
list will be benifited by the info.

regards

Rajeev Rumale


-
Before you spend, earn: Before you speak, listen, before you write, think
before you criticize, wait, before you pray, Forgive, before you die, Give.

-

- Original Message -
From: "fliptop" <[EMAIL PROTECTED]>
To: "Rajeev Rumale" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Wednesday, August 01, 2001 6:38 PM
Subject: Re: Sub String extraction


> Rajeev Rumale wrote:
> >
> > Hello everybody,
> >
> > I need some help I am working on a searching and extarction secipt,
where i
> > need to extract information from HTML and XML files.
>
> look at html::parser:
>
> http://search.cpan.org/search?dist=HTML-Parser
>


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Sub String extraction

2001-08-01 Thread Rajeev Rumale

Hello everybody,

I need some help I am working on a searching and extarction secipt, where i
need to extract information from HTML and XML files.

Its simple I need to find some know tags and gett the information enclosed
between them. I faced with a problem when there are multiple ocurances of
same tags.

I am only getting the last occurance of the pattern and not all.
for example if the lines in the files are

Product 1
Product 2
Product 3
Product 4

What i am getting is only the last match.

Kindly let me know how I can get the first match.

if done I can then do a loop to extract the other ocurances.

The code I am useing is as follows.

open(FILE,"test.html");
while ($line=)
 {$lines.=$line;}
close FILE;

# remove new line, tab characters form the text of the file
$lines=~s/[\n\r\|]/ /g;

# get the title...
  $title = (   $lines =~s/(.{0,100})<\/product>/
) ? $1 : 'No Title';

print $title;



I am working on Active Perl on Win2K machine.

thanks  in advance

Rajeev Rumale


**
"The human race has one really effective weapon, and that is laughter."

**



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Regrex - ignoring the boundaries

2001-07-11 Thread Rajeev Rumale

Sorry ! some how did not get both the attachments. send as zip again.

regards

Rajeev Rumale

___

 Yesterday is history.  Tomorrow a mystery.
 Today is a gift. That's why it's called Present.
___





- Original Message -----
From: "Rajeev Rumale" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Thursday, July 12, 2001 9:58 AM
Subject: Regrex - ignoring the boundaries


> Greetings !
>
> I am having a some difficulaties in matching and extracting a part of
> strings.
>
> I need to load a HTML file into a scalar variable and then extract certain
> part of the it which is "marked" ( ie., %%row_start%%%  and %%row_end%% ).
>
> The problems is with the "\n" at end of each line in the html file. If
there
> is a newline immediately after the "mark" the Regrex fails to work
properly.
>
> If I remove all the "\n" from the loaded value then I am able to get the
> result well. But this will cause the HTML code to be unformated and will
> creat problems for webdesingers while debuggin html code.
>
> Can we do this without removing "\n" char?
>
> I am attaching both perl code and html file.  Please check out and let me
> know where I am wrong.
>
> with regards
>
> Rajeev Rumale
>
>
>
>
>

 patterns.zip


Regrex - ignoring the boundaries

2001-07-11 Thread Rajeev Rumale

Greetings !

I am having a some difficulaties in matching and extracting a part of
strings.

I need to load a HTML file into a scalar variable and then extract certain
part of the it which is "marked" ( ie., %%row_start%%%  and %%row_end%% ).

The problems is with the "\n" at end of each line in the html file. If there
is a newline immediately after the "mark" the Regrex fails to work properly.

If I remove all the "\n" from the loaded value then I am able to get the
result well. But this will cause the HTML code to be unformated and will
creat problems for webdesingers while debuggin html code.

Can we do this without removing "\n" char?

I am attaching both perl code and html file.  Please check out and let me
know where I am wrong.

with regards

Rajeev Rumale





 patterns.pl


Re: newbie question

2001-07-06 Thread Rajeev Rumale

Sorry I forgot mention the same.
But you gussed it write,  I am using IIS on win2k wiht MYSQL as database.
ofcourse with  Active Perl.

regards

Rajeev Rumale


- Original Message -
From: "fliptop" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Friday, July 06, 2001 7:23 PM
Subject: Re: newbie question


> Aaron Craig wrote:
> >
> > You should always include the code that is giving you the problem when
you
> > ask a question.  It makes it a lot easier for us to help you.  Could you
> > send your code?
>
> also include what platform (i'm guessing windows) and webserver you are
> using.
>




Re: newbie question

2001-07-06 Thread Rajeev Rumale

yes that will also keep you away for the various assumptions very one would
be makeing, and you get a correct answer early.

with regards

Rajeev Rumale

~~~
Rajeev Rumale
MyAngel.Net Pte Ltd.,Phone  :
(65)8831530 (office)
#04-01, 180 B, The Bencoolen,   Email  :
[EMAIL PROTECTED]
Bencoolen Street, Singapore - 189648 ICQ: 121001541
Website : www.myangel.net
~~~


- Original Message -
From: "Aaron Craig" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, July 06, 2001 6:40 PM
Subject: Re: newbie question


> You should always include the code that is giving you the problem when you
> ask a question.  It makes it a lot easier for us to help you.  Could you
> send your code?
>
> At 02:24 06.07.2001 -0700, nila devaraj wrote:
> >Hi
> >i have a webserver that has been configured for CGI
> >scripting. i placed the  HTML file in the required
> >directory and the cgi program in the wincgi directory
> >of the webserver. The problem i am facing is- if i
> >submit my form i am getting the download/save dialog
> >box.If i say open it is opening a word document
> >containg the codes in the program i am new to CGi
> >programming and i am unable to figure out the problem.
> >it would be appreciated if i get some input in this
> >regard...
> >
> >regards
> >Nila
> >
> >
> >
> >__
> >Do You Yahoo!?
> >Get personalized email addresses from Yahoo! Mail
> >http://personal.mail.yahoo.com/
>
> Aaron Craig
> Programming
> iSoftitler.com
>
>




SQL - Multiple Updates ?

2001-07-05 Thread Rajeev Rumale

Greetings !.

I have some problem with executing a SQL  update statement while updating
multiple records at a time.

I have tried different ways but it is udating one a single (first) record.
The same sql statement works perfectly when run directly on the MY SQL
prompt.

The code i have used are

1.
@del_list = split(",", $in{del_industry});
foreach $id (@del_list) {
 $id= "(industry_id='$id')";
}
$where = join(" or ", @del_list);
$sql ="update industry_list set deleted='y' where ($where)";
$dbh = DBI->connect($site{dsn});
&displayError("Unable to delete the option. $sql")
unless($dbh->do($sql));

# The contents of $sql are "update industry_list set deleted='y' where
((industry_id='001') or (industry_id='002') or (industry_id='003') or
(industry_id='004') or (industry_id='005'))"


2.
$dbh = DBI->connect($site{dsn});
$sql .="update industry_list set deleted='y' where industry_id = ?";
my $sth = $dbh->prepare($sql);
@del_list = split(",", $in{del_industry});
foreach $del_id (@del_list){
$content .= "trying to deleted $del_id";
$sth->execute($del_id);
}


with regards


Rajeev Rumale
___

Yesterday is history.  Tomorrow a mystery. 
Today is a gift. That's why it's called Present.
___








SQL - Multiple Updates ?

2001-07-05 Thread Rajeev Rumale

Greetings !.

I have some problem with executing a SQL  update statement while updating
multiple records at a time.

I have tried different ways but it is udating one a single (first) record.
The same sql statement works perfectly when run directly on the MY SQL
prompt.

The code i have used are

1.
@del_list = split(",", $in{del_industry});
foreach $id (@del_list) {
 $id= "(industry_id='$id')";
}
$where = join(" or ", @del_list);
$sql ="update industry_list set deleted='y' where ($where)";
$dbh = DBI->connect($site{dsn});
&displayError("Unable to delete the option. $sql")
unless($dbh->do($sql));

# The contents of $sql are "update industry_list set deleted='y' where
((industry_id='001') or (industry_id='002') or (industry_id='003') or
(industry_id='004') or (industry_id='005'))"


2.
$dbh = DBI->connect($site{dsn});
$sql .="update industry_list set deleted='y' where industry_id = ?";
my $sth = $dbh->prepare($sql);
@del_list = split(",", $in{del_industry});
foreach $del_id (@del_list){
$content .= "trying to deleted $del_id";
$sth->execute($del_id);
}


with regards


Rajeev Rumale
___

Yesterday is history.  Tomorrow a mystery. 
Today is a gift. That's why it's called Present.
___






Again : Including other files

2001-06-27 Thread Rajeev Rumale

Hi,

I have a similar situation in my project.  I have created a file like
mylib.pl and I put all my subroutines into it.

In every page which I use i just add a line "require  mylib.pl"  IT works
fine for me.

I would like to know
1. if this approch is Good
2. Is their any performance problem compared to writing the subs directly in
"main".
3. Is there any better approch.

with regards

Rajeev Rumale

~~~~~~~
Rajeev Rumale
MyAngel.Net Pte Ltd.,Phone  :
(65)8831530 (office)
#04-01, 180 B, The Bencoolen,   Email  :
[EMAIL PROTECTED]
Bencoolen Street, Singapore - 189648 ICQ: 121001541
Website : www.myangel.net
~~~







Re: Including other files

2001-06-27 Thread Rajeev Rumale

Hi,

I have a similar situation in my project.  I have created a file like
mylib.pl and I put all my subroutines into it.

In every page which I use i just add a line "require  mylib.pl"  IT works
fine for me.

I would like to know
1. if this approch is Good
2. Is their any performance problem compared to writing the subs directly in
"main".
3. Is there any better approch.

with regards

Rajeev Rumale

~~~~~~~
Rajeev Rumale
MyAngel.Net Pte Ltd.,Phone  :
(65)8831530 (office)
#04-01, 180 B, The Bencoolen,   Email  :
[EMAIL PROTECTED]
Bencoolen Street, Singapore - 189648 ICQ: 121001541
Website : www.myangel.net
~~~


- Original Message -
From: "Mark Bergeron" <[EMAIL PROTECTED]>
To: "James Kelty" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Thursday, June 28, 2001 8:01 AM
Subject: Re: Including other files


> Yes you can.
>
> -Original Message-
> From: "James Kelty"<[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED]
> Date: Wed Jun 27 15:18:23 PDT 2001
> Subject: Including other files
>
> >Can you include say a header and footer .cgi file that is just a
> >subroutine? The reason I ask, is that it seems to me that it might make
> >things (on a larger application) easier if all you had to do was mess
> >with the middle content of the pages.  Does this make sense at all?
> >
> >-James
>
> /~_. _ | _ _  _  _
> \_/|(_||| | |(_)| |
>  _|
> ___
> GO.com Mail
> Get Your Free, Private E-mail at http://mail.go.com
>
>
>




Pooling of objects and session data

2001-06-21 Thread Rajeev Rumale

Hi,

I need to know if there is any easiest way to keep session data or object
accross the scripts.

Basically I would like to pool Database connections so that Parrallel
running scripts don't open multiple connection with the database.

with regards

Rajeev Rumale
- Original Message -
From: "Dave Young" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Thursday, June 21, 2001 8:04 AM
Subject: Re: Please remove


> D.J.B. is quite the character..  ;)
>
>
> > I also have tried removal but I get this great little insulting remark
that
> > could only have been produced by a 'secret loyal order of Unix
programmers'
> > bit bombardier!
> >
> > Hi. This is the qmail-send program at onion.perl.org.
> > I'm afraid I wasn't able to deliver your message to the following
> > addresses. This is a permanent error; I've given up. Sorry it didn't
work
> > out.
> >
> >
>