[11854] in Perl-Users-Digest
Perl-Users Digest, Issue: 5454 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Apr 22 14:07:27 1999
Date: Thu, 22 Apr 99 11:00:18 -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 Thu, 22 Apr 1999 Volume: 8 Number: 5454
Today's topics:
Re: cheap perl scripts <dgris@moiraine.dimensional.com>
Error 2 during "make install" <mflaherty2@earthlink.net>
Re: FAQ 4.14: How can I find the Julian Day? <cassell@mail.cor.epa.gov>
Re: FAQ 4.15: How do I find yesterday's date? <uri@sysarch.com>
Re: FAQ 4.15: How do I find yesterday's date? <cassell@mail.cor.epa.gov>
Re: FAQ 4.15: How do I find yesterday's date? (Bernie Cosell)
how do you pass hashes to functions? <obinani@popd.ix.netcom.com>
How to read the modification date of a file? <howitgolook@my-dejanews.com>
How to run scripts that need to touch system files? <lcalero@gsyc.inf.uc3m.es>
Re: Illegal seek (this makes no sense to me =) (Clinton Pierce)
Re: Illegal seek (this makes no sense to me =) phukit@enteract.com
Re: Is it possible to have "..." appear while processin <vallon@bear.com>
Re: Is there a shorter way? <uri@sysarch.com>
Re: last item in associative array. <juex@my-dejanews.com>
Re: last item in associative array. (Larry Rosler)
Re: NT/Processes/IDs <ukirazci@fore.com>
Re: NT/Processes/IDs <gregm@well.com>
Re: Perl & CGI Sites Needed <cassell@mail.cor.epa.gov>
PERL and HTTP links <pmgeahan@mtu.edu>
Re: PERL and HTTP links (Clinton Pierce)
Re: Reading C binary data from disk (Larry Rosler)
Sending binary values? (Neil Cherry)
Re: Telnet problems scott@sboss.net
Re: The Future of Tk? <robin@jessikat.demon.co.uk>
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 22 Apr 1999 11:26:58 -0600
From: Daniel Grisinger <dgris@moiraine.dimensional.com>
Subject: Re: cheap perl scripts
Message-Id: <m3emlca7ml.fsf@moiraine.dimensional.com>
pejman@pejman.com writes:
> I am looking for somebody, who can write me some small perl scripts
> for small amount of money.
Why do I have this sneaking suspicion that your definition of
`small amount of money' is probably very different from me
definition of `small amount of money'? Especially where writing
code is concerned.
dgris
--
Daniel Grisinger dgris@moiraine.dimensional.com
perl -Mre=eval -e'$_=shift;;@[=split//;;$,=qq;\n;;;print
m;(.{$-}(?{$-++}));,q;;while$-<=@[;;' 'Just Another Perl Hacker'
------------------------------
Date: Thu, 22 Apr 1999 13:19:06 -0400
From: "Mike Flaherty" <mflaherty2@earthlink.net>
Subject: Error 2 during "make install"
Message-Id: <7fnlke$nbp$1@holly.prod.itd.earthlink.net>
I tried installing perl 5.005_03 on Solaris 2.6.
I did...
1) rm -f config.sh Policy.sh (weren't there to begin with)
2) sh .Configure
3) make
4) make test
5) make install - then I got the following error...
sparky# make install
AutoSplitting perl library
./miniperl -Ilib -e 'use AutoSplit; \
autosplit_lib_modules(@ARGV)' lib/*.pm lib/*/*.pm
Making DynaLoader (static)
make[1]: Entering directory `/scratch/perl5.005_03/ext/DynaLoader'
make[1]: Leaving directory `/scratch/perl5.005_03/ext/DynaLoader'
make[1]: Entering directory `/scratch/perl5.005_03/ext/DynaLoader'
rm -rf ../../lib/auto/DynaLoader/DynaLoader.a
ar cr ../../lib/auto/DynaLoader/DynaLoader.a DynaLoader.o && :
../../lib/auto/DynaLoader/DynaLoader.a
/bin/sh: ar: not found
make[1]: *** [../../lib/auto/DynaLoader/DynaLoader.a] Error 1
make[1]: Leaving directory `/scratch/perl5.005_03/ext/DynaLoader'
make: *** [lib/auto/DynaLoader/DynaLoader.a] Error 2
sparky#
Thanks in Advance,
Mike Flaherty
Westwood, MA
------------------------------
Date: Thu, 22 Apr 1999 10:19:43 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: FAQ 4.14: How can I find the Julian Day?
Message-Id: <371F5A2F.D514AE6E@mail.cor.epa.gov>
Tom Christiansen wrote:
>
> (This excerpt from perlfaq4 - Data Manipulation
> ($Revision: 1.46 $, $Date: 1999/04/20 18:59:53 $)
> part of the standard set of documentation included with every
> valid Perl distribution, like the one on your system.
> See also http://language.perl.com/newdocs/pod/perlfaq4.html
> if your negligent system adminstrator has been remiss in his duties.)
>
> How can I find the Julian Day?
>
> Neither Date::Manip nor Date::Calc deal with Julian days. Instead,
> there is an example of Julian date calculation that should help you
> in
> http://www.perl.com/CPAN/authors/David_Muir_Sharnoff/modules/Time/J
> ulianDay.pm.gz .
Okay, I've seen this request several times in this newsgroup since,
say, February. Are these people *really* interested in this, or do
you think the problem is that they don't understand what the Julian Day
really is?
Are they really just interested in a way of getting serial days so
that they can do date arithmetic? If so, then are we doing them a
disservice by not pointing out the issue? Something like:
If you are interested in performing date arithmetic, this can
be done using either Date::Manip or Date::Calc, without
converting to Julian Day first.
Just wondering,
David
--
David Cassell, OAO
cassell@mail.cor.epa.gov
Senior Computing Specialist phone: (541)
754-4468
mathematical statistician fax: (541)
754-4716
------------------------------
Date: 22 Apr 1999 13:01:50 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: FAQ 4.15: How do I find yesterday's date?
Message-Id: <x7d80wd1xd.fsf@home.sysarch.com>
>>>>> "PN" == Philip Newton <Philip.Newton@datenrevision.de> writes:
PN> Tom Christiansen wrote:
>>
>> How do I find yesterday's date?
>>
>> The `time()' function returns the current time in seconds since the
>> epoch. Take one day off that:
>>
>> $yesterday = time() - ( 24 * 60 * 60 );
PN> Not daylight saving time safe, if I understand it correctly. At the
PN> transition to and from DST, days are 23 and 25 hours long.
PN> So you might, possibly, get today's date or the-day-before-yesterday's
PN> date out of this function.
i wrote some code to do repeated date stuff, and what i did was to use
localtime to get todays date info, and then use timelocal at noon to get
a new time value (today at noon). then i did the calculations for other
dates with deltas of seconds per day. this skips any DST problems.
uri
--
Uri Guttman ----------------- SYStems ARCHitecture and Software Engineering
uri@sysarch.com --------------------------- Perl, Internet, UNIX Consulting
Have Perl, Will Travel ----------------------------- http://www.sysarch.com
The Best Search Engine on the Net ------------- http://www.northernlight.com
------------------------------
Date: Thu, 22 Apr 1999 10:29:16 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: FAQ 4.15: How do I find yesterday's date?
Message-Id: <371F5C6C.A25AB3C@mail.cor.epa.gov>
Philip Newton wrote:
>
> Tom Christiansen wrote:
> > [snip]
> > $yesterday = time() - ( 24 * 60 * 60 );
>
> Not daylight saving time safe, if I understand it correctly. At the
> transition to and from DST, days are 23 and 25 hours long.
>
> So you might, possibly, get today's date or the-day-before-yesterday's
> date out of this function.
Perhaps Larry Rosler would like to contribute his DST-safe version
to the FAQ? I think he already sent a copy to Dan Grisinger's
script archive...
David
--
David Cassell, OAO
cassell@mail.cor.epa.gov
Senior Computing Specialist phone: (541)
754-4468
mathematical statistician fax: (541)
754-4716
------------------------------
Date: Thu, 22 Apr 1999 17:45:53 GMT
From: bernie@fantasyfarm.com (Bernie Cosell)
Subject: Re: FAQ 4.15: How do I find yesterday's date?
Message-Id: <371f5ef9.148585779@news.supernews.com>
Tom Christiansen <perlfaq-suggestions@perl.com> wrote:
} How do I find yesterday's date?
}
} The `time()' function returns the current time in seconds since the
} epoch. Take one day off that:
}
} $yesterday = time() - ( 24 * 60 * 60 );
}
} Then you can pass this to `localtime()' and get the individual
} year, month, day, hour, minute, seconds values.
This isn't quite correct. There is an ugly-to-program-around problem
dealing with daylight savings time. The problem is fairly limited: only
arises if you happen to be running your program right after midnight (local
time) of the day after the change *to* daylight savings time (so it is
daylight savings time now, but was *not* daylight savings time yesterday at
this time). In that case, subtracting 24 hrs from the current time will
get you to right after 11PM *two*days*ago*, not -yesterday-. Maybe an
algorithm that only fails for one hour per year is "close enough"...:o)
You have the same problem in the opposite direction if you're trying to
figure out the date for tomorrow at the other DST-time-switch.
/Bernie\
--
Bernie Cosell Fantasy Farm Fibers
bernie@fantasyfarm.com Pearisburg, VA
--> Too many people, too few sheep <--
------------------------------
Date: Thu, 22 Apr 1999 12:58:38 -0400
From: "Dunn One" <obinani@popd.ix.netcom.com>
Subject: how do you pass hashes to functions?
Message-Id: <7fnkfc$4pc@dfw-ixnews10.ix.netcom.com>
I've been trying this and it just doesn't work. Can anyone please help?
do you use type glob? When I tried to pass the typeglob argument to the keys
function, I got an error. Please help. Thanks.
------------------------------
Date: Thu, 22 Apr 1999 17:30:06 GMT
From: howitgolook <howitgolook@my-dejanews.com>
Subject: How to read the modification date of a file?
Message-Id: <7fnman$qgl$1@nnrp1.dejanews.com>
How can I determine the modification date of a file on a remote server?
I am indexing a web site for use in a search engine, and I need to be able to
check if a page has been modified before updating its record in the database.
Thanks in advance.
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Thu, 22 Apr 1999 17:44:05 +0000
From: Luis Calero Munoz <lcalero@gsyc.inf.uc3m.es>
Subject: How to run scripts that need to touch system files?
Message-Id: <Pine.LNX.3.96.990422174311.12708F-100000@av.lab.inf.uc3m.es>
Hi!
I'm writing a CGI that needs to write to system files but the thing
is that I don't want to make it 4755 because it seems it too
insecure. I've read that suidperl could be a solution, but I haven't
found info about it ( man suidperl doesn't help ) and don't know how
to set it up... anyone knows how to run it?
Besides, any help about how to do this thing without being so
dangerous??
Thanx in advance...
--
Luis Calero Mu~noz lcalero@gsyc.inf.uc3m.es
Grupo de Sistemas y Comunicaciones a01-unix.gsyc.inf.uc3m.es/~lcalero
GSyC - Univ. Carlos III de Madrid PGP public key available @ web
------------------------------
Date: Thu, 22 Apr 1999 16:32:36 GMT
From: cpierce1@ford.com (Clinton Pierce)
Subject: Re: Illegal seek (this makes no sense to me =)
Message-Id: <372c4ed5.1909147028@news.ford.com>
[poster cc'd in e-mail]
On 22 Apr 1999 16:02:20 GMT, phukit@enteract.com wrote:
>Ok, I'm completely stumped on this one. All I'm trying to do is have
>part of my script open sendmail, pipe some mail through and then close
>sendmail.
> &ddebug("DEBUG 2 $!\n");
> open SENDMAIL, "|/usr/sbin/sendmail my\@email.address";
> &ddebug("DEBUG 3 $!\n");
Unless the open() fails, the contents of $! are indetermininate. Don't
use $! to test the success or failure of UNIX system calls.
--
Clinton A. Pierce "If you rush a Miracle Man, you get rotten
clintp@geeksalad.org Miracles." -- Miracle Max, The Princess Bride
http://www.geeksalad.org
------------------------------
Date: 22 Apr 1999 17:10:00 GMT
From: phukit@enteract.com
Subject: Re: Illegal seek (this makes no sense to me =)
Message-Id: <7fnl58$l51$1@eve.enteract.com>
Clinton Pierce <cpierce1@ford.com> wrote:
> Unless the open() fails, the contents of $! are indetermininate. Don't
> use $! to test the success or failure of UNIX system calls.
It doesn't outright fail, but when it closes <SENDMAIL> /usr/sbin/sendmail
never gets run. That "Illegal Seek" error is the only indication I have
that something happens between the open and close.
------------------------------
Date: Thu, 22 Apr 1999 17:46:52 GMT
From: Justin Vallon <vallon@bear.com>
Subject: Re: Is it possible to have "..." appear while processing?
Message-Id: <x6eyajkwnsj.fsf@pearl.bear.com>
Tom Christiansen <tchrist@mox.perl.com> writes:
> Actually, the French answer to positive questions in "oui", but to
> negatives is "si". So, "Shall I delete your file?" (rendered into French,
> of course) gets "oui" or "non", but "Shall I not delete your file?"
> gets "si" or "non".
French aside, I believe this question would be poorly phrased. Such a
question is typically presented as a confirmation of an action to be
performed. The question should ask "Do blah-blah?" with a "Go" and
"Stop" type of answer.
Put another way, "No" would result in an implicit double negative "No,
you should not not delete my file", which may be technically correct
English, but would definately be bad style.
Of course, strict translation would require si/non.
Gee. These threads really do wander.
--
-Justin
vallon@bear.com
------------------------------
Date: 22 Apr 1999 13:29:58 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Is there a shorter way?
Message-Id: <x7aew0d0mh.fsf@home.sysarch.com>
>>>>> "p" == pingouino <pingouino@my-dejanews.com> writes:
p> Some friends of mine at work accidentally got into a little "challenge";
p> we implemented the same piece of code in different ways, then started
p> seeing who could do it in fewest characters. The task was to print out
p> an environment variable (in this case, USER) padded out to a minimum of
p> six characters with "x", or not modified if it was six characters or more.
p> So, "foo" becomes "fooxxx", "foos" becomes "foosxx", "foobar" remains
p> "foobar" and "foobars" remains "foobars" (note how the 7-letter word is
p> not truncated).
p> The best we came up with (with all unnnecessary spaces removed) was:
p> perl -e'$_=$ENV{USER};print$_."x"x(6-split//)'
you don't mention any rules about counting option letters or shell
tricks.
so this perl code is 2 perl chars shorter. if i could find a way to close <>
without the echo i would do that. also it assumes no spaces in a
username which is reasonable.
echo '' | perl -pe '$_=sprintf"%-6s",$ENV{USER};y/ /x/'
uri
--
Uri Guttman ----------------- SYStems ARCHitecture and Software Engineering
uri@sysarch.com --------------------------- Perl, Internet, UNIX Consulting
Have Perl, Will Travel ----------------------------- http://www.sysarch.com
The Best Search Engine on the Net ------------- http://www.northernlight.com
------------------------------
Date: Thu, 22 Apr 1999 10:02:52 -0700
From: "J|rgen Exner" <juex@my-dejanews.com>
Subject: Re: last item in associative array.
Message-Id: <7fnkl7$b6i@news.dns.microsoft.com>
Jay Glascoe <jglascoe@giss.nasa.gov> wrote in message
news:371E3C3F.DCB1DCA2@giss.nasa.gov...
> Multimax wrote:
> >
> > How can I find the last item in an associative array?
>
> hashes are unordered, so the term "last" cannot be
> meaningfully applied to them.
Coming to think about it this is not entirely true.
Hashes as well as arrays are mappings from a domain into a codomain.
The only difference is, that for arrays the domain is limited to a subset of
the natural numbers, starting at 0.
Therefore we imply that the first element of an array is the element with
the smallest index and the last element is the element with the largest
index (where again small and large are based on our every-day ordering(!!)
or the natural numbers).
Hashes are nothing more than generalized arrays. So you can apply the same
idea to hashes, too. All you have to change is that you have to generalize
the ordering, too.
To get the last element of a hash "myhash" using the ordering function
"mysort" use
%myhash{pop(sort (mysort, (keys %myhash)))}
(not sure if the syntax is accurate, but you got the idea).
However, maybe this is not exactly what the original poster had in mind.
jue
--
J|rgen Exner
------------------------------
Date: Thu, 22 Apr 1999 10:54:37 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: last item in associative array.
Message-Id: <MPG.1189023b37376d59989912@nntp.hpl.hp.com>
[Posted and a courtesy copy mailed.]
In article <7fnkl7$b6i@news.dns.microsoft.com> on Thu, 22 Apr 1999
10:02:52 -0700, J|rgen Exner <juex@my-dejanews.com> says...
...
> To get the last element of a hash "myhash" using the ordering function
> "mysort" use
>
> %myhash{pop(sort (mysort, (keys %myhash)))}
>
> (not sure if the syntax is accurate, but you got the idea).
pop() works on arrays, not lists. And an element of a hash is a scalar.
So:
$myhash{(sort mysort keys %myhash)[-1]}
produces the 'largest' element in the hash according to some criterion.
Whether or not that is the 'last' element is debatable, as you say. I
interpreted it as the last value added to the hash.
--
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Thu, 22 Apr 1999 17:43:28 GMT
From: "Ulas Kirazci" <ukirazci@fore.com>
Subject: Re: NT/Processes/IDs
Message-Id: <01be8ce7$14d2dcd0$7201000a@kirazci>
tlist [/t]
ulas
Susanne Schmidt <banshee@zedat.fu-berlin.de> wrote in article
<7fncbk$574$2@fu-berlin.de>...
> Hello all,
> i have to solve a problem under Win-NT within a perlscript: a perlscript
> should be scheduled from "at" at xx o`clock - but only if the run before
> is not still running. I can`t calculate the time for one script-run, so i
> have to look for the running process - how to do that under NT ?! (i just
> know UNIX..) Is there any module for showing running processes ? Does NT
> have processes ? ;) can i get them as a list? send signals ? GET AN ID ?
:)
>
> Maybe it`s the complete wrong idea - where do i have to look ?
>
> Thank you for any idea!
>
> Susanne
>
> --
> Frauen sagen "ja" zu Linux!
> banshee@linux.de
>
------------------------------
Date: Thu, 22 Apr 1999 10:41:09 -0700
From: Greg McCann <gregm@well.com>
Subject: Re: NT/Processes/IDs
Message-Id: <371F5F35.D8514798@well.com>
Susanne Schmidt wrote:
>
> Hello all,
> i have to solve a problem under Win-NT within a perlscript: a perlscript
> should be scheduled from "at" at xx o`clock - but only if the run before
> is not still running. I can`t calculate the time for one script-run, so i
> have to look for the running process - how to do that under NT ?! (i just
> know UNIX..) Is there any module for showing running processes ? Does NT
> have processes ? ;) can i get them as a list? send signals ? GET AN ID ? :)
I don't know how to get at the NT PIDs, but how about a workaround? When your
process starts, write an "I'm running now" flag file to disk, and then delete it
when you are finished. When you want to start your second process, just check
for the existence of the flag file and proceed accordingly.
Of course there must be some way to do it, since you can see the list of all
current NT PIDs in the Task Manager, but a quick check of my Perl docs,
including the Win32 Resource Kit, doesn't reveal any way to do it in Perl.
Greg
------------------------------
Date: Thu, 22 Apr 1999 10:26:33 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Perl & CGI Sites Needed
Message-Id: <371F5BC9.BF5F36A1@mail.cor.epa.gov>
Planet CGI wrote:
>
> Perl & CGI Sites Needed
>
> If you own or operate a Perl or CGI related web site, you may now receive
> free banner advertising to increase traffic to your site by joining the
> Planet CGI Banner Exchange.
And I quote: "What a bargain for me!"
> This banner exchange is similar to other banner exchanges such as the Link
> Exchange, but is reserved only for Perl or CGI related web sites.
>
> To join, go to:
> [SNIP]
See Tad? Like I said. "Perl" == "CGI" [sic]
Everyone out there knows this except us, apparently.
HAND,
David
--
David Cassell, OAO
cassell@mail.cor.epa.gov
Senior Computing Specialist phone: (541)
754-4468
mathematical statistician fax: (541)
754-4716
------------------------------
Date: 22 Apr 1999 16:57:52 GMT
From: Patrick M. Geahan <pmgeahan@mtu.edu>
Subject: PERL and HTTP links
Message-Id: <7fnkeg$5h$1@campus1.mtu.edu>
QuestioN:
I'd like to set up a sort of anonymizer. The place I work keeps a firewall
that keeps track of all hits - i.e., telnet counts as one, but each HTTP
hit counts as one, as well. I'd like to write a CGI script tfor my home
Linux box. That way, I can load up a certain page, enter something into a
text box, and have the page load that URL. However, the unfortunate
problem comes when I click on a link in the page I load. It'll be in a
frame, using the lower part of the original we b page. When I click on a
link, it'll go out through the firewall. Can anyone think of a way that I
could get around this, and have the CGI script load up pages tha tare
link-clicked, as well?
--
________________________________________________________________
Patrick "I'm a graphical cheek ant" Geahan
pmgeahan@mtu.edu ICQ:3784715 http://www.csl.mtu.edu/~pmgeahan
patman@teamknightrider.com patgeahan@home.com
------------------------------
Date: Thu, 22 Apr 1999 17:34:23 GMT
From: cpierce1@ford.com (Clinton Pierce)
Subject: Re: PERL and HTTP links
Message-Id: <372f5889.1911631080@news.ford.com>
On 22 Apr 1999 16:57:52 GMT, Patrick M. Geahan <pmgeahan@mtu.edu> wrote:
>I'd like to set up a sort of anonymizer. The place I work keeps a firewall
>that keeps track of all hits - i.e., telnet counts as one, but each HTTP
>hit counts as one, as well. I'd like to write a CGI script tfor my home
>Linux box.
Ummm...no moral judgements here...but your employer has a firewall that
keeps track of these things for a purpose, right? Think about your
employers AUP before doing this. :-)
>That way, I can load up a certain page, enter something into a
>text box, and have the page load that URL. However, the unfortunate
>problem comes when I click on a link in the page I load. [...]
You will need to parse the second page and re-write all of its links in
the CGI. It's not hard, but don't post here asking how to do that. It's
an FAQ.
--
Clinton A. Pierce "If you rush a Miracle Man, you get rotten
clintp@geeksalad.org Miracles." -- Miracle Max, The Princess Bride
http://www.geeksalad.org
------------------------------
Date: Thu, 22 Apr 1999 10:01:58 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Reading C binary data from disk
Message-Id: <MPG.1188f5d6c4d8e060989911@nntp.hpl.hp.com>
[Posted and a courtesy copy sent.]
In article <371f42c6@cs.colorado.edu> on 22 Apr 1999 09:39:50 -0700, Tom
Christiansen <tchrist@mox.perl.com> says...
> In comp.lang.perl.misc, lr@hpl.hp.com (Larry Rosler) writes:
> :Don't forget to 'binmode()' the file after opening it and before reading
> :it. Just in case...
>
> Just in case, that is, you should be confined to an infernal system with
> an ancient design flaw, a flaw continually revisited unto the children
> of the tenth generation of those who first sold themselves into servitude
> and bondage.
>
> http://www.io.com/~mccoy/beginning_print.html
Thanks for completing my ellipsis so eloquently. This is your second
rant^H^H^H^Hprose-poem of the week on this subject, near and dear to all
of us.
And thanks for the URL. It will take a load of tuits to read the whole
thing, though.
I wonder if there isn't a design flaw in the read() or sysread()
functions implemented for the Evil Empire. Analogous to C's fread,
shouldn't they automatically give back all the bytes as they exist on
the external medium, instead of converting "\015\012" pairs to "\n"? An
implicit binmode(), in effect, to help eliminate these recurrent bugs.
The line-at-a-time input operators <> and readline() wouldn't be
affected by this change.
Of course, print() would still need binmode() for outputting binary
files.
--
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Thu, 22 Apr 1999 17:56:14 GMT
From: njc@dmc.uucp (Neil Cherry)
Subject: Sending binary values?
Message-Id: <slrn7huorm.6om.njc@dmc.uucp>
First I'm more of an assembly/C language hacker (working under Linux
on an i86 box). I have a feeling that I'm not quite undestanding one
thing in Perl. I've tried to use pack and unpack but I have idea what
I'm getting out of them.
I have an array filled with such:
$a[0] = 0x24;
$a[1] = 0x05;
$a[2] = 0x00;
$a[3] = 0x01;
Now if I attempt to syswrite these values out to a file I get the string:
3501 (0x33 0x35 0x33 0x31)
I want:
!^E^@^A (that 4 character 0x24 0x05 0x00 0x01).
How do I accomplish this (it's driving me nuts)?
BTW I can send "!^E^@^A" but I have no idea how to create the string
(I'm getting this from localtime and need to convert it to a string
with a magic sequence and the the BCD rep of the time values).
--
Linux Home Automation Neil Cherry ncherry@home.net
http://members.home.net/ncherry (Text only)
http://meltingpot.fortunecity.com/lightsey/52 (Graphics GB)
http://www2.cybercities.com/~linuxha/ ( DOWN )
------------------------------
Date: Thu, 22 Apr 1999 17:38:42 GMT
From: scott@sboss.net
Subject: Re: Telnet problems
Message-Id: <7fnmr2$r1q$1@nnrp1.dejanews.com>
In article <371F3C19.DA0F1A30@no.spam.technologist.com>,
Michael Cameron <Michael.Cameron@no.spam.technologist.com> wrote:
> scott@sboss.net wrote:
>
> You do not mention what machine you are using. I used the expect module on
> Solaris and had to change some of the values in the perl headers,
> unfortunately that was some time ago and I no longer ave access to the system
> in question. You might find that you need to tweak a few things for Net:telnet
> too. Failing that you could always implement the same thing using the expect
> module to drive a telnet.
>
> HTH,
>
> Michael
Michael,
Thanks for helping me. I am running the script on a RedHat 5.2 (PII-400)
with the default Perl that comes with RH5.2. I am connecting via the eth0
(3c90x card) to the ethernet to my Sun & HP boxes (all in other states but on
the network - not subnet). Some versions of the program that I am writing
(where I am changing the telnet part of the code over and over again) I get
past the login/password and sometimes I don't. It is always get to the same
place on the same code but when I change the code is when how far I get
changes. _ _ | | [Suns] [Linux]---| | [HPs] 201
subnet|----[Router(s)]---| 245 subnet | | _ _
I can use the telnet command via linux and connect without a problem.
Thanks again,
Scott
>
>
--
Scott Boss
Atlanta Perl Mongers Fearless Leader
website: http://atlanta.pm.org
community: http://www.dejanews.com/~apm
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Thu, 22 Apr 1999 14:22:06 +0100
From: Robin Becker <robin@jessikat.demon.co.uk>
Subject: Re: The Future of Tk?
Message-Id: <4fv$ECA+JyH3EwbN@jessikat.demon.co.uk>
In article <371F11C2.3162025@ciril.fr>, Frederic BONNET
<frederic.bonnet@ciril.fr> writes
>Hi,
>
>Eugene Dragoev wrote:
>[...]
>> But I also found that while older versions of Tk were using lightweight
...
>> Is there going to be any Tk implementation that will continue using
>> lightweight components?
>
>By lightweight I guess you mean emulated in some way. I don't think that
>cross-platform look&feel consistency is a good thing. As a GUI designer
>I'd rather follow the principle of least astonishment: an app running on
>Windows should look and feel like a Windows app. The same app running on
>MacOS and X should do the same on the respective platforms. Such a
>cross-platform application is not supposed to look and feel the same on
>all platforms. If users want to use the same app on several platforms,
...
I take this completely differently; least astonishment for me is if
program X looks and behaves the same way no matter what keyboard, mouse
and screen I'm using. As a 'user' of the program X it shouldn't matter
what OS/WM is executing the code. I certainly don't want vi or emacs to
be different on the mac why should I treat word or excel differently?
Another reason for having a Tk look and feel is that it allows widget
behaviours different from those allowed by the underlying 'convention'.
Of course those with an interest in the survival of rigid wm systems
prefer we should adhere to their conventions. The only changes then come
from the suppler of such systems and are introduced to make us by new
versions etc.
Competition between different WM's is currently almost impossible
because of the original model ie the 'toplevel' is controlled and
decorated by the WM. We don't have to do that with the widgets inside
the 'toplevel' so why do we? Let 100 flowers bloom etc.
...
>And I don't speak about look differences.
>
>See you, Fred
--
Robin Becker
------------------------------
Date: 12 Dec 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Special: Digest Administrivia (Last modified: 12 Dec 98)
Message-Id: <null>
Administrivia:
Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing.
]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body. Majordomo will then send you instructions on how to confirm your
]subscription. This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.
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 5454
**************************************