[27017] in Perl-Users-Digest
Perl-Users Digest, Issue: 8943 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Feb 11 18:05:53 2006
Date: Sat, 11 Feb 2006 15:05:08 -0800 (PST)
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, 11 Feb 2006 Volume: 10 Number: 8943
Today's topics:
Re: Absolute Novice (Mac Tiger) Needs Help <ben.usenet@bsb.me.uk>
Re: Absolute Novice (Mac Tiger) Needs Help (James Taylor)
Re: Absolute Novice (Mac Tiger) Needs Help <kamins@dogeared.com>
Re: Absolute Novice (Mac Tiger) Needs Help (James Taylor)
Re: Absolute Novice (Mac Tiger) Needs Help <groleau+news@freeshell.org>
Re: Absolute Novice (Mac Tiger) Needs Help <tadmc@augustmail.com>
Re: Absolute Novice (Mac Tiger) Needs Help (James Taylor)
Re: Absolute Novice (Mac Tiger) Needs Help (James Taylor)
Re: Absolute Novice (Mac Tiger) Needs Help <noreply@gunnar.cc>
Re: Absolute Novice (Mac Tiger) Needs Help (James Taylor)
Re: FAQ 4.18 Does Perl have a Year 2000 problem? Is Pe <jwkenne@attglobal.net>
Re: FAQ 4.18 Does Perl have a Year 2000 problem? Is Pe <jurgenex@hotmail.com>
Re: FAQ 4.18 Does Perl have a Year 2000 problem? Is Pe <brian.d.foy@gmail.com>
Re: Perl vs. Python <abigail@abigail.nl>
Re: Perl vs. Python <eflorac@imaginet.fr>
Re: Perl vs. Python <abigail@abigail.nl>
Re: Program to generate buttons for sequence of command <zentara@highstream.net>
Re: Program to generate buttons for sequence of command (Raghuramaiah Gompa)
Re: Program to generate buttons for sequence of command <zentara@highstream.net>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sat, 11 Feb 2006 12:10:08 +0000
From: Ben Bacarisse <ben.usenet@bsb.me.uk>
Subject: Re: Absolute Novice (Mac Tiger) Needs Help
Message-Id: <pan.2006.02.11.12.10.04.794305@bsb.me.uk>
On Fri, 10 Feb 2006 16:51:02 -0800, Scot Kamins wrote:
> The first program is the typical "Hello World" Program.
>
> #!/usr/bin/perl -w
> print "Hello, World!\n";
>
> I save the file using BBEdit Lite and go into Terminal to execute it
> thus:.
>
> New-Hope:~ scotkamins$ ./hello.pl
>
> And the prompt came back:
>
> New-Hope:~ scotkamins$
>
> But the words 'Hello, World!" did not appear anywhere.
One thought: is /usr/bin/perl really the perl interpreter (or a link to
it)? If it was linked to something else, you might get what you see.
--
Ben.
------------------------------
Date: Sat, 11 Feb 2006 12:23:11 +0000
From: usenet@oakseed.demon.co.uk.invalid (James Taylor)
Subject: Re: Absolute Novice (Mac Tiger) Needs Help
Message-Id: <1halgsd.1j26azi1acavsqN%usenet@oakseed.demon.co.uk.invalid>
Ben Bacarisse <ben.usenet@bsb.me.uk> wrote:
> Scot Kamins wrote:
>
> One thought: is /usr/bin/perl really the perl interpreter (or a link to
> it)? If it was linked to something else, you might get what you see.
As a user of MacOSX Tiger 10.4.4, I can tell you that /usr/bin/perl is
not a link. I find the OP's situation inexplicable. Surely there should
be an error message if the program doesn't run as normal. Could it be
that something is redirecting output (an alias perhaps). Could it be
that strange newline chars are being created by BBEdit Lite? (I use vi
myself.)
--
James Taylor
------------------------------
Date: Sat, 11 Feb 2006 08:34:55 -0800
From: Scot Kamins <kamins@dogeared.com>
Subject: Re: Absolute Novice (Mac Tiger) Needs Help
Message-Id: <kamins-D8FD38.08344511022006@sn-ip.vsrv-sjc.supernews.net>
In article <slrnduragi.310d.penryu@haruko.saiyix>,
Tim Hammerquist <penryu@saiyix.ath.cx> wrote:
>
> What happens when you try: ?
>
> perl hello.pl
>
The prompt returns with no other message and no activity.
Thanks,
Scot
------------------------------
Date: Sat, 11 Feb 2006 19:52:05 +0000
From: usenet@oakseed.demon.co.uk.invalid (James Taylor)
Subject: Re: Absolute Novice (Mac Tiger) Needs Help
Message-Id: <1ham1hw.1rsjic812zcjlhN%usenet@oakseed.demon.co.uk.invalid>
Scot Kamins <kamins@dogeared.com> wrote:
> In article <slrnduragi.310d.penryu@haruko.saiyix>,
> Tim Hammerquist <penryu@saiyix.ath.cx> wrote:
>
> > What happens when you try: ?
> >
> > perl hello.pl
>
> The prompt returns with no other message and no activity.
I can't bear it any longer. Would you consider giving me an ssh login
account on your machine in order to sort this out? We could open an
iChat voice session at the same time so I can explain what I'm doing. If
you're up for that, my iChat handle is sophisticate at mac.com (and my
timezone is GMT). We can then post the solution back here once found.
--
James Taylor
------------------------------
Date: Sat, 11 Feb 2006 20:32:14 GMT
From: Wes Groleau <groleau+news@freeshell.org>
Subject: Re: Absolute Novice (Mac Tiger) Needs Help
Message-Id: <iRrHf.645$Eq.60@trnddc02>
James Taylor wrote:
> that strange newline chars are being created by BBEdit Lite? (I use vi
> myself.)
That was it (I worked with him by e-mail).
BBEdit defaults to old-style linebreaks (\r)
so the kernel treated the entire file as the shell command,
leaving perl nothing to execute.
--
Wes Groleau
-----------
I've been framed! ...
http://www.useit.com/alertbox/9612.html
------------------------------
Date: Sat, 11 Feb 2006 15:12:15 -0600
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Absolute Novice (Mac Tiger) Needs Help
Message-Id: <slrnduskpf.6ke.tadmc@magna.augustmail.com>
Scot Kamins <kamins@dogeared.com> wrote:
> I'm using perl on a Mac under Tiger.
I've never used Perl on a Mac, but I'm not going to let that stop me. :-)
> The first program is the typical "Hello World" Program.
>
> #!/usr/bin/perl -w
> print "Hello, World!\n";
> No messages, no complaints, no warnings: just the prompt. This makes me
> believe that the system found and executed the program, but I can't see
> WHERE it executed the program.
>
> Any ideas?
Does a one-liner work?
Try one of these at the command prompt:
perl -e 'print "Hello, World!\n"'
/usr/bin/perl -e 'print "Hello, World!\n"'
(use whatever the fullpath really is on your system for that last one.)
Can you get it to make _any_ messages?
perl -e 'nonesuch()'
(should complain about the undefined subroutine.)
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Sat, 11 Feb 2006 21:22:13 +0000
From: usenet@oakseed.demon.co.uk.invalid (James Taylor)
Subject: Re: Absolute Novice (Mac Tiger) Needs Help
Message-Id: <1ham5eb.bcfmv315fsecuN%usenet@oakseed.demon.co.uk.invalid>
Wes Groleau <groleau+news@freeshell.org> wrote:
> James Taylor wrote:
> > that strange newline chars are being created by BBEdit Lite?
> > (I use vi myself.)
>
> That was it (I worked with him by e-mail).
> BBEdit defaults to old-style linebreaks (\r)
> so the kernel treated the entire file as the shell command,
> leaving perl nothing to execute.
Well done.
I thought it might be that but I'm not familiar with BBEdit.
--
James Taylor
------------------------------
Date: Sat, 11 Feb 2006 21:25:32 +0000
From: usenet@oakseed.demon.co.uk.invalid (James Taylor)
Subject: Re: Absolute Novice (Mac Tiger) Needs Help
Message-Id: <1ham63r.8bx0bl1jp7tjaN%usenet@oakseed.demon.co.uk.invalid>
Tad McClellan <tadmc@augustmail.com> wrote:
> Scot Kamins <kamins@dogeared.com> wrote:
>
> > I'm using perl on a Mac under Tiger.
>
> I've never used Perl on a Mac, but I'm not going to let that stop me. :-)
The modern Mac is indistinguishable from Unix for this sort of thing.
The OP's problem turned out to be wrong newlines.
--
James Taylor
------------------------------
Date: Sat, 11 Feb 2006 22:57:13 +0100
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: Absolute Novice (Mac Tiger) Needs Help
Message-Id: <4574pqF5a379U1@individual.net>
Wes Groleau wrote:
> James Taylor wrote:
>> that strange newline chars are being created by BBEdit Lite? (I use vi
>> myself.)
>
> That was it (I worked with him by e-mail).
> BBEdit defaults to old-style linebreaks (\r)
> so the kernel treated the entire file as the shell command,
> leaving perl nothing to execute.
I'm not a Mac user, but I thought that \r does represent a newline on
Mac, at least according to "perldoc perlport".
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
------------------------------
Date: Sat, 11 Feb 2006 22:55:58 +0000
From: usenet@oakseed.demon.co.uk.invalid (James Taylor)
Subject: Re: Absolute Novice (Mac Tiger) Needs Help
Message-Id: <1ham9dp.1x5i7rs18n2fr3N%usenet@oakseed.demon.co.uk.invalid>
Gunnar Hjalmarsson <noreply@gunnar.cc> wrote:
> Wes Groleau wrote:
>
> > That was it (I worked with him by e-mail).
> > BBEdit defaults to old-style linebreaks (\r)
> > so the kernel treated the entire file as the shell command,
> > leaving perl nothing to execute.
>
> I'm not a Mac user, but I thought that \r does represent a newline on
> Mac, at least according to "perldoc perlport".
Surely, the point of \n is that it represents a newline on *any*
platform. MacOS X is (NextStep/BSD unix) so newlines are linefeeds like
any other sensible operating system. Classic MacOS used carriage returns
as newline markers. It was my understanding that the difference between
binmode and err... "textmode" was that textmode performed the
translation of newline chars so that the Perl programmer didn't have to
concern himself with this issue. The Perl programmer could just read a
text file and then be able to use \n to refer to newlines within the
data in memory whether it had come from a file or anywhere else. So \n
and \r retain their traditional C style meaning within Perl programs
regardless of what the external OS happens to use in text files.
At least, that's how it *should* be, but I have a nagging feeling I
overheard people on this group describing it quite differently. The way
they described it was that, instead of the abstraction being in the file
IO layer, the meaning of \n and \r would change depending on the
operating system that the Perl program was running on. Yeuck! That's
clearly a portability maintenance disaster, and if this is really the
case, you'd end up having to avoid the broken \n and \r in favour of
\x0a and \x0d, not to mention spending a good deal of you time hunting
down bugs caused by the assumption that \n was a linefeed and \r a
carriage return.
Can anyone put my mind at ease that the design of Perl is sensible, as
described in the first paragraph, and not broken as described in the
second paragraph? Thanks.
--
James Taylor
------------------------------
Date: Sat, 11 Feb 2006 10:49:36 -0500
From: "John W. Kennedy" <jwkenne@attglobal.net>
Subject: Re: FAQ 4.18 Does Perl have a Year 2000 problem? Is Perl Y2K compliant?
Message-Id: <mInHf.10$Kt6.0@fe12.lga>
Jürgen Exner wrote:
> PerlFAQ Server wrote:
> [...]
>> --------------------------------------------------------------------
>>
>> 4.18: Does Perl have a Year 2000 problem? Is Perl Y2K compliant?
>
> By now the new Millenium is 5 years old. Isn't it time to retire this entry?
Not absolutely. The first actual data loss due to a Y2K bug on IBM
mainframes (that I know of) was on 16 August, 1972, and it is possible
that future appearances are yet to come.
--
John W. Kennedy
"But now is a new thing which is very old--
that the rich make themselves richer and not poorer,
which is the true Gospel, for the poor's sake."
-- Charles Williams. "Judgement at Chelmsford"
------------------------------
Date: Sat, 11 Feb 2006 16:41:10 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: FAQ 4.18 Does Perl have a Year 2000 problem? Is Perl Y2K compliant?
Message-Id: <GsoHf.625$Eq.38@trnddc02>
John W. Kennedy wrote:
> Jürgen Exner wrote:
>> PerlFAQ Server wrote:
>> [...]
>>> --------------------------------------------------------------------
>>>
>>> 4.18: Does Perl have a Year 2000 problem? Is Perl Y2K compliant?
>>
>> By now the new Millenium is 5 years old. Isn't it time to retire
>> this entry?
>
> Not absolutely. The first actual data loss due to a Y2K bug on IBM
> mainframes (that I know of) was on 16 August, 1972, and it is possible
> that future appearances are yet to come.
Sure. But I certainly hope that this question isn't asked _FREQUENTLY_ any
longer.
jue
------------------------------
Date: Sat, 11 Feb 2006 12:31:36 -0600
From: brian d foy <brian.d.foy@gmail.com>
Subject: Re: FAQ 4.18 Does Perl have a Year 2000 problem? Is Perl Y2K compliant?
Message-Id: <110220061231361252%brian.d.foy@gmail.com>
In article <vxaHf.458$Eq.141@trnddc02>, Jürgen Exner
<jurgenex@hotmail.com> wrote:
> PerlFAQ Server wrote:
> [...]
> > --------------------------------------------------------------------
> >
> > 4.18: Does Perl have a Year 2000 problem? Is Perl Y2K compliant?
>
> By now the new Millenium is 5 years old. Isn't it time to retire this entry?
It could probably be retired, but it isn't do much harm for the moment.
Maybe I should just come up with a better title, such as "How does Perl
handle year values?" or something similar.
------------------------------
Date: 11 Feb 2006 19:45:02 GMT
From: Abigail <abigail@abigail.nl>
Subject: Re: Perl vs. Python
Message-Id: <slrndusflq.cm.abigail@alexandra.abigail.nl>
Patrick M. Rutkowski (rutski89@gmail.com) wrote on MMMMDXLVI September
MCMXCIII in <URL:news:GAYGf.8$LR2.6@fe09.lga>:
][ I'm currently learning Perl from the Camel Book and I'm totally loving
][ it. I did stumble upon this article though, and I wanted to know if you
][ guys on c.l.p.misc agree with Eric's views:
][
][ http://www.linuxjournal.com/article/3882
You're better of with Python.
Perl is only for idiots, and webwussies who can't write decent code.
Both God and Allah have used Python to create the universe.
Abigail
--
perl -MLWP::UserAgent -MHTML::TreeBuilder -MHTML::FormatText -wle'print +(
HTML::FormatText -> new -> format (HTML::TreeBuilder -> new -> parse (
LWP::UserAgent -> new -> request (HTTP::Request -> new ("GET",
"http://work.ucsd.edu:5141/cgi-bin/http_webster?isindex=perl")) -> content))
=~ /(.*\))[-\s]+Addition/s) [0]'
------------------------------
Date: Sat, 11 Feb 2006 21:12:10 +0100
From: Emmanuel Florac <eflorac@imaginet.fr>
Subject: Re: Perl vs. Python
Message-Id: <pan.2006.02.11.20.12.10.873907@imaginet.fr>
Le Sat, 11 Feb 2006 19:45:02 +0000, Abigail a écrit :
>
> Both God and Allah have used Python to create the universe.
Wait a minute, aren't they the same person ? BTW which one is the
pseudonym ? Oh I'm stupid, there is no god of course :)
--
Ne pas savoir de quoi on parle est un avantage dont il ne faut pas
abuser.
R.Debray
------------------------------
Date: 11 Feb 2006 21:44:14 GMT
From: Abigail <abigail@abigail.nl>
Subject: Re: Perl vs. Python
Message-Id: <slrndusmle.cm.abigail@alexandra.abigail.nl>
Emmanuel Florac (eflorac@imaginet.fr) wrote on MMMMDXLVII September
MCMXCIII in <URL:news:pan.2006.02.11.20.12.10.873907@imaginet.fr>:
== Le Sat, 11 Feb 2006 19:45:02 +0000, Abigail a écrit :
==
== >
== > Both God and Allah have used Python to create the universe.
==
== Wait a minute, aren't they the same person
You mean both Bush and Osama Bin Laden get their orders from the
same god?
Abigail
--
@;=split//=>"Joel, Preach sartre knuth\n";$;=chr 65;%;=map{$;++=>$_}
0,22,13,16,5,14,21,1,23,11,2,7,12,6,8,15,3,19,24,14,10,20,18,17,4,25
;print@;[@;{A..Z}];
------------------------------
Date: Sat, 11 Feb 2006 13:44:57 GMT
From: zentara <zentara@highstream.net>
Subject: Re: Program to generate buttons for sequence of commands
Message-Id: <fupru1hq403p6d03k8ud4us3bsmvflovli@4ax.com>
On Fri, 10 Feb 2006 19:22:34 +0000 (UTC), rgompa@steel.ucs.indiana.edu
(Raghuramaiah Gompa) wrote:
>Thank you so much for the code. This code generated the
>button I wanted, however, the commands are not executed.
>I am using Win Xp and the commands are for unix system.
>What is it that I need to do to execute commands (such
>as c:\texmf\miktex\bin\latex.exe test ) in
>windows? .. Raghu
Hi, I don't use windows, but there are a variety of ways to
launch win32 processes. See the following for ways to
do it, and the various considerations. For instance do
you want all the executed commands to be totally independent,
or do you want them all to die when your "button-selector-app"
is closed?
http://perlmonks.org?node_id=409996 there is an XP answer
http://perlmonks.org?node_id=522373
http://perlmonks.org?node_id=495209
--
I'm not really a human, but I play one on earth.
http://zentara.net/japh.html
------------------------------
Date: Sat, 11 Feb 2006 15:57:32 +0000 (UTC)
From: rgompa@steel.ucs.indiana.edu (Raghuramaiah Gompa)
Subject: Re: Program to generate buttons for sequence of commands
Message-Id: <dsl1hc$pms$1@rainier.uits.indiana.edu>
In article <fupru1hq403p6d03k8ud4us3bsmvflovli@4ax.com>,
zentara <zentara@highstream.net> wrote:
>On Fri, 10 Feb 2006 19:22:34 +0000 (UTC),
>rgompa@steel.ucs.indiana.edu
>(Raghuramaiah Gompa) wrote:
>
>>Thank you so much for the code. This code generated the
>>button I wanted, however, the commands are not executed.
>>I am using Win Xp and the commands are for unix system.
>>What is it that I need to do to execute commands (such
>>as c:\texmf\miktex\bin\latex.exe test ) in
>>windows? .. Raghu
>
>Hi, I don't use windows, but there are a variety of ways to
>launch win32 processes. See the following for ways to
>do it, and the various considerations. For instance do
>you want all the executed commands to be totally independent,
>or do you want them all to die when your "button-selector-app"
>is closed?
>
>http://perlmonks.org?node_id=409996 there is an XP answer
>
>http://perlmonks.org?node_id=522373
>
>http://perlmonks.org?node_id=495209
>
Thank you very much for all your help. I have gone
through all the links you have posted. They are beyond
me. I need to read more to understand them.
I want all the commands to be independent once executed
through the buttons. .. Raghu
------------------------------
Date: Sat, 11 Feb 2006 17:26:35 GMT
From: zentara <zentara@highstream.net>
Subject: Re: Program to generate buttons for sequence of commands
Message-Id: <s46su1tu4gesopqvs399j4btsbffsm1506@4ax.com>
On Sat, 11 Feb 2006 15:57:32 +0000 (UTC), rgompa@steel.ucs.indiana.edu
(Raghuramaiah Gompa) wrote:
>In article <fupru1hq403p6d03k8ud4us3bsmvflovli@4ax.com>,
>zentara <zentara@highstream.net> wrote:
>>On Fri, 10 Feb 2006 19:22:34 +0000 (UTC),
>>rgompa@steel.ucs.indiana.edu
>>(Raghuramaiah Gompa) wrote:
>>
>>>Thank you so much for the code. This code generated the
>>>button I wanted, however, the commands are not executed.
>>>I am using Win Xp and the commands are for unix system.
>>>What is it that I need to do to execute commands (such
>>>as c:\texmf\miktex\bin\latex.exe test ) in
>>>windows? .. Raghu
>>
>>Hi, I don't use windows, but there are a variety of ways to
>>launch win32 processes. See the following for ways to
>>do it, and the various considerations. For instance do
>>you want all the executed commands to be totally independent,
>>or do you want them all to die when your "button-selector-app"
>>is closed?
>>
>>http://perlmonks.org?node_id=409996 there is an XP answer
>>
>>http://perlmonks.org?node_id=522373
>>
>>http://perlmonks.org?node_id=495209
>>
>
>Thank you very much for all your help. I have gone
>through all the links you have posted. They are beyond
>me. I need to read more to understand them.
>
>I want all the commands to be independent once executed
>through the buttons. .. Raghu
Well I don't have windows to test, but I'll try to get
you going. In the script, where you go into the launch sub
sub launch {
my $key = shift;
my $command = $commands{$key}{'com'};
if(fork==0){ exec "xterm -hold -e $command" }
}
you need to change the line
if(fork==0){ exec "xterm -hold -e $command" }
to something compatible with Windows.
The links I posted showed a few methods.
The easiest was using system with 1
system(1, $file_to_run );
So first, try changing the sub to
sub launch {
my $key = shift;
my $command = $commands{$key}{'com'};
system( 1, $command }
}
and don't forget to change the 'com' assignments in the
%commands hash to your programs
'1-1' => {text => 'Latex test',
com => "c:\texmf\miktex\bin\latex.exe test",
color=> 'pink'},
etc
etc
#######################################################
If the system( 1, $cmd) dosn't work, you may have to use
the code from the other node
use Win32::Process;
Win32::Process::Create($ProcessObj,
"C:\winnt\notepad.exe",
"c:\sample.txt",
0,
DETACHED_PROCESS,
".") || die "cant find the application";
#########################################################
Finally, you may have to experiment a bit yourself.
Setup a simple script, to see if it launches your app.
Keep trying until you succeed. :-)
Like:
##############################################
#!/usr/bin/perl
use warnings;
use strict;
system( 1, "c:\texmf\miktex\bin\latex.exe test");
<>; #wait for keypress to simulate continued operation
__END__
#############################################
You may find that you need something like
"c:\texmf\miktex\bin\latex.exe", "test",
due to the syntax peculiarities of the windows command line.
Good luck. :-)
--
I'm not really a human, but I play one on earth.
http://zentara.net/japh.html
------------------------------
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.
NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice.
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 8943
***************************************