[7158] in Perl-Users-Digest
Perl-Users Digest, Issue: 783 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Jul 26 22:07:34 1997
Date: Sat, 26 Jul 97 19:00:21 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Sat, 26 Jul 1997 Volume: 8 Number: 783
Today's topics:
Re: ? win32::ODBC SQL <kermit@ticnet.com>
[Q] Appending existing file <dyrewolf@worldnet.att.net>
Re: [Q] Appending existing file (brian d foy)
ANNOUNCE: Data::Locations 2.0 (Steffen Beyer)
ANNOUNCE: Tie::Handle 2.0 (Steffen Beyer)
Can somebody explain how this works? <steffi@shell8.ba.best.com>
deleteing <thibault@netwalk.com>
Re: how to reverse substitution order ? <rra@stanford.edu>
Re: Newbie: How do you call gzip from perl? <merlyn@stonehenge.com>
Re: Perl - shell - Perl <westxga@ptsc.slg.eds.com>
Re: Perl script to serve up different HTML pages at dif (Gary Nielson)
Re: Removing Carriage Returns??? <rootbeer@teleport.com>
Re: Too many people in this group are arrogant #*(@# (R <merlyn@stonehenge.com>
Re: Too many people in this group are arrogant #*(@# (R (Abigail)
Re: Using perl to copy JPG files (Nathan V. Patwardhan)
Re: Using perl to copy JPG files (Jeff Stampes)
www.perl.com? <jamie@comet.net>
Re: www.perl.com? <merlyn@stonehenge.com>
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sat, 26 Jul 1997 11:51:04 -0500
From: Kermit Tensmeyer <kermit@ticnet.com>
Subject: Re: ? win32::ODBC SQL
Message-Id: <33DA2AF8.137F3E30@ticnet.com>
Brad Johnson wrote:
> 1: What's the SQL command to delet an entire table (from an
> Acess database), i.e. the opposite of CREATE TABLE?
Drop table xxx'
>
>
> 2: I've got a program in which I have:
>
> # pseudocode:
>
> &someSQLCall();
> while($DB->FetchRow()) {
> %art= $DB->DataHash();
> # Do stuff;
> &SQLAddRecord();
> }
>
> The obvious problem is that the SQL call inside the loop
> screws up the FetchRow that should be from the first call.
> What's the best workaround/solution?
> Should I open two connections?
with ODBC create two connections;
while($1->FetchRow() ) {
%art = $1->DataHash();
## process stuff
$2->Sql("update xxx set pts=23 where krec=$art{$fld2}");
}
check the example program that comes with ODBC for more details
>
>
> --bradj.
> ------------------------Nullus Oppidenda Est--------------------------
>
> brad johnson (bgjohnso@unix.amherst.edu) 'Disc, God, Country, Pork'
>
> http://www.amherst.edu/~bgjohnso/ 'Chickens! No Cynics!'
> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
------------------------------
Date: Sat, 26 Jul 1997 03:11:35 -0700
From: Adam Grayson <dyrewolf@worldnet.att.net>
Subject: [Q] Appending existing file
Message-Id: <33D9CD57.AD7@worldnet.att.net>
I'm pretty much a Perl beginner, so I'll try make this as literate as
possible.
I'm trying to take form input (4 items to be exact) import them from the
HTML with Perl, and then print them at the end of an existing text file.
In other words, I want this to be printed at the end of a text file:
FormItem1 <TAB> FormItem2 <TAB> FormItem3 <TAB> FormItem4
Also, I would like to save the appended version of that text file.
Anyone have any suggestions? If possible, e-mail responses as well as
posting them, since I don't get to read this newsgroup that often.
Thanks in advance
Adam Grayson
------------------------------
Date: Sat, 26 Jul 1997 16:06:30 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: [Q] Appending existing file
Message-Id: <comdog-ya02408000R2607971606300001@nntp.netcruiser>
In article <33D9CD57.AD7@worldnet.att.net>, Adam Grayson
<dyrewolf@worldnet.att.net> wrote:
> I'm pretty much a Perl beginner, so I'll try make this as literate as
> possible.
>
> I'm trying to take form input (4 items to be exact) import them from the
> HTML with Perl, and then print them at the end of an existing text file.
> In other words, I want this to be printed at the end of a text file:
> FormItem1 <TAB> FormItem2 <TAB> FormItem3 <TAB> FormItem4
you'll want to read about the open() function in the perlfunc
manpage or in the Blue Camel [1]. Both explain how to
accomplish this.
good luck and welcome to perl :)
[1]
Programming Perl, Larry Wall, Tom Christensen, & Randal L. Schwartz
ISBN 1-56592-149-6.
<URL:http://www.ora.com>
--
brian d foy <URL:http://computerdog.com>
------------------------------
Date: 27 Jul 1997 00:50:08 GMT
From: sb@sdm.de (Steffen Beyer)
Subject: ANNOUNCE: Data::Locations 2.0
Message-Id: <5re600$mtf$1@nadine.teleport.com>
Dear Perl users,
I am glad and proud to submit an especially useful and elegant module
to the Perl community, namely
===========================================
Package "Data::Locations" Version 2.0
===========================================
for Perl version 5.000 and higher
Copyright (c) 1997 by Steffen Beyer. All rights reserved.
This package is free software; you can redistribute and/or
modify it under the same terms as Perl itself.
Where to find:
--------------
You can download this module directly from the author's web site, where you
will also find my other modules and a couple of logos illustrating what the
modules do:
http://www.engelschall.com/u/sb/download/
You should also be able to find this module on any CPAN ftp site
(CPAN = "Comprehensive Perl Archive Network"), where the file
"Data-Locations-2.0.tar.gz" should be found in any of the
following directories:
.../CPAN/authors/id/STBEY/
.../CPAN/modules/by-category/06_Data_Type_Utilities/Data/
.../CPAN/modules/by-module/Data/
To find a CPAN ftp site, you can either direct your web browser to
http://www.perl.com/CPAN/authors/id/STBEY/Data-Locations-2.0.tar.gz
(which will automatically redirect you to a CPAN ftp server near you) or
look into "The Perl 5 Module List" by Tim Bunce and Andreas Koenig either
on USENET in the "comp.lang.perl.modules" newsgroup or at
http://www.perl.com/CPAN/modules/00modlist.long.html
New features in version 2.0:
----------------------------
In version 2.0, the following new methods and features have been added:
* $location->printf($format,@items); # equivalent of the C library "printf"
* $line = $location->read(); # to read the contents line by line
* @list = $location->read(); # to read the contents all at once
* $location->reset(); # reset the pointer for "read()"
* Data::Locations->reset(); # reset ALL locations at the same time
* $location->tie('FILEHANDLE'); # tie locations to symbolic filehandles
* $location->tie($filehandle); # tie 'em to file handle references...
* print @items; # do $location->tie('STDOUT'); first!
# (or "select(FILEHANDLE);")
* print FILEHANDLE @items;
* printf $format, @items; # (select() and tie() to default first)
* printf FILEHANDLE $format, @items;
* $line = <FILEHANDLE>; # to read the contents line by line
* @list = <FILEHANDLE>; # to read the contents all at once
In addition to these new features, the name of this module has been changed
slightly in order to satisfy the naming conventions of CPAN (= Comprehensive
Perl Archive Network) and The Perl 5 Module List:
Use global search & replace to substitute "Data::Locations" for "Locations"
in all your programs that "use Locations".
Note also that tying locations to file handles requires Perl version 5.004,
whereas this module is otherwise perfectly happy with previous versions of
Perl 5 as well! (But see the "Preliminary steps for use with Perl prior to
version 5.004" in the "README" file in this distribution)
Tying of locations to file handles is handled by a (new) companion module
named "Tie::Handle" which allows you to tie arbitrary objects to file handles
and which can be used for other applications than "Data::Locations" as well!
What does it do:
----------------
Locations - recursive placeholders in the data you generate
"Locations" free you from the need to GENERATE data in the
same order in which it will be USED later.
They allow you to define insertion points in the middle of your
data which you can fill in later, at any time you want!
For instance you do not need to write output files in rigidly
sequential order anymore using this module.
Instead, write the data to locations in the order which is the most
appropriate and natural for you!
When you're finished, write your data to a file or process it otherwise,
purely in memory (faster!).
Most important: You can nest these placeholders in any way you want!
Potential infinite recursions are detected automatically and refused.
This means that you can GENERATE data ONLY ONCE in your program and
USE it MANY TIMES at different places, while the data itself is stored
in memory only once.
Maybe a picture will help to better understand this concept:
Think of "Locations" as folders (or drawers) containing papers
in a sequential order, most of which contain printable text or
data, while some may contain the name of another folder (or drawer).
When dumping a location to a file, the papers contained in it are
printed one after another in the order they were originally stored.
When a paper containing the name of another location is encountered,
however, the contents of that location are processed before continuing
to print the remaining papers of the current location. And so forth,
in a recursive descent.
Note that you are not confined to dumping locations to a file,
you can also process them directly in memory!
Note further that you may create as many locations with as many
embedded locations, as many nesting levels deep as your available
memory will permit.
Not even Clodsahamp's multidimensionally expanded tree house (see
Alan Dean Foster's fantasy novel "Spellsinger" for more details!)
can compare with this! :-)
Possible applications of this module are for example:
- source code generation
- web page generation
- generating mail messages in mime format
- filling in forms
- ...
Let your fantasy go wild inventing more applications!
(And tell me about them!)
Credits:
--------
Many thanks go to Mr. Gero Scholz (now at the Dresdner Bank in Frankfurt,
Germany) for writing the "ProMAC" macro processor (some sort of a precursor
to Perl in spirit!) and implementing the concept of "locations" there, which
inspired me to write this Perl module!
Mr. Scholz himself owes his inspiration to the "DELTA" macro processor
(a tool largely used during the seventies, as it seems) where a rudimentary
version of the concept of "locations" was implemented and where this name
("locations") seems to have been used for the first time.
Author's note:
--------------
I hope you will find this module beneficial!
Share and enjoy!
Yours,
--
Steffen Beyer <sb@sdm.de> http://www.engelschall.com/u/sb/
"There is enough for the need of everyone in this world,
but not for the greed of everyone." - Mahatma Gandhi
>> Unsolicited commercial email goes directly to /dev/null <<
------------------------------
Date: 27 Jul 1997 00:49:20 GMT
From: sb@sdm.de (Steffen Beyer)
Subject: ANNOUNCE: Tie::Handle 2.0
Message-Id: <5re5ug$mt3$1@nadine.teleport.com>
I am glad and proud to submit
=======================================
Module "Tie::Handle" Version 2.0
=======================================
requires Perl version 5.004 or higher
Copyright (c) 1997 by Steffen Beyer. All rights reserved.
This package is free software; you can redistribute and/or
modify it under the same terms as Perl itself.
to the Perl community.
Where to find:
--------------
You can download this module directly from the author's web site, where you
will also find my other modules and a couple of logos illustrating what the
modules do:
http://www.engelschall.com/u/sb/download/
You should also be able to find this module on any CPAN ftp site
(CPAN = "Comprehensive Perl Archive Network"), where the file
"Tie-Handle-2.0.tar.gz" should be found in any of the following
directories:
.../CPAN/authors/id/STBEY/
.../CPAN/modules/by-category/06_Data_Type_Utilities/Tie/
.../CPAN/modules/by-module/Tie/
To find a CPAN ftp site, you can either direct your web browser to
http://www.perl.com/CPAN/authors/id/STBEY/Tie-Handle-2.0.tar.gz
(which will automatically redirect you to a CPAN ftp server near you) or
look into "The Perl 5 Module List" by Tim Bunce and Andreas Koenig either
on USENET in the "comp.lang.perl.modules" newsgroup or at
http://www.perl.com/CPAN/modules/00modlist.long.html
Prerequisites:
--------------
Perl version 5.004 or higher.
Changes:
--------
Version 2.0 changed the handling of "reset()" while tying/untying a file
handle to some object to a more flexible solution: Upon tying, an object
method "open()" is invoked. Upon untying, an object method "close()" is
invoked. This way you can overload these methods in your module with
whatever you like, even a dummy method if nothing needs to be done.
What does it do:
----------------
Tie::Handle - tie arbitrary objects to file handles
This module facilitates the tying of file handles with (arbitrary)
objects.
File handles must be given either as symbolic file handles (like "STDOUT",
"MYHANDLE" or "MYPACKAGE::MYHANDLE") or as references as returned by the
object constructor method "new()" from the "IO::Handle" or "FileHandle"
class (either one works).
Your class "Your::Class" needs to:
require Tie::Handle;
and to add "Tie::Handle" to the list of classes to inherit from:
@ISA = qw(Exporter Tie::Handle);
in order to enable tying of file handles with objects of "Your::Class".
Note that your class "Your::Class" is also responsible for providing
(i.e., overloading) the appropriate methods needed to access your
objects:
+ $object->open();
+ $object->print(@items);
+ $item = $object->read();
+ @list = $object->read();
+ $key = $object->getchar();
+ $bytes = $object->blockread($buffer,$length[,$offset]);
+ $object->close();
See the module "Data::Locations" for an example of how to implement
most of these methods.
Available methods:
------------------
+ $object->tie('FILEHANDLE');
+ $object->tie($filehandle);
+ print @items;
+ print FILEHANDLE @items;
+ print $filehandle @items;
+ printf $format, @items;
+ printf FILEHANDLE $format, @items;
+ printf $filehandle $format, @items;
+ $line = <>;
+ @list = <>;
+ $line = <FILEHANDLE>;
+ @list = <FILEHANDLE>;
+ $line = <$filehandle>;
+ @list = <$filehandle>;
+ $key = getc();
+ $key = getc(FILEHANDLE);
+ $key = getc($filehandle);
+ $bytes =
[sys]read(FILEHANDLE,$buffer,$length[,$offset]);
+ $bytes =
[sys]read($filehandle,$buffer,$length[,$offset]);
+ untie *FILEHANDLE;
+ untie *{FILEHANDLE};
+ untie $filehandle;
+ untie *{$filehandle};
Author's note:
--------------
I hope you will find this module beneficial!
Share and enjoy!
Yours,
--
Steffen Beyer <sb@sdm.de> http://www.engelschall.com/u/sb/
"There is enough for the need of everyone in this world,
but not for the greed of everyone." - Mahatma Gandhi
>> Unsolicited commercial email goes directly to /dev/null <<
------------------------------
Date: 26 Jul 1997 16:28:25 -0700
From: Robert Nicholson <steffi@shell8.ba.best.com>
Subject: Can somebody explain how this works?
Message-Id: <yl3u3hhbdgm.fsf@shell8.ba.best.com>
This is from Paul Lucas's filtmail scripts
$Headers =~ s/\n\s+/ /g;
%Header = ( 'FRONTSTUFF', split( /^(\w[-\w]+):\s+/m, $Headers ) );
this appears to be a variation of what's on p 222 of Programming Perl 2nd
------------------------------
Date: Sat, 26 Jul 1997 17:04:43 -0400
From: Brian Thibault <thibault@netwalk.com>
Subject: deleteing
Message-Id: <33DA666A.F7591E9D@netwalk.com>
How do I delete a whole line of text from a file when I only know what
the line starts with.
It is for a deluser script.
Thanks in advance,
Please respond by email
Brian Thibault
------------------------------
Date: 26 Jul 1997 15:31:20 -0700
From: Russ Allbery <rra@stanford.edu>
Subject: Re: how to reverse substitution order ?
Message-Id: <m3wwmdwimf.fsf@windlord.Stanford.EDU>
Abigail <abigail@fnx.com> writes:
> M.J.T. Guy (mjtg@cus.cam.ac.uk) wrote:
>> Abigail <abigail@fnx.com> wrote:
>>> Uhm, I've yet to encounter a program that doesn't resolve foo/bar/..
>>> to foo/, even if foo/bar is a symlink to /something/else. Even doing
>>> cd foo/bar; stuff; cd ..; brings me to foo, while doing stuff in
>>> /something/else.
This is highly shell-dependent.
>> Sounds like you're very unlucky and have a severely broken Unix.
Some of us don't consider that behavior broken. :)
>> Here's what that example does for me (SunOS 4.1.3 and /bin/sh):
>> $ mkdir somewhere
>> $ mkdir somewhere/else
>> $ touch somewhere/else/thing
>> $ mkdir foo
>> $ ln -s ../somewhere/else foo/bar
>> $ cd foo/bar; ls; cd ..
^^^^^
The magic happens here. cd is a shell builtin that behaves differently
depending on your shell.
>> thing
>> $ pwd
>> /home/mjtg/somewhere <<<<<<< doesn't look like foo to me
> Solaris 2.5.1, bash 2.00.0(1)
> $ mkdir somewhere
> $ mkdir somewhere/else
> $ touch somewhere/else/thing
> $ mkdir foo
> $ ln -s ../somewhere/else foo/bar
> $ cd foo/bar; ls; cd ..
> thing
> $ pwd
> /nfs1/home/abigail/foo <<<<<<< look like foo to me
bash is treating symlinks like regular directories, whereas sh is just
calling chdir(). I *strongly* prefer the former behavior from an
interactive shell and the latter behavior from a program, usually. And
generally that's exactly what I get, since chdir() doesn't do this sort of
magic.
I don't know precisely how to change this behavior in bash, but in tcsh
it's controlled by the symlinks shell variable. To get the behavior
Abigail gets with bash, one does:
set symlinks = ignore
(which happens to be in my .cshrc.)
--
#!/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: 26 Jul 1997 17:07:09 -0700
From: Randal Schwartz <merlyn@stonehenge.com>
To: clay@panix.com (Clay Irving)
Subject: Re: Newbie: How do you call gzip from perl?
Message-Id: <8c67txgxxu.fsf@gadget.cscaper.com>
>>>>> "Clay" == Clay Irving <clay@panix.com> writes:
Clay> Could it be as simple as:
Clay> `gzip myfile.txt`;
Please don't use `` in a void context. It hurts my eyes, as well as
offending my sensibilties.
This should be:
system "gzip", "myfile.txt";
print "Just another Perl hacker," # but not what the media calls "hacker!" :-)
## legal fund: $20,495.69 collected, $182,159.85 spent; just 401 more days
## before I go to *prison* for 90 days; email fund@stonehenge.com for details
--
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@ora.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me
------------------------------
Date: Fri, 25 Jul 1997 09:29:24 -0400
From: Glenn West <westxga@ptsc.slg.eds.com>
Subject: Re: Perl - shell - Perl
Message-Id: <33D8AA34.3CB1@ptsc.slg.eds.com>
Jasper wrote:
>
> Hi
>
> I just started coding in Perl and I want to know how to get a value
> back from a shell if I'm executing a shell from perl.
>
> For example, if I were to write completely in shell script, I would
> write
>
> no_of_rec=`isql <<.
> select @a=count(*) from tableA
> print @a
> .
> `
>
> How would I do this in Perl ? I want the value of no_of_rec ??
>
> Any help would be greatly appreciated !
>
> Thanks.
>
> - Jasper.
>
> -------------------==== Posted via Deja News ====-----------------------
> http://www.dejanews.com/ Search, Read, Post to Usenet
Add a dollar sign to the beginning of no_of_rec...
------------------------------
Date: Sat, 26 Jul 97 20:03:31 GMT
From: gnielson@charlotte.infi.net (Gary Nielson)
Subject: Re: Perl script to serve up different HTML pages at different times of day
Message-Id: <5rdl7n$3cp$1@nw003.infi.net>
This is great. However, I have encountered another problem in that the pages I
am pointing to are on a remote server that will produce co-branded pages based
on whether or not the link is from our Web site. It checks to see if they are
coming from www.charlotte.com, then produces a page with our logo on it.
However, this does not work with perl scripts. Is there any workaround to
this?
In article <33D8ECD0.4FA00F75@enteract.com>, Eryq <eryq@enteract.com> wrote:
>Gary Nielson wrote:
>>
>> I am looking for a perl script that can, depending on the time of day, take
>> the user to a different HTML page. Does anyone know of such a script and
>> where I might find it? Any help much appreciated.
>>
>> Gary Nielson
>
>This will do it, based on the local time at the
>SERVER site. To do it by the time where the USER
>is is another matter entirely.
>
>
>#!/usr/bin/perl -Tw
>
>my @parts = localtime(time);
>my $hour = $parts[2];
>my $url;
>
>if ($hour <= 12) { # morning
> $url = "/morning";
>}
>elsif ($hour <= 16) { # afternoon
> $url = "/afternoon";
>}
>else { # night
> $url = "/night";
>}
>print "Location: $url\n\n";
>1;
>
>
>--
> ___ _ _ _ _ ___ _ Eryq (eryq@enteract.com)
> / _ \| '_| | | |/ _ ' / Hughes STX, NASA/Goddard Space Flight Cntr.
>| __/| | | |_| | |_| | http://www.enteract.com/~eryq
> \___||_| \__, |\__, |___/\ Visit STREETWISE, Chicago's newspaper by/
> |___/ |______/ of the homeless: http://www.streetwise.org
------------------------------
Date: Sat, 26 Jul 1997 17:13:59 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Burt Lewis <burt@ici.net>
Subject: Re: Removing Carriage Returns???
Message-Id: <Pine.GSO.3.96.970726170916.28794A-100000@kelly.teleport.com>
On 26 Jul 1997, Burt Lewis wrote:
> I have a script that's reading the input from an HTML form and I can't
> seem to remove ALL of the carriage returns.
> print "<TR><TD><textarea Rows=8 Cols=65 name=\"body\"
> wrap=phsical></textarea></TD></TR>\n";
It would be helpful if we could see the code you're using which attempts
to remove carriage returns. (But it would help not to see any other code.)
The code which you posted doesn't seem to be relevant, unless you're
saying that that line of test has an extra carriage return which you want
removed. In which case...
print qq{<TR><TD><textarea Rows=8 Cols=65 name="body" },
qq{wrap=phsical></textarea></TD></TR>\n};
(Is that word supposed to be spelled 'phsical'?) Hope this helps!
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: 26 Jul 1997 16:58:14 -0700
From: Randal Schwartz <merlyn@stonehenge.com>
To: bart.mediamind@tornado.be (Bart Lateur)
Subject: Re: Too many people in this group are arrogant #*(@# (Re: Checking for valid Email...)
Message-Id: <8c90ytgycp.fsf@gadget.cscaper.com>
>>>>> "Bart" == Bart Lateur <bart.mediamind@tornado.be> writes:
Bart> I love Perl, but I do not like this newsgroup.
Bart> When retrieving new headers, I automatically download all postings by
Bart> Randal. I like his style. I hardly even bother to look at the rest of
Bart> the postings.
Bart> So it IS possible to be a Perl guru without being a prick.
Hmm. Go back with Dejanews for a while then. I've *had* my moments
when the moonphase tugs on the few sane parts of my brain left and
causes me to become a raving idiot flaming anything exactly to my
liking.
Or over to comp.infosystems.www.authoring.cgi where I got into a
little skirmish with a guy because he insisted that flocking wasn't
necessary because *he* has never been burned. And that he doesn't
mind reinventing the same wheel over and over again (even when he gets
it wrong) because he still "learns something". Ouch. I hope I never
have to work with him on a project team.
Or, hang out on EFNET-IRC's #perl channel and see what I say when
someone starts asking CGI questions there (#perl is a non-web Perl
channel ONLY!)
Yes. I have my moments. :-)
Much of the current problem with this newsgroup (and most others) can
be described in two sentences:
(1) Netscape's POST button
(2) "Sign up for [this] ISP for 30 days free!"
Just an opinion from someone who has been around since the start...
print "Just another Perl hacker," # but not what the media calls "hacker!" :-)
## legal fund: $20,495.69 collected, $182,159.85 spent; just 401 more days
## before I go to *prison* for 90 days; email fund@stonehenge.com for details
--
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@ora.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me
------------------------------
Date: Sun, 27 Jul 1997 01:34:40 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Too many people in this group are arrogant #*(@# (Re: Checking for valid Email...)
Message-Id: <EDyF1s.HuJ@nonexistent.com>
Mike Stok (mike@stok.co.uk) wrote on 1425 September 1993 in
<URL: news:5rd19h$77h@news-central.tiac.net>:
++ In article <EDx2s4.93y@nonexistent.com>, Abigail <abigail@fnx.com> wrote:
++ >Mike Stok (mike@stok.co.uk) wrote on 1425 September 1993 in
++
++ >++ As long as he learns to fish before he starves :-) Where's the harm in
++ >++ giving him a fish and offering him pointers on learning too?
++
++ >A lot if the best fishermen leave. That leaves the man with
++ >rotten fish, and a lousy technique.
++
++ I think that for most people technique is secondary to getting the job
++ done. The first sentence in the preface to the second edition of
++ Programming Perl is
++
++ Perl is a language for getting your job done.
++
++ If rotten technique allows you to catch enough fish to develop and learn
++ good technique then so be it. My view is that you catch more files with
++ honey than vinegar, and it's one out of many possible views.
But if the good fishermen leave, *all* the men get rotten fish and a
lousy technique. And while you might like the taste of rotten fish, and
don't mind a lousy technique, your neighbours might prefer good fish,
and need a good technique.
Abigail
--
perl5.004 -wMMath::BigInt -e'$^V=new Math::BigInt+qq;$^F$^W783$[$%9889$^F47$|88768$^W596577669$%$^W5$^F3364$[$^W$^F$|838747$[8889739$%$|$^F673$%$^W98$^F76777$=56;;$^U=$]*(q.25..($^W=@^V))=>do{print+chr$^V%$^U;$^V/=$^U}while$^V!=$^W'
------------------------------
Date: 26 Jul 1997 18:41:53 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: Using perl to copy JPG files
Message-Id: <5rdgdh$r13@fridge-nf0.shore.net>
Rick Bell (rbell@i4internet.com.au) wrote:
: I am trying to write a program that will read a binary file (jpg or gif)
: and copy it to another new file all using perl. This is my first part
[snip]
Use the File::Copy module - it should have been included with your
Perl distribution. If Perl and the manpages have been installed
correctly on your system, do: man File::Copy, or perldoc File::Copy.
: of a grander plan to take jpg files as input and write out to a database
: with a few extra fields - eventual result to look like a database with
: the following record structure (obviously variable length records)
Are you sure you want to do it this way? I hope you're implementing
this for a small department, or you're going to expend an awful lot of
tablespace. :-) Why not just use a reference to the location of the
image?
--
Nathan V. Patwardhan
nvp@shore.net
------------------------------
Date: 26 Jul 1997 18:55:01 GMT
From: stampes@xilinx.com (Jeff Stampes)
Subject: Re: Using perl to copy JPG files
Message-Id: <5rdh65$d4i$1@neocad.com>
Rick Bell (rbell@i4internet.com.au) wrote:
: #!/usr/bin/perl
Always use -w. Always use -w. Always use -w.
: # Declare file locations
: $infile = "1.jpg";
: $outfile = "new.jpg";
: # Force automatic flushing
: $|=1;
: binmode($infile);
: binmode($outfile);
: open( INFILE,"<$infile" ) || die "can't open $infile: $!\n";
: @thephoto = <INFILE>; # read the whole file
: open( OUTFILE, '>new.jpg' ) || die "can't open $outfile: $!\n";
: print OUTFILE $thephoto;
Ohhhh....so close!
print OUTFILE @thephoto;
that should work a lot better...yup...just tested it, works fine.
HTH,
Jeff
--
Jeff Stampes -- Xilinx, Inc. -- Boulder, CO -- jeff.stampes@xilinx.com
------------------------------
Date: Sat, 26 Jul 1997 15:38:34 -0400
From: jamie <jamie@comet.net>
Subject: www.perl.com?
Message-Id: <Pine.BSF.3.95.970726153626.3510B-100000@atlas.comet.net>
Has anyone else been having difficulty hitting www.perl.com?
Pings are returning 100% packet loss from two different networks.
jamie jamie@comet.net
***************************************************************************
For PGP public key, mail me with Subject:GET KEY
For random Ambrose Bierce quote, Mail me with Subject: ambrose
Support the anti-Spam amendment - Join at http://www.cauce.org/
"Microsoft was invented by domestic terrorists. Remember, it's
no longer an import industry."
------------------------------
Date: 26 Jul 1997 17:16:16 -0700
From: Randal Schwartz <merlyn@stonehenge.com>
To: jamie <jamie@comet.net>
Subject: Re: www.perl.com?
Message-Id: <8c3ep1gxin.fsf@gadget.cscaper.com>
>>>>> "jamie" == jamie <jamie@comet.net> writes:
jamie> Has anyone else been having difficulty hitting www.perl.com?
jamie> Pings are returning 100% packet loss from two different networks.
www.perl.com recently changed its address. You may still be hitting
the old address. (Tom didn't understand what "TTL" means until I
talked to him yesterday... and he was most displeased... :-)
print "Just another Perl hacker," # but not what the media calls "hacker!" :-)
## legal fund: $20,495.69 collected, $182,159.85 spent; just 401 more days
## before I go to *prison* for 90 days; email fund@stonehenge.com for details
--
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@ora.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me
------------------------------
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 783
*************************************