[16898] in Perl-Users-Digest
Perl-Users Digest, Issue: 4310 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Sep 13 09:10:25 2000
Date: Wed, 13 Sep 2000 06:10:14 -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: <968850614-v9-i4310@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Wed, 13 Sep 2000 Volume: 9 Number: 4310
Today's topics:
Re: Qualifications for new Perl programmer????? <ralawrence@my-deja.com>
Re: Qualifications for new Perl programmer????? <bcaligari@my-deja.com>
Re: Qualifications for new Perl programmer????? <christopher_j@uswest.net>
Redirect URL <joseluis@REMOVEMEferca.com>
Re: returning a tied variable <anders@wall.alweb.dk>
sending multiple attachments <mmcduffy@mathworks.com>
Re: Silly grep tricks (Villy Kruse)
String compression <trinitypark@my-deja.com>
Re: String compression <anders@wall.alweb.dk>
Re: String compression <trinitypark@my-deja.com>
Re: String compression <anders@wall.alweb.dk>
Unix Info scarey_man@my-deja.com
Re: Unix Info <Cheng3@email.msn.com>
Re: Unix Info <Martin.Lohmann@de.bosch.com>
XS compile probs under win32. <I.J.Dash@cs.cf.ac.uk>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 13 Sep 2000 09:05:45 GMT
From: Richard Lawrence <ralawrence@my-deja.com>
Subject: Re: Qualifications for new Perl programmer?????
Message-Id: <8png0v$vvp$1@nnrp1.deja.com>
In article <39BF0FD5.3A4A9325@stomp.stomp.tokyo>,
"Godzilla!" <godzilla@stomp.stomp.tokyo> wrote:
>
> Ahhh.. these are musings on qualifying for employment, not
> personal practices in programming. Best test of a prospective
> employee, for programming, is to have her, or him, write an
> ingenious program of a type, from scratch. Concept is to test
> programming skills, not an ability to copy and paste module
> references and the such. This is no indicator of programming
> skills but rather an indicator of talent with a mouse.
>
Thankfully the IT world does not think like you.
Modules are good, re-inventing the wheel is bad.
Doing it your way would quadruple development times, increase code
complexity and make it horrendiously difficult to maintain (Why debug a
home-grown version of function when a perfectly good one already exists?
What about home-grown versions of a function that look the same as their
"proper" counterparts but actually give slightly different results?).
Its elementary computer science. However I can appreciate that as an
English teacher you probably wouldn't have been taught that.
Rich
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Wed, 13 Sep 2000 09:51:50 GMT
From: Brendon Caligari <bcaligari@my-deja.com>
Subject: Re: Qualifications for new Perl programmer?????
Message-Id: <8pninh$2ss$1@nnrp1.deja.com>
In article <8png0v$vvp$1@nnrp1.deja.com>,
Richard Lawrence <ralawrence@my-deja.com> wrote:
> In article <39BF0FD5.3A4A9325@stomp.stomp.tokyo>,
> "Godzilla!" <godzilla@stomp.stomp.tokyo> wrote:
> >
> > Ahhh.. these are musings on qualifying for employment, not
> > personal practices in programming. Best test of a prospective
> > employee, for programming, is to have her, or him, write an
> > ingenious program of a type, from scratch. Concept is to test
> > programming skills, not an ability to copy and paste module
> > references and the such. This is no indicator of programming
> > skills but rather an indicator of talent with a mouse.
> >
>
> Thankfully the IT world does not think like you.
>
> Modules are good, re-inventing the wheel is bad.
>
> Doing it your way would quadruple development times, increase code
> complexity and make it horrendiously difficult to maintain (Why debug
a
> home-grown version of function when a perfectly good one already
exists?
> What about home-grown versions of a function that look the same as
their
> "proper" counterparts but actually give slightly different results?).
>
> Its elementary computer science. However I can appreciate that as an
> English teacher you probably wouldn't have been taught that.
>
> Rich
Doh....I think any self-respecting programmer does end up with a
portfolio of programs/modules/whatever which he could very well present
at an interview....just like designers/etc. It's stupid asking some 27
year old programmer, with a couple of degrees, and years of experience
to sit for an exam....but then again..what do you expect from a
headmistress.
On the other hands, especially for fun or at some learning stage, one
would want to try to implement some things himself. Some time ago I
wrote some libraries to encode/decode mime (base 64, quoted printable)
jut for the fun of it. i wanted to....went through the RFCs, and had a
couple of days of masochistic pleasure. It is appauling, especially in
this newsgroup how some geniune questions of people trying to tackle a
problem would get replies as "use foo::bar or go jump off a cliff".
That is an attitude typical of MS/VB - "Thou shalt not use thy brain to
think". I remember times when just to process a simple log file
(command line statement using awk) an employer wanted a vb solution,
because "In the Business world it is accepted that VB increases
productivity and Windows interface bla bla bla bla bla"
Brendon
++++
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Wed, 13 Sep 2000 05:06:52 -0700
From: "Christopher M. Jones" <christopher_j@uswest.net>
Subject: Re: Qualifications for new Perl programmer?????
Message-Id: <o5Kv5.376$jd2.26689@news.uswest.net>
"Godzilla!" <godzilla@stomp.stomp.tokyo> wrote:
> Full auto is illegal. However, there are drop in pocket
> machine guns for a snap open AR-15, simple little device
> which fits in a shirt pocket, no bigger than a small comb.
> You just don't get tri-burst ability. It is not illegal
> to own full auto mechanisms, such as a multiple selector,
> a bolt catch release, and an M-16 style bolt. Illegal to
> install them though.
Actually, it is legal to own fully automatic weapons in
the United States. However, this requires that the weapon
be register to the owner in the NFA registry, and a whole
bunch of other stuff (plus state and local regs). Buying
a machine gun also entails a flat $200 (USD) tax for each
weapon and filling out a semi-long form with all your info,
your fingerprints, picture, etc. In most states a law
abiding citizen can fairly easily acquire and legally
own a machine gun.
------------------------------
Date: Wed, 13 Sep 2000 11:37:26 +0200
From: "Jose Luis" <joseluis@REMOVEMEferca.com>
Subject: Redirect URL
Message-Id: <8pnih4$d3h$1@talia.mad.ttd.net>
I want to redirect from a Perl Script to
a PHP script.
The perl script is executing in TELNET.
It's a Cron
i tried this:
print "Location: http://mensajesgratis.com/diferidos.php3 \n\n";
But it only print the line http://mensajesgratis.com/diferidos.php3
in screen. Please Help me.
Thanks. Jose Luis
------------------------------
Date: Wed, 13 Sep 2000 11:15:46 GMT
From: Anders Lund <anders@wall.alweb.dk>
Subject: Re: returning a tied variable
Message-Id: <ClJv5.1161$Tn3.19910@news010.worldonline.dk>
Thom Harp wrote:
> How can I create a variable in a subroutine, tie it to some class and
> return the tied variable?
>
> What I'd *like* to do is something like:
>
> sub tie_variable {
> tie $foo, 'SomeClass';
> return $foo;
> }
>
> $bar = tie_variable;
>
> But that doesn't seem to work. It compiles just fine but $bar isn't
> actually tied.
> thanks for the help...
>
>
return a reference.
sub tie_var {
tie $foo, "aclass":
\$foo;
}
-anders
--
[ the word wall - and the trailing dot - in my email address
is my _fire_wall - protecting me from the criminals abusing usenet]
------------------------------
Date: Wed, 13 Sep 2000 07:19:54 -0400
From: "Megean McDuffy" <mmcduffy@mathworks.com>
Subject: sending multiple attachments
Message-Id: <8pnnsq$eju$1@news.mathworks.com>
Hi,
I'm trying to send an email with multiple attachments from a browser.
I have been sucessful in sending a single attachment using sendmail in my
program, but I can't figure out how to alter it to allow multiple files to
attach. I found something somewhere that suggested using system because the
system version will allow this, but this has puzzled me as well. If anyone
has an idea, please let me know.
Thanks a ton!
Megean
------------------------------
Date: 13 Sep 2000 08:10:21 GMT
From: vek@pharmnl.ohout.pharmapartners.nl (Villy Kruse)
Subject: Re: Silly grep tricks
Message-Id: <slrn8rudjd.p8d.vek@pharmnl.ohout.pharmapartners.nl>
On Tue, 12 Sep 2000 22:07:10 -0500,
Andrew N. McGuire <anmcguire@ce.mediaone.net> wrote:
>On 12 Sep 2000, kj0 quoth:
>
>k> Is there a way to get grep to return only the first item (if any) in a
>k> list for which the test is true?
>
>grep [options] PATTERN [FILE...] | head -1
>
>springs to mind..
>
Especialy if you are a shell programmer instead of a Perl programmer.
In this NG it is rather more likely that the OP was asking about the Perl
function grep, rather than the unix program with the same name.
Villy
------------------------------
Date: Wed, 13 Sep 2000 12:02:47 GMT
From: Trinity Park <trinitypark@my-deja.com>
Subject: String compression
Message-Id: <8pnqcu$b3s$1@nnrp1.deja.com>
My time value is the number of seconds since midnight:
my $time = $localtime[0] + 60 * $localtime[1] + 3600 * $localtime[2];
My date value is the time value at midnight:
@localtime[0, 1, 2] = (0, 0, 0);
my $date = timelocal @localtime;
Here's the problem: I would like to store the date and time
as _separate_ values together in one string, in the minimum
number of bytes possible. By using hexadecimal, the string is
only eight characters long:
my $datetime = sprintf '%.3lx%.5lx', int($date / 86400), $time;
But it could be shorter. For example, if characters G-Z were used
in addition to A-F in a sort of base-36 output (i.e. 16 = G,
33 = X, 34 = Y, 35 = Z, 36 = 10) this would reduce the length even
more. Is there any way in perl to convert a string this way, or is
there a better way to compress the string? Note: I only want
to use printable characters.
thanks/groetjes (to Abigail)/merci (to Bart) - Trinity Park
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Wed, 13 Sep 2000 12:19:15 GMT
From: Anders Lund <anders@wall.alweb.dk>
Subject: Re: String compression
Message-Id: <7hKv5.1187$Tn3.20443@news010.worldonline.dk>
Trinity Park wrote:
> My time value is the number of seconds since midnight:
>
> my $time = $localtime[0] + 60 * $localtime[1] + 3600 * $localtime[2];
>
> My date value is the time value at midnight:
>
> @localtime[0, 1, 2] = (0, 0, 0);
> my $date = timelocal @localtime;
>
> Here's the problem: I would like to store the date and time
> as _separate_ values together in one string, in the minimum
> number of bytes possible. By using hexadecimal, the string is
> only eight characters long:
>
> my $datetime = sprintf '%.3lx%.5lx', int($date / 86400), $time;
>
> But it could be shorter. For example, if characters G-Z were used
> in addition to A-F in a sort of base-36 output (i.e. 16 = G,
> 33 = X, 34 = Y, 35 = Z, 36 = 10) this would reduce the length even
> more. Is there any way in perl to convert a string this way, or is
> there a better way to compress the string? Note: I only want
> to use printable characters.
>
> thanks/groetjes (to Abigail)/merci (to Bart) - Trinity Park
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
pack?
$perldoc -f pack
-anders
--
[ the word wall - and the trailing dot - in my email address
is my _fire_wall - protecting me from the criminals abusing usenet]
------------------------------
Date: Wed, 13 Sep 2000 12:54:21 GMT
From: Trinity Park <trinitypark@my-deja.com>
Subject: Re: String compression
Message-Id: <8pntdj$ej9$1@nnrp1.deja.com>
In article <7hKv5.1187$Tn3.20443@news010.worldonline.dk>,
Anders Lund <anders@wall.alweb.dk> wrote:
> Trinity Park wrote:
>
> > My time value is the number of seconds since midnight:
> >
> > my $time = $localtime[0] + 60 * $localtime[1] + 3600 * $localtime
[2];
> >
> > My date value is the time value at midnight:
> >
> > @localtime[0, 1, 2] = (0, 0, 0);
> > my $date = timelocal @localtime;
> >
> > Here's the problem: I would like to store the date and time
> > as _separate_ values together in one string, in the minimum
> > number of bytes possible. By using hexadecimal, the string is
> > only eight characters long:
> >
> > my $datetime = sprintf '%.3lx%.5lx', int($date / 86400), $time;
> >
> > But it could be shorter. For example, if characters G-Z were used
> > in addition to A-F in a sort of base-36 output (i.e. 16 = G,
> > 33 = X, 34 = Y, 35 = Z, 36 = 10) this would reduce the length even
> > more. Is there any way in perl to convert a string this way, or is
> > there a better way to compress the string? Note: I only want
> > to use printable characters.
> >
> > thanks/groetjes (to Abigail)/merci (to Bart) - Trinity Park
> >
> >
> > Sent via Deja.com http://www.deja.com/
> > Before you buy.
>
> pack?
> $perldoc -f pack
>
> -anders
Hej Anders,
I looked at the pack documentation last night but didn't
really see an appropriate format - note the original
requirement that the strings remain plain text.
However, upon reflection, that may not be strictly
necessary. The output file needs to be easily transferrable
between operating systems (e.g. Unix and WinNT). Would it
cause problems for the first value (date) and second value
(time) to be stored as binary values?
thanks (don't know the Danish word) - Trinity Park
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Wed, 13 Sep 2000 13:04:46 GMT
From: Anders Lund <anders@wall.alweb.dk>
Subject: Re: String compression
Message-Id: <OXKv5.1206$Tn3.20768@news010.worldonline.dk>
Trinity Park wrote:
> In article <7hKv5.1187$Tn3.20443@news010.worldonline.dk>,
> Anders Lund <anders@wall.alweb.dk> wrote:
> > Trinity Park wrote:
> >
> > > My time value is the number of seconds since midnight:
> > >
> > > my $time = $localtime[0] + 60 * $localtime[1] + 3600 * $localtime
> [2];
> > >
> > > My date value is the time value at midnight:
> > >
> > > @localtime[0, 1, 2] = (0, 0, 0);
> > > my $date = timelocal @localtime;
> > >
> > > Here's the problem: I would like to store the date and time
> > > as _separate_ values together in one string, in the minimum
> > > number of bytes possible. By using hexadecimal, the string is
> > > only eight characters long:
> > >
> > > my $datetime = sprintf '%.3lx%.5lx', int($date / 86400), $time;
> > >
> > > But it could be shorter. For example, if characters G-Z were used
> > > in addition to A-F in a sort of base-36 output (i.e. 16 = G,
> > > 33 = X, 34 = Y, 35 = Z, 36 = 10) this would reduce the length even
> > > more. Is there any way in perl to convert a string this way, or is
> > > there a better way to compress the string? Note: I only want
> > > to use printable characters.
> > >
> > > thanks/groetjes (to Abigail)/merci (to Bart) - Trinity Park
> > >
> > >
> > > Sent via Deja.com http://www.deja.com/
> > > Before you buy.
> >
> > pack?
> > $perldoc -f pack
> >
> > -anders
>
> Hej Anders,
>
> I looked at the pack documentation last night but didn't
> really see an appropriate format - note the original
> requirement that the strings remain plain text.
>
> However, upon reflection, that may not be strictly
> necessary. The output file needs to be easily transferrable
> between operating systems (e.g. Unix and WinNT). Would it
> cause problems for the first value (date) and second value
> (time) to be stored as binary values?
>
Assuming that you use perl's unpack to restore the data, I don't see any
problems.
> thanks (don't know the Danish word) - Trinity Park
>
The word is "Tak"
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
-anders
--
[ the word wall - and the trailing dot - in my email address
is my _fire_wall - protecting me from the criminals abusing usenet]
------------------------------
Date: Wed, 13 Sep 2000 11:23:37 GMT
From: scarey_man@my-deja.com
Subject: Unix Info
Message-Id: <8pno3b$8kt$1@nnrp1.deja.com>
Is there an easy way to extract info on a unix box
e.g. Number of CPU's, cpu types, installed memory etc?
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Wed, 13 Sep 2000 07:45:14 -0400
From: "Liang Cheng" <Cheng3@email.msn.com>
Subject: Re: Unix Info
Message-Id: <ubYsVeXHAHA.307@cpmsnbbsa07>
yeah
uname -a
<scarey_man@my-deja.com> wrote in message
news:8pno3b$8kt$1@nnrp1.deja.com...
> Is there an easy way to extract info on a unix box
> e.g. Number of CPU's, cpu types, installed memory etc?
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
------------------------------
Date: Wed, 13 Sep 2000 13:56:58 +0200
From: Martin Lohmann <Martin.Lohmann@de.bosch.com>
Subject: Re: Unix Info
Message-Id: <8pnq3n$i0u$1@proxy.fe.internet.bosch.de>
U can use this commands to get some usefull info :
cat /proc/cpuinfo
top
<scarey_man@my-deja.com> schrieb im Newsbeitrag
news:8pno3b$8kt$1@nnrp1.deja.com...
> Is there an easy way to extract info on a unix box
> e.g. Number of CPU's, cpu types, installed memory etc?
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
------------------------------
Date: Wed, 13 Sep 2000 08:29:15 GMT
From: Ian Dash <I.J.Dash@cs.cf.ac.uk>
Subject: XS compile probs under win32.
Message-Id: <8pndsc$tob$1@nnrp1.deja.com>
Hi,
I'm having problems compiling an XS based extension under perl5005_03
(built from scratch today using CPAN source and MSVC5).
The extension builds absolutely perfectly under Activestate's version
of Perl [build 522], but I am required to port this to the 'pure' build
of perl (as built from the CPAN source) so that I can run the module
under some e-commerce s/w which installs a CPAN build of win32-perl for
it to use :-(
XSubpp runs through the XS fine, and produces the normal modcheck.c
(modcheck being the name of my module)....but as soon as the compiler
tries compiling this I get about ten errors and the rest are pages of
warnings (none of this happens when I build under ActivePerl).
The Errors basically consist of the folllowing:
- Several of 'C2143 - syntax error: missing ';' before 'type'
- Lots of 'C2065 - Undeclared Identifier'
[ALL of the Identifier errors reference the variables defined in
my XSUB as inputs to the C function]
- Lots of 'C4047 - 'char *' differs in level of indirection from 'int'
- Lots of 'warning C4024: Different types for formal and actual
parameter xx'
I am a bit puzzled by all this, I suspect the undeclared ID errors are
something to do with my function defs in the header file for the
external library I'm using, these originally used to have to link from
activestates perl (in C++) to the C based bits of the third party
libary e.g
extern "C" {
void __stdcall function1(param1);
}
but I've tried commenting them out etc to no avail.
I'm a bit lost at the mo - so If anyone has any bright Ideas then I'm
listening :-)
Rather than post lots and lots of files I've put the Source for the
modules (both my original Source for the activestate version - and the
one I've played with to try and get it to work) AND a text file
containing the errors I got up on
http://www.cs.cf.ac.uk/user/I.J.Dash/perlgubbins.html
Thanks in advance,
-=Ian=-
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
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 4310
**************************************