[25376] in Perl-Users-Digest
Perl-Users Digest, Issue: 7621 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Jan 8 03:05:29 2005
Date: Sat, 8 Jan 2005 00:05:14 -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, 8 Jan 2005 Volume: 10 Number: 7621
Today's topics:
Re: Calling Different scripts with 1 wrapper script <zen13097@zen.co.uk>
Re: checking at runtime if modul is installed <tassilo.von.parseval@rwth-aachen.de>
Here is $50 for signing up free <dishking@mwqrvdua.com>
Re: how to get perl catching a device (mic) ? <dontmewithme@got.it>
Re: how to get perl catching a device (mic) ? (Anno Siegel)
Re: how to get perl catching a device (mic) ? <dontmewithme@got.it>
Re: inheritance and order of packages (Anno Siegel)
Re: Is perl installation from scratch needed? <jkeen_via_google@yahoo.com>
Re: Line continuation in Perl <bik.mido@tiscalinet.it>
open linux file with perl <lie_huo@hotmail.com>
Re: open linux file with perl <tadmc@augustmail.com>
Re: open linux file with perl <spamtrap@dot-app.org>
Re: open linux file with perl <spamtrap@dot-app.org>
Re: PHP in Perl <dfischer348@comcast.net>
Re: Printing arrow keys through perl <see_sig@invalid>
Re: tar - gzip <zen13097@zen.co.uk>
Re: tar - gzip <abigail@abigail.nl>
Terminal size (pradeep)
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 03 Jan 2005 08:08:12 GMT
From: Dave Weaver <zen13097@zen.co.uk>
Subject: Re: Calling Different scripts with 1 wrapper script
Message-Id: <41d8fd6c$0$21332$db0fefd9@news.zen.co.uk>
On 02 Jan 2005 09:02:55 -0500, Michael Meissner
<mrmnews@the-meissners.org> wrote:
> Dave Weaver <zen13097@zen.co.uk> writes:
> > IMHO this would be better written as:
> >
> > if ( $0 eq 'script1' ) { ... etc ...
>
> No it wouldn't. Consider typing /foo/bar/script1 vs. ./script1 vs
> ../bar/script1. On many shells, what you type in as the command
> is what is put in ARGV[0], which perl stripps off to $0. I would
> imagine different shells might also put different forms of the
> pathname in different cases.
Good point. I hereby change MHO.
------------------------------
Date: Sat, 8 Jan 2005 08:43:56 +0100
From: "Tassilo v. Parseval" <tassilo.von.parseval@rwth-aachen.de>
Subject: Re: checking at runtime if modul is installed
Message-Id: <slrnctv3ps.qd.tassilo.von.parseval@localhost.localdomain>
Also sprach Sherm Pendley:
> Tassilo v. Parseval wrote:
>
>> This is true. However, this whole issue can be avoided by using
>> 'require'. One standard idiom would be:
>>
>> use constant HAVE_MODULE => eval { require Module; 1 } || 0;
>
> If you do it this way, don't forget to call import() manually -
> require() won't do that for you like use() would:
>
> use constant HAVE_MODULE => eval {
> require Module;
> Module::import LIST;
Rather:
Module->import(LIST);
> 1;
> }
>
> That works, but it's rather wordy, in my opinion, and trouble-prone if
> you forget to call import() - as you did in your example. I'd rather
> stay with use().
I didn't follow this thread too closely and based my posting mostly on
the subject line. If you additionally want to import symbols from the
module to be checked, I'd still go with 'require' even if it costs one
additional statement. I find the idea of forcing a compiletime
expression into runtime by using STRING-eval a little kludgy. This is
mostly a stylistic question for me. Technically there is nothing
objectionable about a STRING-eval here.
Tassilo
--
$_=q#",}])!JAPH!qq(tsuJ[{@"tnirp}3..0}_$;//::niam/s~=)]3[))_$-3(rellac(=_$({
pam{rekcahbus})(rekcah{lrePbus})(lreP{rehtonabus})!JAPH!qq(rehtona{tsuJbus#;
$_=reverse,s+(?<=sub).+q#q!'"qq.\t$&."'!#+sexisexiixesixeseg;y~\n~~dddd;eval
------------------------------
Date: Fri, 7 Jan 2005 01:55:40 -0800
From: "me to you" <dishking@mwqrvdua.com>
Subject: Here is $50 for signing up free
Message-Id: <M-idnWQMNpv_7ELcRVn-iw@comcast.com>
Hello, I'm trying out a new auto poster, and dont know how to use it very
good, so if this end up in the wrong places, please forgive me,
and disreguard, sorry for your incovenience, but everyone else, ENJOY!!
KEEP READING TO GET YOUR $50.00 NOW!!!
This is not spam, it is a legitament way to make money on the net, reading
e-mail, and other things as well, plus you get $50.00 dollars for signing up.
This is tottaly free, and requires no credit card on out of pocket money.
You will get paid for various things on the net, hope you enjoy and find
some usefull info here that will help you out. Plus you will get fifty dollars.
this is not spam, its usefull news for all newsgroups readers, from me to you,
hope you can use it for your benifit, please enjoy. If your not sure, get a
new email address, and then try, you wont get spammed, and all info is
carefully guarded, and not given out or traded or sold. Enjoy your $50.00,
I did, so did my friends and family. You'll also be able to do survays if you
want, P.S. forgive my spelling.
Just copy and paste into your browser, thanks again.
URL: http://www.CashRead.com/cgi-bin/signup.cgi?r=fogylight@yahoo.com
Dont be mean and hatefull, if you dont want to Participate, DON'T.
If you don't want $50.00, let someone else have it.
------------------------------
Date: Mon, 03 Jan 2005 05:35:18 GMT
From: Larry <dontmewithme@got.it>
Subject: Re: how to get perl catching a device (mic) ?
Message-Id: <dontmewithme-BA5547.06351403012005@twister2.tin.it>
Anyone?
------------------------------
Date: 3 Jan 2005 08:12:19 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: how to get perl catching a device (mic) ?
Message-Id: <craup3$5t4$1@mamenchi.zrz.TU-Berlin.DE>
Larry <dontmewithme@got.it> wrote in comp.lang.perl.misc:
> Anyone?
No. Your question has nothing to do with Perl.
Anno
------------------------------
Date: Mon, 03 Jan 2005 11:14:02 GMT
From: Larry <dontmewithme@got.it>
Subject: Re: how to get perl catching a device (mic) ?
Message-Id: <dontmewithme-79ABF4.12135703012005@twister2.tin.it>
In article <crb6p5$qqk$1@yggdrasil.glocalnet.net>,
Martin D <martind@algonet.se> wrote:
> In article <dontmewithme-BA5547.06351403012005@twister2.tin.it>,
> Larry <dontmewithme@got.it> wrote:
> >Anyone?
>
> if your're on something unixish Lincoln D. Stein's tpj article "An
> IP Telephone in 74 Lines of Perl" may be of some help to you.
>
> <http://www.foo.be/docs/tpj/issues/vol5_3/tpj0503-0002.html>
>
>
> Ma'as salaama,
> Martin
How is it that nobody hacked any code for win? I'll give it a shot
anyway.
thanks
------------------------------
Date: 3 Jan 2005 08:43:56 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: inheritance and order of packages
Message-Id: <crb0kc$6j6$1@mamenchi.zrz.TU-Berlin.DE>
Matt Garrish <matthew.garrish@sympatico.ca> wrote in comp.lang.perl.misc:
>
> <ioneabu@yahoo.com> wrote in message
> news:1104679973.244551.256800@z14g2000cwz.googlegroups.com...
> > #!/usr/bin/perl
> >
> > use strict;
> > use warnings;
> >
> > package main;
> >
> > my $q = new MYCGI;
> > print $q->h1("Hello, World!"),"\n";
> >
> >
> > package MYCGI;
> > use CGI;
> > our @ISA = ('CGI');
> >
> > produces output:
> >
> > Can't locate object method "new" via package "MYCGI" at ./test6.pl line
> > 8.
> >
> > If I put the MYCGI package before main it works (produces expected
> > output of CGI.pm h1 sub) and if I do this:
> >
>
> That's because the compiler needs to know that MYCGI "isa" CGI before you
> try to create the new object. You've obviously figured out some of the less
> desirable ways around the problem, but to avoid it altogether just use a
> begin block in the MYCGI package:
>
> package MYCGI;
>
> BEGIN {
> use CGI;
> our @ISA = qw/CGI/;
> }
...which can be replaced by
package MYCGI;
use base 'CGI';
Anno
------------------------------
Date: Mon, 03 Jan 2005 13:27:09 GMT
From: Jim Keenan <jkeen_via_google@yahoo.com>
Subject: Re: Is perl installation from scratch needed?
Message-Id: <NKbCd.18574$He3.2906@trndny05>
Franz wrote:
> Hi,
>
> I need to run perl on a imbedded platform with limited space and
> capabilities. Do I really need to install perl from scratch, or can I
> simply copy the perl executable, the shared object file and the needed
> libraries?
>
My guess would be that the amount of work needed to get that copying
right > amount of work needed to install Perl from scratch.
jimk
------------------------------
Date: Mon, 03 Jan 2005 13:49:02 +0100
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: Line continuation in Perl
Message-Id: <jevat059pg0bemtnn0kqnm7d4maakfbvm5@4ax.com>
On 31 Dec 2004 01:24:26 GMT, Abigail <abigail@abigail.nl> wrote:
>Having said that, I fail to see what portability between platforms
>has to do with maintaining code.
You're right: my fault, although I would claim that there's some
relationship albeit fundamentally of an indirect nature.
Michele
--
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
.'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
------------------------------
Date: Sat, 08 Jan 2005 01:53:29 -0500
From: "Roll" <lie_huo@hotmail.com>
Subject: open linux file with perl
Message-Id: <f8dab80233cf254fe4e01c8f92543a33@localhost.talkaboutprogramming.com>
hi ppl,
i have program a webpage for ppl to put some data on a file but i have a
problem of opening the file and input the data onto the specific file. it
is a dhcp.conf file of the linux operating system. can someone give me the
coding to open the file and input the data into the file. and is it
possible to write the data on the specific line of the file???
------------------------------
Date: Sat, 8 Jan 2005 01:14:30 -0600
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: open linux file with perl
Message-Id: <slrnctv22m.leq.tadmc@magna.augustmail.com>
Roll <lie_huo@hotmail.com> wrote:
> i have program a webpage for ppl
What is a "ppl"?
> to put some data on a file but i have a
> problem of opening the file
You use the open() function to open a file:
perldoc -f open
see also the Perl FAQs that mention files:
perldoc -q file
How do I change one line in a file/delete a line in a file/insert a
line in the middle of a file/append to the beginning of a file?
> and input the data onto the specific file. it
> is a dhcp.conf file of the linux operating system.
What is the nature of the problem you are having?
Tell use what your program did.
> can someone give me the
> coding
Maybe somebody else can, but it won't be me.
Show us the code you have so far, and we will help you fix it.
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Sat, 08 Jan 2005 02:23:52 -0500
From: Sherm Pendley <spamtrap@dot-app.org>
Subject: Re: open linux file with perl
Message-Id: <1dadnfPzsY4UF0LcRVn-tQ@adelphia.com>
Roll wrote:
> can someone give me the coding
No, but we can help you learn to write it. A good place to start, with
links to a number of resources, is at:
<http://learn.perl.org>
Also, please be sure to read the posting guidelines that appear here
frequently.
sherm--
--
Cocoa programming in Perl: http://camelbones.sourceforge.net
Hire me! My resume: http://www.dot-app.org
------------------------------
Date: Sat, 08 Jan 2005 02:28:16 -0500
From: Sherm Pendley <spamtrap@dot-app.org>
Subject: Re: open linux file with perl
Message-Id: <LoOdnamO5IsMFkLcRVn-qg@adelphia.com>
Tad McClellan wrote:
> What is a "ppl"?
Abbreviated spelling for "people". Apparently among some crowds it's
"kewl" to act like you can't spell, or something like that...
sherm--
--
Cocoa programming in Perl: http://camelbones.sourceforge.net
Hire me! My resume: http://www.dot-app.org
------------------------------
Date: Fri, 07 Jan 2005 14:19:06 -0500
From: Dave F <dfischer348@comcast.net>
Subject: Re: PHP in Perl
Message-Id: <lJmdncP1E5iV_ULcRVn-ow@comcast.com>
Helgi Briem wrote:
> On Wed, 05 Jan 2005 18:47:03 -0500, Dave F <dfischer348@comcast.net>
> wrote:
>
>
>>Is it possible to embed some PHP script in an HTML stream being
>>returned from a Perl script? I know it sounds wacky, but I'd like
>>to use chart library that uses PHP's support for the GD library.
>>PHP works on the system (I know .php files in the html
>>folder are served fine, so PHP is running.)
>
>
> ??? Why not simply use GD directly from Perl?
> Far easier, I would have thought.
>
> --
> Helgi Briem hbriem AT simnet DOT is
>
> A: Because it messes up the order in which people normally read text.
> Q: Why is top-posting such a bad thing?
> A: Top-posting.
> Q: What is the most annoying thing on usenet and in e-mail?
Because, as Sherm Pendley pointed out, I was confused and thought that
the PHP library I was using would allow me to stream an image from the
script area (like an applet). This way I would avoid the issue of
creating graphic files on the server that would either need to be
created using
unique names (and periodically cleaned up) or created with the same name
-- which I was worried could create problems if two charts were being
created at the same time. I have used the Perl/GD solution in the past
to create charts, which are then shown with <IMG> in an HTML page (and
it works well). I have also used the KavaChart Java applet, which works
well.
I may still use this PHP library, even though I will have the same file
name or multi-user issues with the PHP script files.
------------------------------
Date: Fri, 07 Jan 2005 21:08:56 -0500
From: Bob Walton <see_sig@invalid>
Subject: Re: Printing arrow keys through perl
Message-Id: <41df4003$1_2@127.0.0.1>
madhav_a_kelkar@hotmail.com wrote:
...
> I am using Perl/Expect and I want to send arrow keys to a
> process running in background. But I was unable to simulate the arrow
> keys through perl by using their ascii code and the perl chr()
> function. How I can do it through perl?
Well, the first question is: "What are the ASCII codes for the
arrow keys"? The answer is: the arrow keys are not ASCII
characters. You will find that typically they are encoded as
either a sequence of ASCII characters usually starting with the
ESC character (known as an "escape code" or "escape sequence")
or, at a very low level, by a "keyboard code". Any of those are
very hardware and operating system dependent and, since you
didn't say what your hardware and operating system is, there is
no way to respond. In general, low-level functions like this are
not commonly accessed via Perl. That doesn't mean it can't be done.
...
> Madhav.
--
Bob Walton
Email: http://bwalton.com/cgi-bin/emailbob.pl
----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= East/West-Coast Server Farms - Total Privacy via Encryption =---
------------------------------
Date: 03 Jan 2005 08:19:55 GMT
From: Dave Weaver <zen13097@zen.co.uk>
Subject: Re: tar - gzip
Message-Id: <41d9002b$0$21332$db0fefd9@news.zen.co.uk>
On Sun, 2 Jan 2005 13:10:13 +1300, Tintin <tintin@invalid.invalid> wrote:
>
> Why not do it as a single step.
>
> system "$tar -czvf \"$gzipFile\"" and die "tar error $!\n";
>
Perl provides alterate forms of quoting so that you don't need those
ugly backslashes:
system qq($tar -czvf "$gzipFile") and die "tar error $!\n";
Much nicer!
------------------------------
Date: 03 Jan 2005 08:39:00 GMT
From: Abigail <abigail@abigail.nl>
Subject: Re: tar - gzip
Message-Id: <slrncti153.h3.abigail@alexandra.abigail.nl>
Dave Weaver (zen13097@zen.co.uk) wrote on MMMMCXLIII September MCMXCIII
in <URL:news:41d9002b$0$21332$db0fefd9@news.zen.co.uk>:
{} On Sun, 2 Jan 2005 13:10:13 +1300, Tintin <tintin@invalid.invalid> wrote:
{} >
{} > Why not do it as a single step.
{} >
{} > system "$tar -czvf \"$gzipFile\"" and die "tar error $!\n";
{} >
{}
{} Perl provides alterate forms of quoting so that you don't need those
{} ugly backslashes:
{}
{} system qq($tar -czvf "$gzipFile") and die "tar error $!\n";
Or even better, the safe form of system:
system $tar => -czvf, $gzipFile and die "tar exited ", $? >> 8, "\n";
Note also the use of $? instead of $!.
Abigail
--
perl -Mstrict -we '$_ = "goto P.print chop;\n=rekcaH lreP rehtona tsuJ";P1:eval'
------------------------------
Date: 8 Jan 2005 00:03:55 -0800
From: pradeepg@vlsi1.sastra.edu (pradeep)
Subject: Terminal size
Message-Id: <962c2d3.0501080003.46506f35@posting.google.com>
Hi all
use Term::ReadKey;
($wchar, $hchar, $wpixels, $hpixels) = GetTerminalSize() ;
use Term::ANSIColor ;
In my perl script these two functions, are working correctly in unix
environment, But these 2 functions gives me error when i use it in
solaris, may i know the perl function for solaris that can be used to
get the terminal size, and function for printing in color
regards
pradeep
------------------------------
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 7621
***************************************