[16309] in Perl-Users-Digest
Perl-Users Digest, Issue: 3721 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Jul 18 10:28:04 2000
Date: Tue, 18 Jul 2000 07:27:54 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <963930474-v9-i3721@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Tue, 18 Jul 2000 Volume: 9 Number: 3721
Today's topics:
Newbie: iterated reading from file (Tony Balazs)
Re: Newbie: iterated reading from file (Bernard El-Hagin)
Re: Newbie: iterated reading from file (Tony Balazs)
Re: Newbie: iterated reading from file (Bernard El-Hagin)
Re: Newbie: iterated reading from file (Tony Balazs)
no newlines and ANDING <richard.salute@redhotant.com>
Re: no newlines and ANDING <foo@bar.va>
nslookup in Perl (Lucas Tsoi)
Re: nslookup in Perl (Tony Curtis)
NT4 can't create file in cgi-bin ()
Re: NT4 can't create file in cgi-bin (jason)
Object somehow becoming unblessed? (Steve Leibel)
Re: Object somehow becoming unblessed? (Gary E. Ansok)
Re: Object somehow becoming unblessed? (Steve Leibel)
open and show immediatly on the web an html page (arthur)
Opinions wanted on an idea for a new module - CGISessio (Nico Zigouras)
Re: Opinions wanted on an idea for a new module - CGISe (Randal L. Schwartz)
Re: Opinions wanted on an idea for a new module - CGISe (Nico Zigouras)
Re: Out of Memory (file limit) (James McCallum)
Re: Out of Memory - more info (James McCallum)
Out of Memory (James McCallum)
Re: Out of Memory ()
Re: Out of Memory (Michael Carman)
padding strings with zero's ()
Re: padding strings with zero's (Ala Qumsieh)
Re: padding strings with zero's (Bart Lateur)
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 17 Jul 2000 10:20:02 GMT
From: tbalazs-this-must-go@netcomuk.co.uk.bbs@openbazaar.net (Tony Balazs)
Subject: Newbie: iterated reading from file
Message-Id: <3bR8V3$WPc@openbazaar.net>
I am having some difficulty writing a Perl program to produce some
output from a data file.
My data file, update.dat, currently looks like:
(100, Analyst, $40K, Permanent);
(200, Programmer, $50K, Contract);
I was naively hoping that the following:
---------------
#!/usr/bin/perl
use strict;
open(UPDATE, "update.dat") || die "$!";
while (my @qq = <UPDATE>){
my $ww = $qq[0];
print $ww;
}
close(UPDATE) || die "$!;
-----------------
would produce:
100
200
as the output.
Instead, I'm getting:
(100, Analyst, $40K, Permanent);
as the output.
What I actually want to achieve is this, to turn:
(100, Analyst, $40K, Permanent); # or 100,Analyst,$40K,Permanent
(200, Programmer, $50K, Contract); # ditto
into
text1 100 text2 Analyst text3 $40K text4 Permanent
text1 200 text2 Programmer text3 $50K text4 Contract
As before, any help would be much appreciated.
Tony.
------------------------------
Date: 17 Jul 2000 10:40:02 GMT
From: bernard.el-hagin@lido-tech.net.bbs@openbazaar.net (Bernard El-Hagin)
Subject: Re: Newbie: iterated reading from file
Message-Id: <3bR983$VOG@openbazaar.net>
Tony Balazs <tbalazs-this-must-go@netcomuk.co.uk> wrote:
>I am having some difficulty writing a Perl program to produce some
>output from a data file.
>
>My data file, update.dat, currently looks like:
>
>(100, Analyst, $40K, Permanent);
>(200, Programmer, $50K, Contract);
>
>I was naively hoping that the following:
>---------------
>#!/usr/bin/perl
>use strict;
>
>open(UPDATE, "update.dat") || die "$!";
>while (my @qq = <UPDATE>){
> my $ww = $qq[0];
> print $ww;
>}
>close(UPDATE) || die "$!;
>-----------------
>would produce:
>100
>200
>as the output.
>
>Instead, I'm getting:
>(100, Analyst, $40K, Permanent);
>as the output.
This bit...
my @qq = <UPDATE>;
...puts the input file into array @qq line-by-line. How is Perl supposed
to know that you want to split the data in a different way?
>What I actually want to achieve is this, to turn:
>
>(100, Analyst, $40K, Permanent); # or 100,Analyst,$40K,Permanent
>(200, Programmer, $50K, Contract); # ditto
>
>into
>
>text1 100 text2 Analyst text3 $40K text4 Permanent
>text1 200 text2 Programmer text3 $50K text4 Contract
Here's one way which assumes that there are no commas in the data
itself:
__________________
#!/usr/bin/perl -w
use strict;
my $i = 1;
while (my $data = <DATA>){
chomp ($data);
$data =~ s/^\((.*)\);/$1/g;
my @data = split /,/, $data;
foreach (@data)
{
print "text" . $i++ . " $_ ";
}
print "\n";
$i = 1;
}
__DATA__
(100, Analyst, $40K, Permanent);
(200, Programmer, $50K, Contract);
__________________
Bernard
--
perl -e'@x=(3,2,4,1,3,2,1,3,1,3,2,3,3,2,3,0,0,1,2,1,1,1,4,1,2,1,1,2,2,1,
2,1,2,1,2,1,2,1,1,1,2,1,0,0,3,2,3,2,3,2,1,1,1,1,1,2,4,2,3,2,1,2,1,0,0,1,
2,1,1,1,4,1,2,1,1,1,2,2,1,1,4,1,1,1,2,1,1,1,2,1,0,0,3,2,4,1,1,2,1,1,1,3,
1,1,1,4,1,1,1,2,1,1,3,0,0);sub x{print q x$xx$_;print q x x x shift@x};#
while(defined($_=shift @x)){s o0o\no;$_!=0?x:print}' #Symmetry yrtemmyS#
------------------------------
Date: 17 Jul 2000 12:50:04 GMT
From: tbalazs-this-must-go@netcomuk.co.uk.bbs@openbazaar.net (Tony Balazs)
Subject: Re: Newbie: iterated reading from file
Message-Id: <3bRCQS$UHm@openbazaar.net>
<snip>
What I actually want to achieve is this, to turn:
>>
>>(100, Analyst, $40K, Permanent); # or 100,Analyst,$40K,Permanent
>>(200, Programmer, $50K, Contract); # ditto
>>
>>into
>>
>>text1 100 text2 Analyst text3 $40K text4 Permanent
>>text1 200 text2 Programmer text3 $50K text4 Contract
>
>Here's one way which assumes that there are no commas in the data
>itself:
<snip>
Bernard,
with the the following adaptation of your code:
#!/usr/bin/perl -w
use strict;
open(UPDATE, "update.dat");
my $i = 1;
while (my $data = <UPDATE>){
chomp ($data);
$data =~ s/^\((.*)\);/$1/g;
my @data = split /,/, $data;
foreach (@data)
{
print "text" . $i++ . " $_ ";
}
print "\n";
$i = 1;
}
close(UPDATE);
I'm getting the following error message:
global symbol "@data" requires explicit package name at filename.pl
line 8.
Would it be better to have the data file as:
100
Analyst
$40K
Permanent
200
Programmer
$50K
Contract
etc and have $1 = line1, $2 = line2 etc.
Tony.
------------------------------
Date: 17 Jul 2000 13:10:01 GMT
From: bernard.el-hagin@lido-tech.net.bbs@openbazaar.net (Bernard El-Hagin)
Subject: Re: Newbie: iterated reading from file
Message-Id: <3bRD3P$TXe@openbazaar.net>
Tony Balazs <tbalazs-this-must-go@netcomuk.co.uk> wrote:
><snip>
>What I actually want to achieve is this, to turn:
>>>
>>>(100, Analyst, $40K, Permanent); # or 100,Analyst,$40K,Permanent
>>>(200, Programmer, $50K, Contract); # ditto
>>>
>>>into
>>>
>>>text1 100 text2 Analyst text3 $40K text4 Permanent
>>>text1 200 text2 Programmer text3 $50K text4 Contract
>>
>>Here's one way which assumes that there are no commas in the data
>>itself:
>
><snip>
>
>Bernard,
>with the the following adaptation of your code:
>
>#!/usr/bin/perl -w
>use strict;
>
>open(UPDATE, "update.dat");
>
>my $i = 1;
>
>while (my $data = <UPDATE>){
> chomp ($data);
> $data =~ s/^\((.*)\);/$1/g;
> my @data = split /,/, $data;
> foreach (@data)
> {
> print "text" . $i++ . " $_ ";
> }
> print "\n";
> $i = 1;
>}
>close(UPDATE);
>
>I'm getting the following error message:
>global symbol "@data" requires explicit package name at filename.pl
>line 8.
Are you sure the code producing the error is *exactly* the code you quote
above? I just copied and pasted it and it works. That error would pop up
if there was no "my" before @data, but there is. Something else wrong
with my script, though, I forgot to take care of those comments in your
data. You need to add this line...
$data =~ s/#.*$//;
...right after the chomp.
Bernard
--
perl -e'@x=(3,2,4,1,3,2,1,3,1,3,2,3,3,2,3,0,0,1,2,1,1,1,4,1,2,1,1,2,2,1,
2,1,2,1,2,1,2,1,1,1,2,1,0,0,3,2,3,2,3,2,1,1,1,1,1,2,4,2,3,2,1,2,1,0,0,1,
2,1,1,1,4,1,2,1,1,1,2,2,1,1,4,1,1,1,2,1,1,1,2,1,0,0,3,2,4,1,1,2,1,1,1,3,
1,1,1,4,1,1,1,2,1,1,3,0,0);sub x{print q x$xx$_;print q x x x shift@x};#
while(defined($_=shift @x)){s o0o\no;$_!=0?x:print}' #Symmetry yrtemmyS#
------------------------------
Date: 17 Jul 2000 16:00:02 GMT
From: tbalazs-this-must-go@netcomuk.co.uk.bbs@openbazaar.net (Tony Balazs)
Subject: Re: Newbie: iterated reading from file
Message-Id: <3bRHO5$UGG@openbazaar.net>
>>#!/usr/bin/perl -w
>>use strict;
>>
>>open(UPDATE, "update.dat");
>>
>>my $i = 1;
>>
>>while (my $data = <UPDATE>){
>> chomp ($data);
>> $data =~ s/^\((.*)\);/$1/g;
>> my @data = split /,/, $data;
>> foreach (@data)
>> {
>> print "text" . $i++ . " $_ ";
>> }
>> print "\n";
>> $i = 1;
>>}
>>close(UPDATE);
>>
>>I'm getting the following error message:
>>global symbol "@data" requires explicit package name at filename.pl
>>line 8.
>
>Are you sure the code producing the error is *exactly* the code you quote
>above? I just copied and pasted it and it works. That error would pop up
>if there was no "my" before @data, but there is. Something else wrong
>with my script, though, I forgot to take care of those comments in your
>data. You need to add this line...
>
>$data =~ s/#.*$//;
>
>...right after the chomp.
>
>Bernard
<snip>
Whoops! My mistake.
Tony.
------------------------------
Date: Tue, 18 Jul 2000 11:30:23 +0100
From: "Slippery" <richard.salute@redhotant.com>
Subject: no newlines and ANDING
Message-Id: <397432d5@news.jakinternet.co.uk>
YES - I am new at this! (but I like it!)
I am outputting a page eg print "this is a test\n"; but I am not getting any
newlines. It all appears as one huge line......Please help?
Also, can we use bitwise operators. in VB6, I would use if (res AND 1)=1
then..... How would I do it in perl.
Kind Regards
Richard Salvage
------------------------------
Date: Tue, 18 Jul 2000 13:38:14 +0200
From: Marco Natoni <foo@bar.va>
Subject: Re: no newlines and ANDING
Message-Id: <397441A6.E0388575@bar.va>
Richard,
Slippery wrote:
> I am outputting a page eg print "this is a test\n"; but I am
> not getting any newlines. It all appears as one huge
> line......Please help?
If you say "page" it is very likely that you are talking about an HTML
page made by a CGI application, isn't it? If so, you certainly know
that the HTML new line is the '<br>' tag and not the '\n' escape
sequence...
Best regards,
Marco
------------------------------
Date: 18 Jul 2000 03:10:02 GMT
From: lucas@cplhk.com.bbs@openbazaar.net (Lucas Tsoi)
Subject: nslookup in Perl
Message-Id: <3bRYjP$VWU@openbazaar.net>
Hi
In Perl, is there any function or module do the same matter liked Unix's
"nslookup"
and return the informayion?
Thanks for any helps!!
------------------------------
Date: 18 Jul 2000 03:40:03 GMT
From: tony_curtis32@yahoo.com.bbs@openbazaar.net (Tony Curtis)
Subject: Re: nslookup in Perl
Message-Id: <3bRZZ3$WDd@openbazaar.net>
>> On Tue, 18 Jul 2000 11:08:54 +0800,
>> "Lucas Tsoi" <lucas@cplhk.com> said:
> Hi In Perl, is there any function or module do the same
> matter liked Unix's "nslookup" and return the
> informayion?
http://search.cpan.org/ and look for "Net::DNS".
hth
t
--
"With $10,000, we'd be millionaires!"
Homer Simpson
------------------------------
Date: 17 Jul 2000 19:30:06 GMT
From: hacktic@my-deja.com.bbs@openbazaar.net ()
Subject: NT4 can't create file in cgi-bin
Message-Id: <3bRMkY$VSL@openbazaar.net>
Hi all,
On a NT4 server where I only have FTP access, I tried to create a file
in the cgi-bin with a Perl script, but it returns the msg that it can't
make the file.
#!perl
open(FP, ">test.txt")||print("Can't make file.");
print FP ("this is a test");
close(FP);
print "Hello world!";
I thought it might be some restriction set on the scripts directory by
the IIS. So I thought to write the text file in the root directory or a
parent directory with one of the following.
open(FP, ">\\test.txt")||print("Can't open file.");
open(FP, ">..\\test.txt")||print("Can't open file.");
I had no success. Any idea what I'm doing wrong? Or is de server set
not to read/write to HD with scripts (if this is possible)? Maybe it's
some NTFS thing? On my own NT4 it works fine, but I'm using FAT.
Hope that somebody can help me ... first time I develop on NT and need
to demostrate to a client very soon.
Regards;
-Mark-
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: 17 Jul 2000 22:10:02 GMT
From: elephant@squirrelgroup.com.bbs@openbazaar.net (jason)
Subject: Re: NT4 can't create file in cgi-bin
Message-Id: <3bRR6S$U1s@openbazaar.net>
hacktic@my-deja.com wrote ..
>On a NT4 server where I only have FTP access, I tried to create a file
>in the cgi-bin with a Perl script, but it returns the msg that it can't
>make the file.
>
>#!perl
>open(FP, ">test.txt")||print("Can't make file.");
>print FP ("this is a test");
>close(FP);
>print "Hello world!";
>
>I thought it might be some restriction set on the scripts directory by
>the IIS. So I thought to write the text file in the root directory or a
>parent directory with one of the following.
>
>open(FP, ">\\test.txt")||print("Can't open file.");
>open(FP, ">..\\test.txt")||print("Can't open file.");
you should be including $! somewhere in your error output .. this will
tell you why you're unable to open these files (my guess is NT
permissions on those directories .. but Perl will tell you)
--
jason -- elephant@squirrelgroup.com --
------------------------------
Date: 17 Jul 2000 22:10:02 GMT
From: stevel@coastside.net.bbs@openbazaar.net (Steve Leibel)
Subject: Object somehow becoming unblessed?
Message-Id: <3bRR6R$Tzt@openbazaar.net>
Hello,
I have a mysterious bug I'm working on. I have an object that gets stored
and retrieved from some other data structures. After the retrieval the
object has the same address, but ref() returns 0. That is, if $X and $Y
are the before and after values of my object,
($X eq $Y) evaluates as true; and when I print it, they are objects in the
same class with the same address; and
ref($X) evaluates to the name of the class; but
ref($X) prints as an empty string.
I'm attempting to isolate this bug in a short code fragment. Meanwhile,
what kinds of things should I look for that cause an object to retain its
class=address format, but lose its status as an object? I'm running
5.005_03 on i386-freebsd.
Thanks much,
Steve L
stevel@bluetuna.com
------------------------------
Date: 17 Jul 2000 23:10:02 GMT
From: ansok@alumni.caltech.edu.bbs@openbazaar.net (Gary E. Ansok)
Subject: Re: Object somehow becoming unblessed?
Message-Id: <3bRSXT$UmS@openbazaar.net>
In article <stevel-1707001518070001@192.168.100.2>,
Steve Leibel <stevel@coastside.net> wrote:
>I have a mysterious bug I'm working on. I have an object that gets stored
>and retrieved from some other data structures. After the retrieval the
>object has the same address, but ref() returns 0. That is, if $X and $Y
>are the before and after values of my object,
>
>($X eq $Y) evaluates as true; and when I print it, they are objects in the
>same class with the same address; and
>
>ref($X) evaluates to the name of the class; but
>
>ref($X) prints as an empty string.
(I assume you meant $Y here -- GA)
>
>I'm attempting to isolate this bug in a short code fragment. Meanwhile,
>what kinds of things should I look for that cause an object to retain its
>class=address format, but lose its status as an object? I'm running
>5.005_03 on i386-freebsd.
It sounds like your reference has been forced into a string. This can
happen if you use the reference as a hash key, if you write it to disk
and read it back (or use a tied module that does this), or if some
code ever puts the reference in double quotes ("$Y").
My guess would be that one of these is happening somewhere in these
"other data structures" you are using.
--
Gary Ansok
------------------------------
Date: 18 Jul 2000 00:20:01 GMT
From: stevel@coastside.net.bbs@openbazaar.net (Steve Leibel)
Subject: Re: Object somehow becoming unblessed?
Message-Id: <3bRUP1$VSP@openbazaar.net>
In article <8l03t8$k1b@gap.cco.caltech.edu>, ansok@alumni.caltech.edu
(Gary E. Ansok) wrote:
> In article <stevel-1707001518070001@192.168.100.2>,
> Steve Leibel <stevel@coastside.net> wrote:
> >I have a mysterious bug I'm working on. I have an object that gets stored
> >and retrieved from some other data structures. After the retrieval the
> >object has the same address, but ref() returns 0. That is, if $X and $Y
> >are the before and after values of my object,
> >
> >($X eq $Y) evaluates as true; and when I print it, they are objects in the
> >same class with the same address; and
> >
> >ref($X) evaluates to the name of the class; but
> >
> >ref($X) prints as an empty string.
> (I assume you meant $Y here -- GA)
> >
> >I'm attempting to isolate this bug in a short code fragment. Meanwhile,
> >what kinds of things should I look for that cause an object to retain its
> >class=address format, but lose its status as an object? I'm running
> >5.005_03 on i386-freebsd.
>
> It sounds like your reference has been forced into a string. This can
> happen if you use the reference as a hash key, if you write it to disk
> and read it back (or use a tied module that does this), or if some
> code ever puts the reference in double quotes ("$Y").
>
Yes, that's exactly what was going on -- I was using the object as a hash
key in order to keep track of my objects, and later recovering them via
keys(). Well I won't do that again!!
To the Perl Powers that Be: I was running under -w at the time. Can you
add a warning "converting a blessed object to a string"? This bug was
very hard to find, since every time I printed out the value of the object
it looked correct. It wasn't till I looked at its ref() that I realized
the object was losing its object-hood.
Thanks Gary, good call.
Steve L
------------------------------
Date: 11 Jul 2000 17:10:02 GMT
From: star@sonic.net.bbs@openbazaar.net (arthur)
Subject: open and show immediatly on the web an html page
Message-Id: <3bMYFR$WLb@openbazaar.net>
in article slrn8m16p4.bnv.efflandt@efflandt.xnet.com, David Efflandt at
efflandt@xnet.com wrote on 7/3/00 4:56 AM:
> On 2 Jul 2000 21:55:52 -0600, arthur <star@sonic.net> wrote:
> :Good Day,
> :
> :Does anyone know how I can redirect a user to a html page on the web. I want
> :a perl program to open a web page "on the fly" but I do not know how to
> :redirect the user?
> :
> :Thanks,
> :~arthur
> :star@sonic.net
>
> In Perl:
>
> print "Location: http://domain/path/file.html\n\n";
>
> or see redirect in 'perldoc CGI' if using CGI.pm
>
> The secret is not to print any other headers before this one, or at least
> do not terminate them with a blank line or double newline. Note:
> terminate the URL with a trailing slash if not referencing a specific file
> (if just a domain or dir).
I could not get the above suggestion to work so I tried moving the document.
That still did not work. Does any of you Pearl experts out there know why
and would be willing to let me know! I commented out a few attempts that
only led to that dreaded Malformed header error.I can open an html file but
I can not make it open immediatly on the web.
here is the script
--------------------------
#!/usr/bin/perl -w
use CGI qw(:standard);
use IO File;
use strict;
use File::Copy;
print header;
print start_html('A Simple Example'),
h1('A Simple Example'),
'<body bgcolor=green><b>Please....fill in the following form, with
questions and answers.</b>
<p> ',
hr,
start_form,
"What are your questions? ",textfield('question'),
p,
"What are your answers? ",textfield('answer'),
p,
submit,
end_form,
hr;
if (param()) {
print
"Your questions are: ",em(param('question')),
p,
"The answers are: ",em(param('answer')),
p,
#I opened a file here but I want it to open
#a page on the web (on the fly) but I can't
#figure it out-I get that dreaded Malformed header
open (HOPE, ">dot.html") || die print "cant open:";
print (HOPE "<html>\n<head>\n<title>this is the working copy</title>\n<body
bgcolor=black text=WHITE>\n");
print (HOPE (param('$question')));
print (HOPE "\n");
print (HOPE (param('$answer')));
p;
print (HOPE "\n</body>\n</html>");
close HOPE;
#mv (/nfs/httpd/cgi-bin/star/dat.html /home/www_pages/dat.html);
#mv dot.html dat.html;
#move("dat.html" "/home/WWW_pages/star/dot.html") ||
# die ("could not move file: $! ");
hr;
print end_html;
}
------
Thank yoy,
~arthur
star@sonic.net
------------------------------
Date: 17 Jul 2000 06:30:01 GMT
From: zigouras@mail.med.upenn.edu.bbs@openbazaar.net (Nico Zigouras)
Subject: Opinions wanted on an idea for a new module - CGISession.pm.
Message-Id: <3bR2VP$V5n@openbazaar.net>
Hello:
I posted this in clpmodules but did not get many responses. I have
developed a new module that I would like to release on CPAN but I
would like to get some feedback first.
I am currently calling it CGISession.pm, but any suggestions would be
appreciated. Since it is a CGI-related module I may look in to releasing
it under the CGI tree.
So basically what problem it is trying to address is the statelessness of
CGI and HTTP that we have all had to deal with. mod_perl is a good
solution to getting around this, but many CGI programmers may not have
root access to install mod_perl. This is a module for those programmers -
it only relies on modules within the Perl 5 standard distribution.
Basically allows you to save and retrieve data between sessions and allows
for safety checking of expired sessions and invalid sessions. It is used
if you, say, validate a user on a first login page and then want to track
that user securely on subsequent CGI pages. You can add key value pairs
to the session as needed. After an amount of time it will expire and the
user will be sent an error page.
It works be storing a unique, random key in a hidden field and using that
key to access the data on the server. The data is tied to a DB_file for
fast retrieval.
This is how you would use it in the top of every one of your CGI scripts
that needs session management. It can be used in conjunction with CGI.pm
or not.
my $cgi = new CGI();
my $session = new CGISession($cgi->param('session'));
$session->put("name",$cgi->param('name'));
$session->put("id",123456);
$session->save;
# later...
$session->printFieldWithCGI( $cgi );
That is it - all you need in each one of your session scripts. If there
is no current session (i.e. $cgi->param('session') is undef), a new
session and id will be created.
Some of the public methods:
set - takes a key,value pair and sets it into the session
get - returns value from the session for a given key
setDb - takes a hash ref and sets all kv pairs in session to this hr
getDb - gets hashref of kv pairs of session
killSession - kills this session so any subsequent tries will be denied
dump - dumps out key value pairs in ascii or html format
getKeys - gets all keys in session
getValues - gets all values
delete - deletes a kv pair from session
getField - gets the string of the hidden field
printField - prints the string of the hidden field
printFieldFromCGI - prints the hidden field via a CGI object
save - saves the chnages of the session
Comment are appreciated. Thank you.
Sincerely,
Nico Zigouras.
------------------------------
Date: 17 Jul 2000 07:50:02 GMT
From: merlyn@stonehenge.com.bbs@openbazaar.net (Randal L. Schwartz)
Subject: Re: Opinions wanted on an idea for a new module - CGISession.pm.
Message-Id: <3bR4ZQ$Vjl@openbazaar.net>
>>>>> "Nico" == Nico Zigouras <zigouras@mail.med.upenn.edu> writes:
Nico> Hello:
Nico> I posted this in clpmodules but did not get many responses. I have
Nico> developed a new module that I would like to release on CPAN but I
Nico> would like to get some feedback first.
Nico> I am currently calling it CGISession.pm, but any suggestions would be
Nico> appreciated. Since it is a CGI-related module I may look in to releasing
Nico> it under the CGI tree.
And this is different from CGI::Application (just released) exactly how?
I don't mind four ways to do it, but do we really need a fifth? :)
--
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: 17 Jul 2000 08:00:04 GMT
From: zigouras@mail.med.upenn.edu.bbs@openbazaar.net (Nico Zigouras)
Subject: Re: Opinions wanted on an idea for a new module - CGISession.pm.
Message-Id: <3bR503$Tfg@openbazaar.net>
Yeah - more research has shown that there are similar modules out there -
CGI::Persistent to name one. I guess what mine has to offer is expiration
checking and security checking, but I do not think that is neccessary for
a whole other module. Oh well...
On 17 Jul 2000, Randal L. Schwartz wrote:
> Date: 17 Jul 2000 00:53:15 -0700
> From: Randal L. Schwartz <merlyn@stonehenge.com>
> To: Nico Zigouras <zigouras@mail.med.upenn.edu>
> Newsgroups: comp.lang.perl.misc
> Subject: Re: Opinions wanted on an idea for a new module - CGISession.pm.
>
> The following message is a courtesy copy of an article
> that has been posted to comp.lang.perl.misc as well.
>
> >>>>> "Nico" == Nico Zigouras <zigouras@mail.med.upenn.edu> writes:
>
> Nico> Hello:
> Nico> I posted this in clpmodules but did not get many responses. I have
> Nico> developed a new module that I would like to release on CPAN but I
> Nico> would like to get some feedback first.
>
> Nico> I am currently calling it CGISession.pm, but any suggestions would be
> Nico> appreciated. Since it is a CGI-related module I may look in to releasing
> Nico> it under the CGI tree.
>
> And this is different from CGI::Application (just released) exactly how?
>
> I don't mind four ways to do it, but do we really need a fifth? :)
>
> --
> 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: 17 Jul 2000 15:00:01 GMT
From: james.mccallum@bradford.gov.uk.bbs@openbazaar.net (James McCallum)
Subject: Re: Out of Memory (file limit)
Message-Id: <3bRFj2$Vm8@openbazaar.net>
I've now found the limit is coming from a file
I'm feeding into the script as follows.
Its the file /list
open (C,"/list");
while (<C>) {
($name,$address) = split(/,/);
$address =~ s/\n//;
if (!/x400/) {
print REC "3100".("\035"x8)."1"."\035";
}
}
close (C);
Does anyone know what limits the file that I can feed in?
>Hi,
>I'm running a perl script and I'm getting the
>message 'out of memory'
>I've check my ulimit which is currently set
>at 2097151 which should be buckets of
>space for files. Anyone any thoughts??
>James
------------------------------
Date: Tue, 18 Jul 2000 11:47:29 GMT
From: james.mccallum@bradford.gov.uk (James McCallum)
Subject: Re: Out of Memory - more info
Message-Id: <397443b5.14056184@newscore.theplanet.net>
On Mon, 17 Jul 2000 14:31:58 GMT, james.mccallum@bradford.gov.uk
(James McCallum) wrote:
This is what I've written
#!/usr/gnu/bin/perl -w
#
open (C,"/list");
while (<C>) {
print "$_";
}
And the result I get is 'out of memory'
The input file /list has a size of 222960 bytes
These are my limits
# limit
cputime unlimited
filesize 1048575 kbytes
datasize unlimited
stacksize 16384 kbytes
coredumpsize 16384 kbytes
descriptors 64
memoryuse unlimited
Anyone any thoughts
>Hi,
>I'm running a perl script and I'm getting the
>message 'out of memory'
>I've check my ulimit which is currently set
>at 2097151 which should be buckets of
>space for files. Anyone any thoughts??
>James
------------------------------
Date: 17 Jul 2000 14:20:01 GMT
From: james.mccallum@bradford.gov.uk.bbs@openbazaar.net (James McCallum)
Subject: Out of Memory
Message-Id: <3bREh4$V4T@openbazaar.net>
Hi,
I'm running a perl script and I'm getting the
message 'out of memory'
I've check my ulimit which is currently set
at 2097151 which should be buckets of
space for files. Anyone any thoughts??
James
------------------------------
Date: 17 Jul 2000 15:00:01 GMT
From: newsposter@cthulhu.demon.nl.bbs@openbazaar.net ()
Subject: Re: Out of Memory
Message-Id: <3bRFj1$Vi9@openbazaar.net>
James McCallum <james.mccallum@bradford.gov.uk> wrote:
> I'm running a perl script and I'm getting the
> message 'out of memory'
^^^^^^^^^^^^^
> I've check my ulimit which is currently set
> at 2097151 which should be buckets of
> space for files. Anyone any thoughts??
^^^^^
What has the maximum size of files you're allowed to create
got to do with memory usage?
ulimit: sets or reports the file-size writing
limit imposed on files written by the shell and its child
processes (files of any size may be read).
limit: set or get limitations on the sys-
tem resources available to the current shell and its descen-
dents
Check limit instead of ulimit...
Erik
------------------------------
Date: 17 Jul 2000 16:20:02 GMT
From: mjcarman@home.com.bbs@openbazaar.net (Michael Carman)
Subject: Re: Out of Memory
Message-Id: <3bRI13$Vzb@openbazaar.net>
James McCallum wrote:
>
> I'm running a perl script and I'm getting the
> message 'out of memory'
> I've check my ulimit which is currently set
> at 2097151 which should be buckets of
> space for files. Anyone any thoughts??
I don't think your problem is disk space; How much RAM do you have
available? If you're on a shared system with lots of other activity and
your program has hefty memory requirements, there may not be enough
system resources for it. You may need to reduce the memory consumption
of your program (see the FAQ) or wait until things have quieted down so
that you can hog the system. ;)
-mjc
------------------------------
Date: 17 Jul 2000 05:00:02 GMT
From: shearn666@my-deja.com.bbs@openbazaar.net ()
Subject: padding strings with zero's
Message-Id: <3bR0F2$VCN@openbazaar.net>
Hi Folks,
I'm using perl to generate text data for processing. I often have to
format strings with both string elements and decimals. I'm using
sprintf to build the strings the printf to display. While Perl doco
states numbers should be padded with zero's and strings padded with
spaces, I am finding that BOTH are padding with spaces, ie I can't get
number to pad with strings at all.
Am I missing something here? I can't find much about padding in my book
"Progamming Perl", although admittedly it is rather old.
Can someone assist??
CC to email appreciated.
steve
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: 17 Jul 2000 07:00:03 GMT
From: aqumsieh@hyperchip.com.bbs@openbazaar.net (Ala Qumsieh)
Subject: Re: padding strings with zero's
Message-Id: <3bR3L2$W9Y@openbazaar.net>
shearn666@my-deja.com writes:
> Can someone assist??
Well, you don't show us any code, so how can we help you?
But here's a stab in the dark:
printf "%08.2f", 5.36;
--Ala
------------------------------
Date: 17 Jul 2000 10:50:02 GMT
From: bart.lateur@skynet.be.bbs@openbazaar.net (Bart Lateur)
Subject: Re: padding strings with zero's
Message-Id: <3bR9KQ$W0G@openbazaar.net>
shearn666@my-deja.com wrote:
>I can't get
>number to pad with strings at all.
Put a "0" between the "%" sign and the numberthat follows, in the
sprintf() format string.
--
Bart.
------------------------------
Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 16 Sep 99)
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: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.
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 V9 Issue 3721
**************************************