[22965] in Perl-Users-Digest
Perl-Users Digest, Issue: 5185 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Jul 6 18:05:54 2003
Date: Sun, 6 Jul 2003 15:05:06 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Sun, 6 Jul 2003 Volume: 10 Number: 5185
Today's topics:
Another Win32::GuiTest problem <awingnut@hotmail.com>
Re: dynamic sorting <arc_of_descent@gmx.net>
Re: dynamic sorting (Tad McClellan)
Re: file opening <ddunham@redwood.taos.com>
Re: How can I analyse jpg file with perl? <gamelifes@yahoo.com.cn>
Re: How can I analyse jpg file with perl? <nospam@thanksanyway.org>
Re: How can I analyse jpg file with perl? <nospam@thanksanyway.org>
Re: How can I analyse jpg file with perl? <bik.mido@tiscalinet.it>
Re: How to gather the MAC-address <someone@somewhere.nl>
Re: How to gather the MAC-address <wgu_@_wurquhart.co.uk>
HTML::HeadParser to print the title <jidanni@jidanni.org>
Re: HTML::HeadParser to print the title (Tad McClellan)
lookaround (debraj)
Re: lookaround <nobody@dev.null>
Re: lookaround <thehobbit@remove.this.altern.org>
Re: lookaround (Tad McClellan)
Re: Net::POP3 <retoh@cut-here-infocopter.ch>
Re: Net::POP3 <nobody@dev.null>
Re: Net::POP3 <levalt@rogers.com>
Re: Net::POP3 <levalt@rogers.com>
Re: Net::POP3 <spam@thecouch.homeip.net>
Re: pipe - non blocking read? (fork/Win32) (Greg Bacon)
Re: Reading JPEG file <asu1@c-o-r-n-e-l-l.edu>
Who said what (was: globalizing an array) (Cameron Laird)
Re: Who said what (was: globalizing an array) (Al Kossow)
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sun, 06 Jul 2003 10:22:42 -0400
From: gw1500se <awingnut@hotmail.com>
Subject: Another Win32::GuiTest problem
Message-Id: <imbggvcltad8ef080jlmc1i3500qfqjlf6@4ax.com>
I have my script working with one major problem. The SendKeys function
only seems to work if the window is not "iconized" (minimized). For
example:
my $window=FindWindowLike(0,"^mywindowtitle",^*");
SetForegroundWindow($window);
SendKeys("what ever");
This works great unless "mywindowtitle" is minimized and then it is a
NOOP. Can anyone help me on this? TIA.
P.S. Anytime I use "^*" for the class, I get a complaint about
"matches null string many time in regex." Anyone know how to suppress
that?
------------------------------
Date: Sun, 6 Jul 2003 16:33:45 +0530
From: Rohan Romanus Almeida <arc_of_descent@gmx.net>
Subject: Re: dynamic sorting
Message-Id: <20030706163345.2d1dc7f3.arc_of_descent@gmx.net>
tadmc@augustmail.com (Tad McClellan) thus wrote:
> ARAVIND <arawind@yahoo.com> wrote:
>
> > say i have a variable
> > $temp = "ARAVIND 25 BANGALORE";
>
> > @splitval = split /\d /,$temp;
> > then i get
> > $splitval[0] = 'ARAVIND 25';
>
I think the OP has not tested
the demo program well enough.
If all goes well, $splitval[0] should
contain "ARAVIND 2", since the
split will use "5 " as the delimiter.
--
arc_of_descent
------------------------------
Date: Sun, 6 Jul 2003 08:32:16 -0500
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: dynamic sorting
Message-Id: <slrnbgg970.g09.tadmc@magna.augustmail.com>
Rohan Romanus Almeida <arc_of_descent@gmx.net> wrote:
> tadmc@augustmail.com (Tad McClellan) thus wrote:
Your followup did not contain anything that I wrote...
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Sun, 06 Jul 2003 04:55:03 GMT
From: Darren Dunham <ddunham@redwood.taos.com>
Subject: Re: file opening
Message-Id: <HYNNa.274$YA.9974817@newssvr15.news.prodigy.com>
grazz@pobox.com wrote:
> j <john62@electronmail.com> wrote:
>> is there some way to try to open a file in perl such that it will
>> fail if the file exists?
> $ perldoc -f sysopen
> You'd need the O_CREAT and O_EXCL flags, something like:
> sysopen(FH, $path, O_WRONLY|O_CREAT|O_EXCL)
> or die "sysopen: $path: $!";
Note that this depends entirely on the cooperation of the OS and the
filesystem. This is almost always guaranteed to work on a local
filesystem of a UNIX machine. It is not guaranteed to work over NFS.
--
Darren Dunham ddunham@taos.com
Unix System Administrator Taos - The SysAdmin Company
Got some Dr Pepper? San Francisco, CA bay area
< This line left intentionally blank to confuse you. >
------------------------------
Date: Sun, 6 Jul 2003 15:29:31 +0800
From: "bytewolf" <gamelifes@yahoo.com.cn>
Subject: Re: How can I analyse jpg file with perl?
Message-Id: <be8j6u$rrh$1@mail.cn99.com>
Thanks.
The second kind of conjecture of yours is what I want to say...(Plz forgive
my grammar mistake of English:-))
"Jürgen Exner" <jurgenex@hotmail.com> дÈëÓʼþ
news:SXONa.31592$n%5.12164@nwrddc02.gnilink.net...
> bytewolf wrote:
> >> A few days ago,one of my classmate came to my home and saw I was
> > "playing" with perl,so,I told he that perl is very strong,then he
> > maked a jpg file with some words in,and asked me to get this words
> > inside of the jpg file by using perl,
>
> Ok, let me try to understand what you are asking for.
>
> What are those "words" you are talking about. Are those comments which are
> stored in the header of a JPEG file? Then probably one of the modules on
> CPAN can extract this information.
> JPEG::Comment does the reverse (adds a comment to a JPEG file), but I'm
sure
> if you search a bit you will find a module that will extract the comment.
> Image::Info looks quite promising.
>
> Or are you talking about a bitmap (in JPEG format) which when displayed in
a
> viewer shows a pattern that is recognized by the human eye as "words".
> Extracting those "words" is non-trivial and always a good guess at best.
You
> will need a character recognition algorithm/program, commonly known as
OCR.
> I would guess that someone implemented an OCR in Perl already and probably
> you can find it on CPAN, too. Did you check there?
>
> jue
>
>
------------------------------
Date: Sun, 6 Jul 2003 06:16:59 -0700
From: "Mark" <nospam@thanksanyway.org>
Subject: Re: How can I analyse jpg file with perl?
Message-Id: <FaudnVoSwe3UvJWiXTWc-w@speakeasy.net>
"bytewolf" <gamelifes@yahoo.com.cn> wrote:
> Oh~It's a bad idea...I don't...Sending the rubbish mail should bear legal
> responsibility ,I hit spam very much~~
Hmm. . .(mutters suspiciously to himself. . .) well, Ok then. Go ye forth
and use Perl wisely, for the benefit of mankind.
------------------------------
Date: Sun, 6 Jul 2003 06:20:23 -0700
From: "Mark" <nospam@thanksanyway.org>
Subject: Re: How can I analyse jpg file with perl?
Message-Id: <AqudnZ5tE8mIv5WiXTWc-w@speakeasy.net>
"Newbie" <newbie@aol.com> wrote:
> What??
Various online services use graphic-based alphanumeric strings during
their signup process. A potential user is presented with a graphic rendition
of a word or a number (or both), which he must type it into a text box.
They use this method to prevent spammers and other evil characters from
setting up bots to automatically create new accounts.
------------------------------
Date: Sun, 06 Jul 2003 16:34:11 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: How can I analyse jpg file with perl?
Message-Id: <to4ggv8jrl0tqc6kf1fs6ai0bl5amu7h52@4ax.com>
On Sat, 5 Jul 2003 15:45:25 +0800, "bytewolf" <gamelifes@yahoo.com.cn>
wrote:
> In photoshop,I use the text tool to make a sentence "I love perl" and
>save it as a jpg
If I understand correctly what you mean with "text tool" you might
want an OCR implemented in perl. Is it so? If this is the case, then I
guess that such a thing plainly doesn't exist and I would find it a
*very bad idea*(TM) even to think to create one, with the possible
exception of an XS module linked to an external library. But then,
please forgive my ignorance, does a suitable library exist? Also, what
would be the advantage of using perl over a C/C++ executable?
If you mean that you somehow encode in your binary jpeg file some text
that *can* be "directly" recovered as text instead, then the solution
suggested to you by another poster is fundamentally correct. You
should only discover how text (comments?) is encoded in JFIF, and this
should be fully documented somwhere. Probably unpack() would even be
unnecessary[*], and there should be modules ready for this task, so
just search CPAN!
[*] I once wrote a *working* script of two lines in Perl to extract
jpeg images from one of those infamous *.pps, *.ppt, using simply <FH>
and s///: rudimentary and inefficient, but working!
Michele
--
$\=q.,.,$_=q.print' ,\g,,( w,a'c'e'h,,map{$_-=qif/g/;chr
}107..q[..117,q)[map+hex,split//,join' ,2B,, w$ECDF078D3'
F9'5F3014$,$,];];$\.=$/,s,q,32,g,s,g,112,g,y,' , q,,eval;
------------------------------
Date: Sun, 6 Jul 2003 21:50:41 +0200
From: "Stefan" <someone@somewhere.nl>
Subject: Re: How to gather the MAC-address
Message-Id: <3f087d1b$0$157$e4fe514c@dreader8.news.xs4all.nl>
"Gabriel Schuster" <gschuster@icecold.de> schreef in bericht
news:3f0812c2@shknews01...
> Hello!
>
> I'm new to all those news groups out there.
> I'd like to introduce myself, I'm Gabriel Schuster, living near Stuttgart,
> Germany.
> I've been working with perl for about 3 years now.
> Now i have to work on a really big project and i got a (big?) problem.
> For a secure license management system i need to gather the MAC-address of
> the machine my script is running on.
> I searched several news groups, google and many other spiders without any
> helpful result.
> The way to recieve the address should be portable so it runs e.g. on
> Linux/Unix and Windows, if possible.
> Is there any idea to solve this problem?
> I would be very thankful for any suggestions.
>
> Thank you!
>
> Kindly regards,
>
> Gabriel Schuster
It's defenitely a tricky task to determine MAC addresses. For a start, it's
very OS dependend. Google is, was, and will be your friend though. This
web-site looks very informative;
http://www.its.caltech.edu/its/services/networkra/macaddress.shtml
The google search was "how to determine mac address local computer" and this
is the 1st hit. There are 145.000 more to go ......
Good luck,
Stefan
------------------------------
Date: Sun, 06 Jul 2003 21:22:19 +0100
From: The Sender <wgu_@_wurquhart.co.uk>
Subject: Re: How to gather the MAC-address
Message-Id: <MC%Na.344$ol6.60@news-binary.blueyonder.co.uk>
At some time in the past Stefan wrote :
> "Gabriel Schuster" <gschuster@icecold.de> schreef in bericht
> news:3f0812c2@shknews01...
>> Hello!
>>
>> I'm new to all those news groups out there.
>> I'd like to introduce myself, I'm Gabriel Schuster, living near
>> Stuttgart, Germany.
>> I've been working with perl for about 3 years now.
>> Now i have to work on a really big project and i got a (big?) problem.
>> For a secure license management system i need to gather the MAC-address
>> of the machine my script is running on.
>> I searched several news groups, google and many other spiders without any
>> helpful result.
>> The way to recieve the address should be portable so it runs e.g. on
>> Linux/Unix and Windows, if possible.
>> Is there any idea to solve this problem?
>> I would be very thankful for any suggestions.
>>
>> Thank you!
>>
>> Kindly regards,
>>
>> Gabriel Schuster
>
> It's defenitely a tricky task to determine MAC addresses. For a start,
> it's very OS dependend. Google is, was, and will be your friend though.
> This web-site looks very informative;
>
> http://www.its.caltech.edu/its/services/networkra/macaddress.shtml
>
> The google search was "how to determine mac address local computer" and
> this is the 1st hit. There are 145.000 more to go ......
>
> Good luck,
> Stefan
Have you tried arp -a IP_Address?
--
Regards,
William
------------------------------
Date: 06 Jul 2003 15:34:25 +0800
From: Dan Jacobson <jidanni@jidanni.org>
Subject: HTML::HeadParser to print the title
Message-Id: <87adbsf6ri.fsf@jidanni.org>
/usr/share/doc/libhtml-parser-perl/examples/htitle will print out the
title of an HTML document. How do I use the lighter weight
HTML::HeadParser to do the same? I want to rewrite examples/htitle but
just don't get it.
P.S. wouldn't the example be better if it used the more efficient
tool for that job, HTML::HeadParser?
------------------------------
Date: Sun, 6 Jul 2003 09:02:48 -0500
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: HTML::HeadParser to print the title
Message-Id: <slrnbggb07.g09.tadmc@magna.augustmail.com>
Dan Jacobson <jidanni@jidanni.org> wrote:
> /usr/share/doc/libhtml-parser-perl/examples/htitle
We do not have access to your filesystem, so we don't know what
"example" it is that you are talking about.
But that's OK. We don't need to see the example to answer your question.
> will print out the
> title of an HTML document. How do I use the lighter weight
> HTML::HeadParser to do the same?
By copying the first 4 lines of code displayed when you typed:
perldoc HTML::HeadParser
and modifying them for your situation.
So what do you need us for?
--------------------------------
#!/usr/bin/perl
use strict;
use warnings;
my $text = '
<html>
<head>
<title>Perl.org</title>
<base href="http://www.perl.org/index.shtml">
<link rel="shortcut icon" href="favicon.ico">
</head>
<body bgcolor="#FFFFFF">
<p>this is the body of the document</p>
</body>
</html>
';
# code from the module's documentation
require HTML::HeadParser;
my $p = HTML::HeadParser->new;
$p->parse($text) and print "not finished";
print $p->header('Title'), "\n"; # to access <title>....</title>
--------------------------------
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: 6 Jul 2003 04:45:04 -0700
From: debhatta@hotmail.com (debraj)
Subject: lookaround
Message-Id: <f9f243e.0307060345.5dff58e1@posting.google.com>
Hi All,
I am new to perl
and am wondering why the following is not running :
$_ = "The brown fox jumps over the lazy dog";
/the (\S+)(?{ $color = $^N }) (\S+)(?{ $animal = $^N })/i;
print "color = $color, animal = $animal\n";
its giving no output and if I use it in my programs it gives
Sequence (?{...) not recognized at.....
I took it from this link :
http://www.perldoc.com/perl5.8.0/pod/perlre.html
Thanx in advance,
Mark
------------------------------
Date: Sun, 06 Jul 2003 12:45:26 GMT
From: Andras Malatinszky <nobody@dev.null>
Subject: Re: lookaround
Message-Id: <3F081951.1040104@dev.null>
debraj wrote:
> Hi All,
>
> I am new to perl
> and am wondering why the following is not running :
>
> $_ = "The brown fox jumps over the lazy dog";
> /the (\S+)(?{ $color = $^N }) (\S+)(?{ $animal = $^N })/i;
> print "color = $color, animal = $animal\n";
>
> its giving no output and if I use it in my programs it gives
> Sequence (?{...) not recognized at.....
>
> I took it from this link :
>
> http://www.perldoc.com/perl5.8.0/pod/perlre.html
>
> Thanx in advance,
> Mark
>
Just a few lines above the spot where you copied your code from there is this warning:
"WARNING: This extended regular expression feature is considered highly experimental,
and may be changed or deleted without notice."
Apparently your verison of Perl doesn't support this feature.
------------------------------
Date: Sun, 06 Jul 2003 13:42:49 GMT
From: "Leo 'TheHobbit'" <thehobbit@remove.this.altern.org>
Subject: Re: lookaround
Message-Id: <pan.2003.07.06.13.42.39.54908@remove.this.altern.org>
On Sun, 06 Jul 2003 04:45:04 +0000, debraj wrote:
> Hi All,
>
> I am new to perl
> and am wondering why the following is not running :
>
> $_ = "The brown fox jumps over the lazy dog";
> /the (\S+)(?{ $color = $^N }) (\S+)(?{ $animal = $^N })/i;
> print "color = $color, animal = $animal\n";
>
Hi,
this works perfectly here, with perl 5.8.0. Obviously, if you perl
version is older than that it could not work (IIRC code blocks in regex
weren't there even in 5.6.1).
--
Leo "TheHobbit"
One Ring to rule them all, One Ring to find them,
One Ring to bring them all and in the darknes bind them
In the land of Mordor where the Shadow lie.
------------------------------
Date: Sun, 6 Jul 2003 09:08:00 -0500
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: lookaround
Message-Id: <slrnbggba0.g09.tadmc@magna.augustmail.com>
debraj <debhatta@hotmail.com> wrote:
> I am new to perl
You should use the docs that _came with_ your version of perl,
else what you see may not work with the version that you
actually have available to you.
> /the (\S+)(?{ $color = $^N }) (\S+)(?{ $animal = $^N })/i;
> Sequence (?{...) not recognized at.....
>
> I took it from this link :
>
> http://www.perldoc.com/perl5.8.0/pod/perlre.html
^^^^^
^^^^^
Do you _have_ perl version 5.8.0?
If you use the docs that came with your perl, then you will see
only those features that you can use with your perl.
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Sun, 6 Jul 2003 14:12:35 +0200
From: "Reto Hersiczky" <retoh@cut-here-infocopter.ch>
Subject: Re: Net::POP3
Message-Id: <3f08122f$0$22095$5402220f@news.sunrise.ch>
Lev,
$pop3->login( ) actually returns the number of messages in the mailbox
*or* UNDEF if the authentication should fail. '0E0' is being returned if
the login was successful but there are no messages in the inbox. The
reason for this is to assure you become always a TRUE value on a
successful login.
HTH & BR,
retoh :)
--
"Lev Altshuler" <levalt@rogers.com> wrote in message
news:64MNa.70818$x4o.46663@news04.bloor.is.net.cable.rogers.com...
> Hi,
>
> I am trying to count email messages in the mailbox and read their headers.
> In case that there are some messages on the POP3 server and
> they haven't yet got to the Inbox, I get a number of messages.
> As soon as they have been in the Inbox, I get '0E0' as a number of
messages.
> Does anyone know what feature of Net::POP3 I am not aware of, or
> where did I screw up in the code?
>
> use Net::POP3;
>
> my $server = "pop.bloor.phub.net.cable.rogers.com";
> my $pop3 = Net::POP3->new($server, Timeout => 10, Debug =>1);
> die "Couldn't log on to server" unless $pop3;
>
> my $user = "levalt\@rogers.com";
> my $password = "password";
> my $num_Messages = $pop3->login($user, $password);
> print "$num_Messages\n";
------------------------------
Date: Sun, 06 Jul 2003 13:07:25 GMT
From: Andras Malatinszky <nobody@dev.null>
Subject: Re: Net::POP3
Message-Id: <3F081E78.7030800@dev.null>
Lev Altshuler wrote:
> I am trying to count email messages in the mailbox and read their headers.
> [Whenever] there are some messages on the POP3 server and
> they haven't yet got to the Inbox, I get a number of messages.
> As soon as they have been [transferred to] the Inbox, I get '0E0' as a number of messages.
> [I am perplexed by this]
I assume you have a mailbox on a remote machine and some client like
Netscape Messenger or Outlook Express on your local machine. When you
check your e-mail using your client, it does essentially the same that
you are trying to do with your perl script: it logs into the remote
machine, checks your mailbox there, and if it finds any messages, it
transfers them to your "Inbox," which is on your local machine, and then
deletes the messages from your mailbox on the remote machine.
So if a message is already in your Inbox, it no longer is on the remote
machine, and Net::POP3 tells you so. "0E0" is just a clever way of
saying "zero" (the documentation explains why).
------------------------------
Date: Sun, 06 Jul 2003 17:38:05 GMT
From: "Lev Altshuler" <levalt@rogers.com>
Subject: Re: Net::POP3
Message-Id: <18ZNa.74326$x4o.36050@news04.bloor.is.net.cable.rogers.com>
"Gunnar Hjalmarsson" <noreply@gunnar.cc> wrote in message
news:be865c$1eq3u$1@ID-184292.news.dfncis.de...
> Lev Altshuler wrote:
> > The point is that there is a number of messages in my Inbox, and
> > $pop3->login($user, $password);
> > is evaluated to 0E0 which is zero.
>
> You said in your first message: "In case that there are some messages
> on the POP3 server and they haven't yet got to the Inbox ..."
> Obviously you distinguish between "POP3 server" and "Inbox". Are you
> talking about the "Inbox" in Outlook Express or something, and if so,
> what has that to do with Net::POP3...?
>
> --
> Gunnar Hjalmarsson
> Email: http://www.gunnar.cc/cgi-bin/contact.pl
>
Gunnar,
Now I am aware that I need a different module, the one that reads messages
from Outlook Inbox. If you know which one, please share with me.
Thanks, Lev
------------------------------
Date: Sun, 06 Jul 2003 17:40:40 GMT
From: "Lev Altshuler" <levalt@rogers.com>
Subject: Re: Net::POP3
Message-Id: <saZNa.74345$x4o.74197@news04.bloor.is.net.cable.rogers.com>
"Andras Malatinszky" <nobody@dev.null> wrote in message
news:3F081E78.7030800@dev.null...
>
>
> Lev Altshuler wrote:
>
> > I am trying to count email messages in the mailbox and read their
headers.
> > [Whenever] there are some messages on the POP3 server and
> > they haven't yet got to the Inbox, I get a number of messages.
> > As soon as they have been [transferred to] the Inbox, I get '0E0' as a
number of messages.
> > [I am perplexed by this]
>
>
>
> I assume you have a mailbox on a remote machine and some client like
> Netscape Messenger or Outlook Express on your local machine. When you
> check your e-mail using your client, it does essentially the same that
> you are trying to do with your perl script: it logs into the remote
> machine, checks your mailbox there, and if it finds any messages, it
> transfers them to your "Inbox," which is on your local machine, and then
> deletes the messages from your mailbox on the remote machine.
>
> So if a message is already in your Inbox, it no longer is on the remote
> machine, and Net::POP3 tells you so. "0E0" is just a clever way of
> saying "zero" (the documentation explains why).
>
Andras,
Now I am aware that I need a different module, the one that reads messages
from Outlook Inbox. If you know which one, please share with me.
Thanks, Lev
------------------------------
Date: Sun, 06 Jul 2003 15:42:30 -0400
From: Mina Naguib <spam@thecouch.homeip.net>
Subject: Re: Net::POP3
Message-Id: <HY_Na.4693$Il3.286605@wagner.videotron.net>
-----BEGIN xxx SIGNED MESSAGE-----
Hash: SHA1
Lev Altshuler wrote:
> Now I am aware that I need a different module, the one that reads messages
> from Outlook Inbox. If you know which one, please share with me.
>
Look into the libPST project:
http://sourceforge.net/projects/ol2mbox/
-----BEGIN xxx SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQE/CHupeS99pGMif6wRAjfcAKDO4s4KmngR7yTTkSHX1OGkdZJu2QCbBMUe
axapkkkz0ejelFVnMxZL2Pw=
=iI87
-----END PGP SIGNATURE-----
------------------------------
Date: Sun, 06 Jul 2003 20:31:08 -0000
From: gbacon@hiwaay.net (Greg Bacon)
Subject: Re: pipe - non blocking read? (fork/Win32)
Message-Id: <vgh1oclf4ht56a@corp.supernews.com>
In article <3F04BDBD.9633257@hotpop.com>,
Benjamin Goldberg <ben.goldberg@hotpop.com> wrote:
: Greg Bacon wrote:
:
: [snip]
: > my @ready = $sel->can_read(0);
: > foreach my $fh (@ready) {
: [snip]
: > if (my $input = <$fh>) {
:
: Don't do that.
Why not?
Greg
--
What light is to the eyes -- what air is to the lungs -- what love is to
the heart, liberty is to the soul of man.
-- Robert Green Ingersoll
------------------------------
Date: 6 Jul 2003 13:36:21 GMT
From: "A. Sinan Unur" <asu1@c-o-r-n-e-l-l.edu>
Subject: Re: Reading JPEG file
Message-Id: <Xns93B061B75846Aasu1cornelledu@132.236.56.8>
Zvone Zagar <zvone.zagar@siol.net> wrote in
news:7HGNa.22$2B6.2874@news.siol.net:
> A. Sinan Unur wrote:
>
>> Zvone Zagar <zvone.zagar@siol.net> wrote in news:iafNa.2024$78.139057
>> @news.siol.net:
>>
>>> A. Sinan Unur wrote:
>>>
>>>> Zvone Zagar <zvone.zagar@siol.net> wrote in
>>>> news:GdKLa.1908$78.104444@news.siol.net:
>>>>
>>>>> I would like to read a jpg image, get data (decode) out of it and
>>>>> make a postscript file from scratch. I can get width, height,
>>>>> color depth but I don't know how to make a hex string needed for
>>>>> postscript. Postscript line should look like: width height depth
>>>>> matrix {<hex data>} false 3 colorimage.
>> ...
>>>> ImageMagick can save image data in raw RGB format. Although I have
>>>> never used it, and do not have it installed, I thought pointing
>>>> that out might help.
>>>>
>>>> Sinan.
>>> I appologize for my late answer.
>>> The raw RGB format is unfortunately not the proper one.
>>> At first my lips smiled, but code generated is not PS digested.
>>> I will dig deeper.
>>
>> If I understand correctly, you need to get to the raw RGB data
>> somehow (I have no idea how one embeds jpegs in postscript), and then
>> insert those data in the document as ascii hexadecimal numbers. Is
>> that the case? If so, once you get the raw RGB data, you can easily
>> get what you want. So, raw RGB would not be the solution to your
>> problem, but the first step in a solution.
<snip>
> I really appreciate your effort. I set up temporary site at
> http:/freeweb.siol.net/an511zvo where some examples will clarify my
> intentions (I hope).
It does. And thank you for posting a link rather than the actual files.
> The Tk script creates a ps file. That is what I
> want to make, but not using Tk. I would like to make text (console)
> application which creates postscript file. File (I stripped off
> unnecessary ps code) raptor2.ps is what I want to get at. The hex code
> between curly braces and <> is the hex string which makes me perplexed.
> I think that raw RGB data is the first step, too.
OK, so you are trying to do what I thought you were trying to do. Go ahead
and:
1. Decode the JPEG image into raw RGB format using ImageMagick
2. Print the value of each octet in the raw RGB data in hex, 66 characters
per line
3. For the second part, printf and/or sprintf are your friends.
This should not take a lot of code. If you run into problems, post your
code here.
> p.s. My appreciation was not empty words
Never thought it was. You are welcome.
Sinan.
--
A. Sinan Unur
asu1@c-o-r-n-e-l-l.edu
Remove dashes for address
Spam bait: mailto:uce@ftc.gov
------------------------------
Date: Sun, 06 Jul 2003 16:14:50 -0000
From: claird@lairds.com (Cameron Laird)
Subject: Who said what (was: globalizing an array)
Message-Id: <vgginqg73cvp06@corp.supernews.com>
In article <johnseal-121CF4.09110106072003@nnrp04.earthlink.net>,
John Seal <johnseal@indy.net> wrote:
.
.
.
>still allowing unusual things to be done, it's good. Who originally
>said "Easy things should be easy, and difficult things should be
>possible"?
Larry Wall, to whom it's often attributed, credits Alan Kay's 1977
book, *Microelectronics and the Personal Computer*. I haven't yet
tracked down a copy to confirm its presence there.
--
Cameron Laird <Cameron@Lairds.com>
Business: http://www.Phaseit.net
Personal: http://phaseit.net/claird/home.html
------------------------------
Date: Sun, 6 Jul 2003 16:43:24 +0000 (UTC)
From: aek@spies.com (Al Kossow)
Subject: Re: Who said what (was: globalizing an array)
Message-Id: <be9jjc$v2n$1@spies.com>
> Larry Wall, to whom it's often attributed, credits Alan Kay's 1977
> book, *Microelectronics and the Personal Computer*. I haven't yet
> tracked down a copy to confirm its presence there.
> --
[Kay 1977] Kay, Alan, "Microelectronics and the Personal Computer",
Scientific American, September 1977, pp. 230-244.
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
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.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 V10 Issue 5185
***************************************