[8007] in Perl-Users-Digest
Perl-Users Digest, Issue: 1632 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Jan 13 20:07:34 1998
Date: Tue, 13 Jan 98 17:00:22 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Tue, 13 Jan 1998 Volume: 8 Number: 1632
Today's topics:
(no subject) <tartakd@wam.umd.edu>
Re: (no subject) (Martien Verbruggen)
available disk space? <bzhou@sid.hp.com>
Re: Comparing strings (Martien Verbruggen)
Re: Displaying GIFs - oops (Martien Verbruggen)
finding member of a list <rshadian@hawaii.edu>
getpwnam on Solaris not giving me password? (Roy S. Rapoport)
How to get file owner in Windows NT <unixproNOSPAM@interaccess.com>
Re: Module Net::FTP problems (Paul J. Schinder)
Re: Multi-line input: fastest way? (Kevin Reid)
Objects as keys for a hash table <achoy@us.oracle.com>
Perl advanced graphics processing (Joshua Burgin)
Problem using Dynaloader on Solaris 2.5 <vuthi@ctrl.titech.ac.jp>
Script on Win95 vs. Web <cstanyon@globalnet.co.uk>
Re: sending emails with perl ? (Martien Verbruggen)
Re: Solaris 2.6, Perl 5.004_56, gcc 2.7.2.3, "make test <vuthi@ctrl.titech.ac.jp>
Re: sorting arrows (Martien Verbruggen)
Re: Speed up a file write? (perl tricks in a cgi script (Michael R Weholt)
Storing Data In Perl <cybercom@pacific.net.sg>
Re: Storing Data In Perl (Martien Verbruggen)
Re: Storing Data In Perl (brian d foy)
Re: Style Q for modules: best syntax for "hash" argume <jstern@world.northgrum.com>
tar, z, gz unzip,Win95 <lovegod@earthling.net>
Re: tar, z, gz unzip,Win95 (Martien Verbruggen)
Re: Where can I get the pre-compiled binariy "undump" f (Martien Verbruggen)
Re: Where can I get the pre-compiled binariy "undump" f (Matthew Cravit)
Re: Where can I get the pre-compiled binariy "undump" f <rra@stanford.edu>
Re: Where can I get the pre-compiled binariy "undump" f (Matthew Cravit)
Re: Write to data file (Martien Verbruggen)
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 13 Jan 1998 18:03:08 -0400
From: Dmitriy Tartakovskiy <tartakd@wam.umd.edu>
Subject: (no subject)
Message-Id: <34BBE49B.95322B2C@wam.umd.edu>
Is there Perl for Windows 95, not for Windows NT?
Does Perl for Windows NT work for Windows 95?
Please send answers to tartakd@wam.umd.edu.
------------------------------
Date: 14 Jan 1998 00:00:03 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
To: tartakd@wam.umd.edu
Subject: Re: (no subject)
Message-Id: <69gv63$k3$3@comdyn.comdyn.com.au>
[Posted and Mailed]
In article <34BBE49B.95322B2C@wam.umd.edu>,
Dmitriy Tartakovskiy <tartakd@wam.umd.edu> writes:
> Is there Perl for Windows 95, not for Windows NT?
> Does Perl for Windows NT work for Windows 95?
There's a perl,actually 2, for Win32, which should work on both.
http://www.perl.com/latest.html
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | I think I think, therefore I think I
Commercial Dynamics Pty. Ltd. | am.
NSW, Australia |
------------------------------
Date: Tue, 13 Jan 1998 16:07:53 -0800
From: "Brian Zhou" <bzhou@sid.hp.com>
Subject: available disk space?
Message-Id: <69gvia$5e21@hpcc883.corp.hp.com>
Hello,
How do you know how much disk space is available in Perl? I need to do this
on both Unix and Windows NT.
TIA,
Brian
------------------------------
Date: 14 Jan 1998 00:14:18 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Comparing strings
Message-Id: <69h00q$n7$2@comdyn.comdyn.com.au>
In article <34BBFADD.5B61@earthling.net>,
Rich Grise <lovegod@earthling.net> writes:
> and he's a perl newbie who's still writing his perl in C, much
> like myself! :)
In C? You can't compare strings with == in C either :)
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | Very funny Scotty, now beam down my
Commercial Dynamics Pty. Ltd. | clothes.
NSW, Australia |
------------------------------
Date: 13 Jan 1998 23:10:23 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Displaying GIFs - oops
Message-Id: <69gs8v$dd$1@comdyn.comdyn.com.au>
In article <34BC20B1.36F3@mediacity.com.sg>,
Patrick Stacey <patrick@mediacity.com.sg> writes:
> Try this URL (http://pat.mediacity.com.sg/adengine/test2.pl) which
> uses the new code:
This code is a lot better :)
> -------------#
> $gif_image = "c:\\webdocs\\adengine\\sndscape.gif";
>
> if(open(IMAGE,"<".$gif_image)){
> $no_bytes = (stat($gif_image))[7];
>
> print "Content-type: image/gif\n";
> print "Content-length: $no_bytes\n\n";
> print <IMAGE>;
You're only reading the first 'line' here, meaning the first bunch of
bytes up to the record separator, which by default is a newline. If
the bytes in the GIF at any point are by chance whatever a newline is
on your system, it will stop reading.
do (like I suggested in an earlier post)
undef $/;
print <IMAGE>;
instead, to print the whole thing.
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | Very funny Scotty, now beam down my
Commercial Dynamics Pty. Ltd. | clothes.
NSW, Australia |
------------------------------
Date: Tue, 13 Jan 1998 14:30:16 -1000
From: Ritchard Shadian <rshadian@hawaii.edu>
Subject: finding member of a list
Message-Id: <Pine.GSO.3.95q.980113142359.21770A-100000@uhunix3>
Is there a Perl function for checking whether a particular scalar value is
contained within a list/array (kind of like LISP's "member" function)? I
don't want to loop through the whole list checking each value one by one.
Ritchard
------------------------------------------------------------------------------
------------------------------
Date: 13 Jan 1998 14:40:57 -0800
From: rsr@best.com (Roy S. Rapoport)
Subject: getpwnam on Solaris not giving me password?
Message-Id: <69gqhp$mgp$1@shell3.ba.best.com>
Howdy,
Trying to use perl 5.004_04 on Solaris 2.5.1 (patched), I'm trying to
write a program that verifies user by comparing entered password with
password in password file. Hey, no problem -- getpwnam.
Except that getpwnam doesn't work, even as root:
-------------
205 rsrlobster /usr/local/perl/bin su -
Password:
Sun Microsystems Inc. SunOS 5.5.1 Generic May 1996
You have new mail.
1 rootlobster ~ ls -l `which perl`
2 lrwxrwxrwx 1 root other 19 Nov 6 10:07 //bin/perl -> /usr/local/bin/perl*
2 rootlobster ~ ls -l /usr/local/bin/perl
1152 -rwxr-xr-x 2 root other 575476 Nov 20 20:56 /usr/local/bin/perl*
3 rootlobster ~ /usr/local/bin/perl -de 0
Loading DB routines from perl5db.pl version 1.01
Emacs support available.
Enter h or `h h' for help.
main::(-e:1): 0
DB<1> print join(' ', getpwnam('rsr')), "\n" ;
rsr x 65535 12 /home/rsr /bin/tcsh
----
Now, the Perl book indicates that getpwnam is the equivalent of the
getpwnam system call; man 3C getpwnam includes this tidbit of
information:
---
The pw_passwd field in the passwd structure should not be
used as the encrypted password for the user; use getspnam()
or getspnam_r() instead. See getspnam(3C).
---
But of course, I don't have a getspnam in perl.
What am I missing?
-roy
------------------------------
Date: Tue, 13 Jan 1998 18:12:49 -0600
From: Bill Mansfield <unixproNOSPAM@interaccess.com>
Subject: How to get file owner in Windows NT
Message-Id: <34BC0301.59EB@interaccess.com>
I need to get the owner of a file in an NTFS file system. I don't see
how to do it with either stat or File::Filesecurity. Anybody know how?
------------------------------
Date: Tue, 13 Jan 1998 19:35:39 -0500
From: schinder@leprss.gsfc.nasa.gov (Paul J. Schinder)
Subject: Re: Module Net::FTP problems
Message-Id: <schinder-1301981935390001@schinder.clark.net>
In article <uoh1gvcik.fsf@donal.kintailrd>, Bruce Cook
<BC3-AU@bigfoot.com> wrote:
} Trying to use the Net::FTP module, I'm getting the following error:
} Not having used maodules to any great extent, I'm a little lost
} as to where to start looking.
}
} Could anybody tell what this means, and where to start looking.
} (Just installed perl-5.004, and libnet-1.0605
}
}
} [bruce@cletus develop]$ ./get-maillist.pl
} Can't locate auto/Net/FTP/net.al in @INC at ./get-maillist.pl line 14
} [bruce@cletus develop]$
Sure can't. That's because there is no such method in Net::FTP.
}
} ***** get-maillist.pl:
}
} #! /usr/bin/perl
}
} # Grab the mailing list data which has been placed into seperate files
} # in a directory on my mail serving machine
}
} $mail_machine= "mail.wantree.com.au";
} $username= "bcook";
} $password= "youdidntthinkidleavethisdidyou";
} $mail_directory= "Maillist";
}
}
} use Net::FTP;
}
} $ftp = Net::FTP->net($mail_machine);
$ftp = Net::FTP->new($mail_machine);
} $ftp->login($username, $password);
} $ftp->cwd($mail_directory);
} @files= $ftp->ls;
}
} print("@files\n");
}
} $ftp->quit;
}
}
--
Paul J. Schinder
NASA Goddard Space Flight Center
Code 693, Greenbelt, MD 20771
schinder@leprss.gsfc.nasa.gov
------------------------------
Date: Tue, 13 Jan 1998 18:05:29 -0500
From: kpreid@ibm.net (Kevin Reid)
Subject: Re: Multi-line input: fastest way?
Message-Id: <1d2sz0c.ri33sl1kycn5sN@slip166-72-108-7.ny.us.ibm.net>
This message is a reply to an e-mail message that was sent to me on this
subject.
> a better way? I don't know... here's another way though:
>
> #!/usr/bin/perl -w
> $U_prompt = "input";
> print $U_prompt, "> ";
> while(($U_code.=<STDIN>)=~s/\\$//) {
> print " "x length $U_prompt,"> ";
> }
> print $U_code;
> __END__
>
> still needs to be chomp()'d if you want to get rid
> of last newline though.
>
> I'd venture to say that speed is not an issue in such
> a case anyway---the continuation prompt will be virtually
> instantaneous either way... you'd have to do quite a bit
> of processing in the loop for a human to notice a time lag
> between prompts :-)
Thanks for the example; it gave me an idea for another way to do it.
What I was actually looking for was a neater, cleaner, and in general better
looking way of doing it.
Here's what I came up with:
#!/usr/bin/perl -w
$U_prompt = "input";
print $U_prompt, "> "; # display prompt
$U_code = <STDIN>; # get line
while ($U_code =~ s/\\$//) { # if backslashed then remove & ...
print " " x length($U_prompt), "> "; # print cont. prompt
$U_code .= <STDIN>; # append string
}
--
Kevin Reid
------------------------------
Date: Tue, 13 Jan 1998 16:03:08 -0800
From: Allen Choy <achoy@us.oracle.com>
Subject: Objects as keys for a hash table
Message-Id: <34BC00BC.C55AEFD6@us.oracle.com>
Hi.
I cached a list of objects using a hash table, with the objects as
keys. When
I try to retrieve the objects via key %hash, I get the objects, but
they're no
longer objects. Is this the intended behavior? And how does anyone
have
a decent workaround for this?
Thanks in advance,
Allen
------------------------------
Date: 13 Jan 1998 23:09:28 GMT
From: joshua@purestuff.com (Joshua Burgin)
Subject: Perl advanced graphics processing
Message-Id: <slrn6bnt18.eil.joshua@nothing.izzy.com>
I'm looking for some help in processing some images via a perl module
(or library, etc.). I need to to drop-shadow an image. I can use
Image::Magick to rotate it, shrink and expand it, etc. I can use GD
for processing more basic than that. But neither library seems
advanced enough to handle drop shadowing.
For those that don't know: Drop shadowing (in an image editing
program) usually involves:
1) Make a new layer with a copy of the area you want to shadow
2) Apply a semi-opaque fill (60% or so) over the layer
3 Apply a gaussian blur of that fill
4) Shift that filled area about 10% right and down (or left and down)
5) Make sure the original area is on top.
I can do the shifting, and making a new layer (or just a new image,
temporarily) in Image::Magick, but I can't find a way to do the fill
or the blur in any of the packages I've found. Or maybe it's just not
as obvious as I'd like it to be.
Right now I accept requests, process them as much as possible in perl,
and then hand off to an Apple Script running on a Macintosh. The
applescript basically just hands off the images to Photoshop 4.0,
which runs a series of actions. Image editing programs (like
Photoshop) are good for doing drop shadowing them in batches seems
perfect for perl.
As much as I love my Mac, I want have this all done on the UNIX
systems (see below), because of speed, multi-user, and integration
issues.
Any help/pointers would be appreciated.
I've heard that there is a GIMP module for perl, but that's it's not
'ready for prime time' (is this true)?
Joshua
*This has to be done on a Alpha, running Digital UNIX.
_________________________________________________________________________
Joshua M. Burgin | The best things in life aren't things
joshua@purestuff.com | http://www.purestuff.com
------------------------------
Date: Wed, 14 Jan 1998 07:50:17 +0900
From: "Vuthichai A." <vuthi@ctrl.titech.ac.jp>
Subject: Problem using Dynaloader on Solaris 2.5
Message-Id: <34BBEFA9.33706146@ctrl.titech.ac.jp>
Hi !
I just compiled Perl 5.004_04 on an Untra-I box
running Solaris 2.5.
"make" went well, but after running "make test"
I got a number of errors while the test program
trying to *dynamic* load some modlues like
lib/anydbm........Can't load '../lib/auto/Fcntl/Fcntl.so' for module
Fcntl: ld.s
o.1: ./perl: fatal: relocation error: symbol not found: main: referenced
in ../l
ib/auto/Fcntl/Fcntl.so at ../lib/DynaLoader.pm line 166.
The compiler is gccversion=2.7.2.f.1
Hui :)
PS: Please cc: your reply to vuthi@ctrl.titech.ac.jp as well. Thanks.
------------------------------
Date: Wed, 14 Jan 1998 00:15:00 -0000
From: "Chris Stanyon" <cstanyon@globalnet.co.uk>
Subject: Script on Win95 vs. Web
Message-Id: <69gvtu$1n9$1@heliodor.xara.net>
I hope someone here can help. I have ran out of ideas and information. I
have altered a wwwboard.pl script, which i downloaded from
worldwidemart.com/scripts. According to my ISP all the variables are set
correct ($basedir, $baseurl, $cgi_url, etc) The script runs OK on my win95
machine (running httpd web server and perl 5.004) but returns a 500 Internal
Server Error when uploaded to the web.
The tech support of my ISP claims the server is working OK???? and there is
a problem in the script.
>From my point of view would it work on my PC if there was a problem with the
script.
I have ran 'perl -c wwwboard.pl' and it returned systax OK.
I have tried altering the file in various programs including Editpad that
allows me to save the file as a specific unix file (LF only). This seems to
have made no difference whatsoever.
Any help would be greatly appreciated as this is my last hope.
chris stanyon
cstanyon@globalnet.co.uk
------------------------------
Date: 13 Jan 1998 22:40:31 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: sending emails with perl ?
Message-Id: <69gqgv$7d$2@comdyn.comdyn.com.au>
In article <01bd1ff0$b60d9f00$1c8714d1@nwlink.com>,
"jch" <nospamhebert@nwlink.com> writes:
> If you are on a UNIX server use mail-lib.pl if you are on NT use
> smtpmail-lib.pl
Don't. Use something that is supported by the whole community.
If you're not using perl4, but perl5, use Net::SMTP, or one of the
other modules designed to send mail (I think the MailTools package has
some mailing functionality, which might rely on Net::SMTP)
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | If at first you don't succeed, try
Commercial Dynamics Pty. Ltd. | again. Then quit; there's no use being
NSW, Australia | a damn fool about it.
------------------------------
Date: Wed, 14 Jan 1998 07:52:18 +0900
From: "Vuthichai A." <vuthi@ctrl.titech.ac.jp>
To: Charlie Speight <speight@sunsite.unc.edu>
Subject: Re: Solaris 2.6, Perl 5.004_56, gcc 2.7.2.3, "make test" fails
Message-Id: <34BBF022.C393F972@ctrl.titech.ac.jp>
I experience exactly the same problem on
Solaris 2.5.. Very appreciate if you get any
response.
Hui :)
Charlie Speight wrote:
> I've come to the end of my rope. Can someone help me find the problem
> here.
>
> I use all the configure defaults and "make" completes without complaining.
>
> here is the output of myconfig:
> *****
> Summary of my perl5 (5.0 patchlevel 4 subversion 56) configuration:
> Platform:
> osname=solaris, osvers=2.6, archname=sun4-solaris
> uname='sunos daniels 5.6 generic sun4m sparc sunw,sparcstation-10 '
> hint=recommended, useposix=true, d_sigaction=define
> bincompat3= useperlio=undef d_sfio=undef
> Compiler:
> cc='cc', optimize='-O', gccversion=2.7.2.3
> cppflags='-I/usr/local/include'
> ccflags ='-I/usr/local/include'
> stdchar='unsigned char', d_stdstdio=define, usevfork=false
> voidflags=15, castflags=0, d_casti32=define, d_castneg=define
> intsize=4, alignbytes=8, usemymalloc=y, prototype=define
> Linker and Libraries:
> ld='cc', ldflags =' -L/usr/local/lib'
> libpth=/usr/local/lib /lib /usr/lib /usr/ccs/lib
> libs=-lsocket -lnsl -lgdbm -ldl -lm -lc -lcrypt
> libc=/lib/libc.so, so=so
> useshrplib=false, libperl=libperl.a
> Dynamic Linking:
> dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' '
> cccdlflags='-fpic', lddlflags='-G -L/usr/local/lib'
> *****
>
> and here are the errors when I run "make test":
> *****
> lib/anydbm........Can't load '../lib/auto/Fcntl/Fcntl.so' for module
> Fcntl: ld.so.1: ./perl: fatal: relocation error: file
> ../lib/auto/Fcntl/Fcntl.so: symbol main: referenced symbol not found at
> ../lib/DynaLoader.pm line 166.
>
> at ./lib/anydbm.t line 11
> BEGIN failed--compilation aborted at ./lib/anydbm.t line 11.
> FAILED at test 0
>
> ...
>
> lib/filecopy......Can't load '../lib/auto/IO/IO.so' for module IO:
> ld.so.1: ./perl: fatal: relocation error: file ../lib/auto/IO/IO.so:
> symbol main: referenced symbol not found at ../lib/DynaLoader.pm line 166.
>
> at ../lib/IO/Handle.pm line 248
> BEGIN failed--compilation aborted at ../lib/IO/Seekable.pm line 50.
> BEGIN failed--compilation aborted at ../lib/IO/File.pm line 111.
> FAILED at test 6
> *****
>
> it fails the same way for 22 tests. the other failures are:
>
> lib/filehand
> lib/gdbm
> lib/io_dump
> lib/io_pipe
> lib/io_sock
> lib/io_taint
> lib/io_tell
> lib/io_udp
> lib/io_xs
> lib/ndbm
> lib/odbm
> lib/opcode
> lib/open2
> lib/open3
> lib/posix
> lib/safe1
> lib/safe2
> lib/sdbm
> lib/socket
>
> the files are where they say they are, but all these tests fail.
>
> please cc: me on any responses.
>
> Thanks!
> Charlie Speight
------------------------------
Date: 13 Jan 1998 23:51:07 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: sorting arrows
Message-Id: <69gulb$k3$1@comdyn.comdyn.com.au>
In article <34BBC2DE.2B22F9B3@xarch.tu-graz.ac.at>,
Jahnel Klaus <jahnel@xarch.tu-graz.ac.at> writes:
> how can i sort arrows which i read from a file like that:
arrows?
Anyway:
perldoc perlfaq4
/How do I sort an array by (anything)?
Also:
http://www.perl.com/CPAN/doc/FMTEYEWTK/sort.html
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | I'm desperately trying to figure out
Commercial Dynamics Pty. Ltd. | why kamikaze pilots wore helmets - Dave
NSW, Australia | Edison
------------------------------
Date: Wed, 14 Jan 1998 00:22:02 GMT
From: awnbreel@panix.com (Michael R Weholt)
Subject: Re: Speed up a file write? (perl tricks in a cgi script?)
Message-Id: <69h0fa$1ds_002@mrw.panix.com>
In article <34BBB700.C347CFD9@5sigma.com>,
joseph@5sigma.com wrote:
>
>Do you have any idea whether the print statements are taking
>up the time, or whether the time is being spent starting
>up the Perl interpreter and loading Text::Wrap?
Ah. Good clue. I inserted some timing marks into the loop on either
side of the call to print via wrap and discovered the individual print
statements don't even show up on the radar but the individual wrap
calls will take from .1 to .45 seconds each (obviously depending on
the size of $quote->{BODY}; see below). Multiply that by 40-50 quotes
and I've got a problem.
..
print SF $quote->{TITLE}, "\n";
print SF "{QUOTE}\n";
# this will print ~5 to 25 lines
print SF wrap($pre1, $pre2, $quote->{BODY}), "\n";
print SF "{END}\n";
print SF "\n";
..
Clearly I have to get that wrap call out of there. Thanks.
--
mrw
------------------------------
Date: Wed, 14 Jan 1998 07:36:23 +0800
From: "Ho Seng Yip" <cybercom@pacific.net.sg>
Subject: Storing Data In Perl
Message-Id: <69gtqt$8hn$1@newton.pacific.net.sg>
Hi,
I was just wondering how can one store data inputed from a html form to say
a text file and also how to retrieve the correct data in the later stage
when the user wants a specific data.
Any help here will be appreciated.
Thanks. ;-)
Regards,
Seng Yip
------------------------------
Date: 14 Jan 1998 00:12:24 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Storing Data In Perl
Message-Id: <69gvt8$n7$1@comdyn.comdyn.com.au>
In article <69gtqt$8hn$1@newton.pacific.net.sg>,
"Ho Seng Yip" <cybercom@pacific.net.sg> writes:
> Hi,
>
> I was just wondering how can one store data inputed from a html form to say
> a text file and also how to retrieve the correct data in the later stage
> when the user wants a specific data.
use open(), print() and close() to create and write a file.
use open(), the <> construct and close() to read from a file.
perldoc -f open
perldoc -f close
perldoc -f print
perldoc -f printf
HTH,
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | Advertising: The science of arresting
Commercial Dynamics Pty. Ltd. | the human intelligence long enough to
NSW, Australia | get money from it.
------------------------------
Date: Tue, 13 Jan 1998 19:52:51 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Storing Data In Perl
Message-Id: <comdog-ya02408000R1301981952510001@news.panix.com>
Keywords: from just another new york perl hacker
In article <69gvt8$n7$1@comdyn.comdyn.com.au>, mgjv@comdyn.com.au (Martien Verbruggen) posted:
>In article <69gtqt$8hn$1@newton.pacific.net.sg>,
> "Ho Seng Yip" <cybercom@pacific.net.sg> writes:
>> Hi,
>>
>> I was just wondering how can one store data inputed from a html form to say
>> a text file and also how to retrieve the correct data in the later stage
>> when the user wants a specific data.
>
>use open(), print() and close() to create and write a file.
>use open(), the <> construct and close() to read from a file.
in addition to that, one may want to look into the save method
in CGI.pm which will make it easier to move sets of data in to and
out of a CGI object. CGI objects can be created in a variety of
ways, including reading from a filehandle (other than STDIN).
--
brian d foy <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
------------------------------
Date: Wed, 14 Jan 1998 00:16:36 GMT
From: Jim Stern <jstern@world.northgrum.com>
Subject: Re: Style Q for modules: best syntax for "hash" arguments?
Message-Id: <34BC03E4.446B@world.northgrum.com>
Eryq wrote:
>
> Since this question relates to style considerations for
> authoring reusable modules, I've posted in c.l.p.modules
> as well...
>
> Oftimes, we see subs which take arguments in a hash form,
> like this [1]:
>
> foo(ThisThing => $this,
> ThatThing => $that);
>
> Sometimes, we see this instead [2]:
>
> foo(-this_thing => $this,
> -that_thing => $that);
>
> And even [3]:
>
> foo(THIS_THING => $this);
>
> Not to mention some which do extra work to case-fold
> arguments and chop leading '-'s off, so that you
> can supply args in more than one style.
>
> So: are we at all moving towards a Perl style standard for
> this... and if so, what is it? Although I've been doing [1]
> for years, I've gradually warmed on [2]. And [3] looks
> too... um... "loud".
I can't say what the consensus is but to me the dashes just
add clutter. Since Perl5.000 we've had '=>' as a kind of comma
that quotes its left operand. With '=>' you need no leading dash
so why have one?
Of course, if a keyword matches a sub name or a predefined name,
you still have to enclose it in quotes to avoid a -w warning.
But in my experience, that's rare.
And I agree. [3] is like a drill sergeant screaming, inches
from your face. :-)
Just one opinion ...
> [...]
>
> However, it might be nice to have perlstyle guidelines for
> when there is "no good excuse to do otherwise".
But isn't there always "More Than One Way to Do It?" :-)
--
Jim Stern -- Views here are my own, not Northrop Grumman's. (El
Segundo, CA)
------------------------------
Date: Tue, 13 Jan 1998 17:02:25 -0600
From: Rich Grise <lovegod@earthling.net>
Subject: tar, z, gz unzip,Win95
Message-Id: <34BBF281.351@earthling.net>
Hello, this is probably the wrong newsgroup, but I downloaded
some perl library files, but they're in z or gz or maybe tar
format. Where can I get a free unzipper for those formats for
Windows 95?
Thanks.
Rich Grise
rmgrise@spacestar.net
------------------------------
Date: 14 Jan 1998 00:14:59 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: tar, z, gz unzip,Win95
Message-Id: <69h023$n7$3@comdyn.comdyn.com.au>
In article <34BBF281.351@earthling.net>,
Rich Grise <lovegod@earthling.net> writes:
> Hello, this is probably the wrong newsgroup, but I downloaded
it is indeed. One of the windows groups might have been better.
> some perl library files, but they're in z or gz or maybe tar
> format. Where can I get a free unzipper for those formats for
> Windows 95?
Winzip handles them
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | If it isn't broken, it doesn't have
Commercial Dynamics Pty. Ltd. | enough features yet.
NSW, Australia |
------------------------------
Date: 13 Jan 1998 23:20:29 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Where can I get the pre-compiled binariy "undump" for Linux?
Message-Id: <69gsrt$en$1@comdyn.comdyn.com.au>
In article <34BBE2D9.F5A7AEAD@weboneinc.com>,
Douglas Clifton <doug1@weboneinc.com> writes:
> What is undump and what does have to do w/ c.l.p.m?
perldoc perlfaq3
/What is undump
[PgDn]
[SNIP]
The undump program was an old attempt to speed up your Perl
program by storing the already-compiled form to disk. This
is no longer a viable option, as it only worked on a few
architectures, and wasn't a good solution anyway.
[SNIP]
I guess that because it is an old perl specific utility, it is
appropriate on c.l.p.misc.
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | Advertising: The science of arresting
Commercial Dynamics Pty. Ltd. | the human intelligence long enough to
NSW, Australia | get money from it.
------------------------------
Date: 13 Jan 1998 14:45:50 -0800
From: mcravit@best.com (Matthew Cravit)
Subject: Re: Where can I get the pre-compiled binariy "undump" for Linux?
Message-Id: <69gqqu$obb$1@shell3.ba.best.com>
In article <34BBE2D9.F5A7AEAD@weboneinc.com>,
Douglas Clifton <doug1@weboneinc.com> wrote:
>What is undump and what does have to do w/ c.l.p.m?
Undump is a utility which (under some circumstances) enables you to make a
program dump core and then transform the core file into a binary which can
be run.
What it has to do with c.l.p.m. is that Perl can (sometimes) use this to
make binaries from a script, although the B:: compiler modules are better
for this in most cases. From the perlrun man page:
> -u causes Perl to dump core after compiling your script.
> You can then take this core dump and turn it into an
> executable file by using the undump program (not
> supplied). This speeds startup at the expense of some
> disk space (which you can minimize by stripping the
> executable). (Still, a "hello world" executable comes
> out to about 200K on my machine.) If you want to
> execute a portion of your script before dumping, use
> the dump() operator instead. Note: availability of
> undump is platform specific and may not be available
> for a specific port of Perl.
/MC
--
Matthew Cravit, N9VWG | Experience is what allows you to
E-mail: mcravit@best.com (home) | recognize a mistake the second
mcravit@taos.com (work) | time you make it.
------------------------------
Date: 13 Jan 1998 15:58:29 -0800
From: Russ Allbery <rra@stanford.edu>
Subject: Re: Where can I get the pre-compiled binariy "undump" for Linux?
Message-Id: <m3d8hwudsq.fsf@windlord.Stanford.EDU>
Martien Verbruggen <mgjv@comdyn.com.au> writes:
> perldoc perlfaq3
> /What is undump
> [PgDn]
> [SNIP]
> The undump program was an old attempt to speed up your Perl
> program by storing the already-compiled form to disk. This
> is no longer a viable option, as it only worked on a few
> architectures, and wasn't a good solution anyway.
> [SNIP]
> I guess that because it is an old perl specific utility, it is
> appropriate on c.l.p.misc.
undump isn't a Perl-specific utility. It was a general program to do this
sort of thing, and was in fact part of TeX for many years. (Since TeX's
build process has always involved loading the standard support code and
then dumping a memory image.) It's no longer part of TeX, and last time I
checked isn't even available on CTAN, because TeX now dumps a
platform-independent loadable memory image via more traditional and less
OS-dependent means.
emacs also does something vaguely similar, and it might be possible to rip
the code out of emacs and try to use it with Perl, but in general you're
better off just trying to get the compiler to work (and more likely to
succeed). I personally would like to see the core dump flag removed from
Perl as it's no longer useful and just confuses people.
--
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print
------------------------------
Date: 13 Jan 1998 16:14:31 -0800
From: mcravit@best.com (Matthew Cravit)
Subject: Re: Where can I get the pre-compiled binariy "undump" for Linux?
Message-Id: <69h017$56f$1@shell3.ba.best.com>
In article <69gsrt$en$1@comdyn.comdyn.com.au>,
Martien Verbruggen <mgjv@comdyn.com.au> wrote:
>I guess that because it is an old perl specific utility, it is
Actually, although it is old, it's not perl specific. I believe it was
originally used as part of the build process for TeX, possibly among other
things. I seem to recall the red (old) Camel indicating that it could
usually be found on places where TeX was distributed.
However, my understanding is that it's no longer used much, for primarily
the following two reasons:
- The advent of relocatable binary formats (ELF, for example) has made the
task of undump'ing a core file much more difficult and prone to failure,
and
- The Perl compiler modules (B::*) mostly obviate the need for undumping
core files to produce a binary.
I suspect the capability to do this in Perl still exists mostly because it's
easier to leave it in than to remove it.
/MC
--
Matthew Cravit, N9VWG | Experience is what allows you to
E-mail: mcravit@best.com (home) | recognize a mistake the second
mcravit@taos.com (work) | time you make it.
------------------------------
Date: 13 Jan 1998 23:54:44 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Write to data file
Message-Id: <69gus4$k3$2@comdyn.comdyn.com.au>
In article <34BBE35F.773A21E7@haas.berkeley.edu>,
Patience <feng@haas.berkeley.edu> writes:
> When the line is matched, I want to replace the original value of
> $QUANTITY with new value of $NEW_QTY. But how do I save the info into
> the same line without disturbing other lines in the same file?
perldoc perlfaq5
/How do I change one line in a file
[snip]
The general solution is to create a temporary copy of the text file
with the changes you want, then copy that over the original.
[snip]
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | Very funny Scotty, now beam down my
Commercial Dynamics Pty. Ltd. | clothes.
NSW, Australia |
------------------------------
Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 8 Mar 97)
Message-Id: <null>
Administrivia:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.
The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.
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 V8 Issue 1632
**************************************