[27014] in Perl-Users-Digest
Perl-Users Digest, Issue: 8942 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Feb 11 06:05:55 2006
Date: Sat, 11 Feb 2006 03:05:06 -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: 8942
Today's topics:
Absolute Novice (Mac Tiger) Needs Help <kamins@dogeared.com>
Re: Absolute Novice (Mac Tiger) Needs Help <groleau+news@freeshell.org>
Re: Absolute Novice (Mac Tiger) Needs Help <kamins@dogeared.com>
Re: Absolute Novice (Mac Tiger) Needs Help <penryu@saiyix.ath.cx>
Device::Cdio - encapsulates CD control and reading (R. Bernstein)
dup a lexical filehandle xhoster@gmail.com
Re: dup a lexical filehandle (Anno Siegel)
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 <tintin@invalid.invalid>
Need to add something to form to make file uploads poss <clever.joeyNOSPAM@gmail.com>
Re: Need to add something to form to make file uploads <uri@stemsystems.com>
Re: Perl vs. Python <penryu@saiyix.ath.cx>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 10 Feb 2006 16:51:02 -0800
From: Scot Kamins <kamins@dogeared.com>
Subject: Absolute Novice (Mac Tiger) Needs Help
Message-Id: <kamins-FE3DD5.16510210022006@sn-ip.vsrv-sjc.supernews.net>
Hi,
Am I in the right place for help on this? If not, please forgive the
intrusion - and perhaps you could direct me elsewhere.
I'm using perl on a Mac under Tiger. I'm trying to learn perl using
Lemay's Teach Yourself Perl in 21 Days.
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.
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?
Thanks in advance,
Scot Kamins
------------------------------
Date: Sat, 11 Feb 2006 01:06:37 GMT
From: Wes Groleau <groleau+news@freeshell.org>
Subject: Re: Absolute Novice (Mac Tiger) Needs Help
Message-Id: <xMaHf.461$Eq.31@trnddc02>
Scot Kamins wrote:
> Am I in the right place for help on this? If not, please forgive the
> intrusion - and perhaps you could direct me elsewhere.
>
> I'm using perl on a Mac under Tiger. I'm trying to learn perl using
> Lemay's Teach Yourself Perl in 21 Days.
It's not a perl problem, IMHO. I suspect you have some odd
configuration in Terminal. Here's what I get on Panther with
and without the correct permissions:
Graphite:~ wgroleau$ vi /tmp/HW # paste in Scot's perl
Graphite:~ wgroleau$ chmod 777 /tmp/HW
Graphite:~ wgroleau$ /tmp/HW
Hello, World!
Graphite:~ wgroleau$ vi /tmp/WH # paste in Scot's perl
Graphite:~ wgroleau$ /tmp/WH
-bash: /tmp/WH: Permission denied
If it's something to do with Terminal, ask on comp.sys.mac.system
--
Wes Groleau
A pessimist says the glass is half empty.
An optimist says the glass is half full.
An engineer says somebody made the glass
twice as big as it needed to be.
------------------------------
Date: Fri, 10 Feb 2006 18:09:49 -0800
From: Scot Kamins <kamins@dogeared.com>
Subject: Re: Absolute Novice (Mac Tiger) Needs Help
Message-Id: <kamins-B12E42.18094910022006@sn-ip.vsrv-sjc.supernews.net>
In article <xMaHf.461$Eq.31@trnddc02>,
Wes Groleau <groleau+news@freeshell.org> wrote:
> Scot Kamins wrote:
> > Am I in the right place for help on this? If not, please forgive the
> > intrusion - and perhaps you could direct me elsewhere.
> >
> > I'm using perl on a Mac under Tiger. I'm trying to learn perl using
> > Lemay's Teach Yourself Perl in 21 Days.
>
> It's not a perl problem, IMHO. I suspect you have some odd
> configuration in Terminal. Here's what I get on Panther with
> and without the correct permissions:
>
> Graphite:~ wgroleau$ vi /tmp/HW # paste in Scot's perl
> Graphite:~ wgroleau$ chmod 777 /tmp/HW
> Graphite:~ wgroleau$ /tmp/HW
> Hello, World!
> Graphite:~ wgroleau$ vi /tmp/WH # paste in Scot's perl
> Graphite:~ wgroleau$ /tmp/WH
> -bash: /tmp/WH: Permission denied
>
> If it's something to do with Terminal, ask on comp.sys.mac.system
Hi Wes,
Thanks for the quick response. I can make the thing print "Hello,
World!" when I issue a single command line in Terminal:
perl -w -e 'print "Hello, World!\n";'
The display shows this:
New-Hope:~ scotkamins$ perl -w -e 'print "Hello, World!\n";'
Hello, World!
New-Hope:~ scotkamins$
It's when I tell it to use the text file that nothing happens. It's as
if the output is going somewhere other than the display.
As to knowing whether it's a problem with Terminal, I don't know enough
to know what I don't know! (We're talking newbie here.)
Thanks for trying,
-Scot Kamins
(who is glad to display the pleasing attitudes of discipleship)
------------------------------
Date: Sat, 11 Feb 2006 09:10:42 GMT
From: Tim Hammerquist <penryu@saiyix.ath.cx>
Subject: Re: Absolute Novice (Mac Tiger) Needs Help
Message-Id: <slrnduragi.310d.penryu@haruko.saiyix>
Scot Kamins <kamins@dogeared.com> wrote:
> I can make the thing print "Hello, World!" when I issue
> a single command line in Terminal:
>
> perl -w -e 'print "Hello, World!\n";'
>
> The display shows this:
>
> New-Hope:~ scotkamins$ perl -w -e 'print "Hello, World!\n";'
> Hello, World!
> New-Hope:~ scotkamins$
>
> It's when I tell it to use the text file that nothing happens. It's as
> if the output is going somewhere other than the display.
What happens when you try: ?
perl hello.pl
Tim Hammerquist
------------------------------
Date: Fri, 10 Feb 2006 19:22:48 GMT
From: rocky@panix.com (R. Bernstein)
Subject: Device::Cdio - encapsulates CD control and reading
Message-Id: <IuI9x6.17BF@zorch.sf-bay.org>
In this initial object-oriented Perl interface to the C library
libcdio (http://www.gnu.org/software/libcdio), audio CD controls,
device controls, compact disc classification, various block CD read
routines, and some track routines are provided. There are a number of
example programs in the package demonstrating use.
The module should be on CPAN eventually. (Although, at the time of
this posting it isn't - see below). However the module is also
available in the GNU ftp space via
ftp://ftp.gnu.org:/pub/gnu/libcdio/Device-Cdio-v0.0.1.tar.gz
As this my first CPAN module, please go easy on me. If you are
familiar with libcdio, you'll find perhaps about half of what's in
libcdio. Much of the work is I think is a straightforward continuation
of what's currently there. (Just getting this far was a bit more work
than I expected.)
Enjoy.
------------------------------
Date: 11 Feb 2006 02:36:28 GMT
From: xhoster@gmail.com
Subject: dup a lexical filehandle
Message-Id: <20060210213641.114$st@newsreader.com>
How do you dup a lexical file handle?
With old fashioned handles, you could do:
open my $new_fh, "<&FH" or die $!;
But I don't want to have FH, I need to use $fh.
In case this is an XY problem, what I'm trying to do is subclass a module
whose constructor only takes a filename, but I want my hands on the handle,
so I want to trick the super class into duping a handle when it ties to
open a file.
use strict;
use warnings;
use Data::Dumper;
my $x=Bar->new('/dev/random');
my $y=Bar->new('/dev/null');
# now $x and $y contain same handle, not separate ones.
package Legacy;
sub new {
my ($class, $name)=@_;
open SRC, $name or die "$name $!";
my $self={content=>[map ord scalar <SRC>,1..10]};
close SRC;
bless $self, $class;
};
package Bar;
use Carp;
our @ISA=qw(Legacy);
sub new {
my ($class,$name)=@_;
open (Bar::FH, $name) or die "$name $!";
# Maybe lock FH here
my $self=Legacy->new('<&Bar::FH');
# do other stuff with FH here, maybe even store it:
$self->{filehandle}=\*Bar::FH;
bless $self, $class;
};
Thanks,
Xho
--
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service $9.95/Month 30GB
------------------------------
Date: 11 Feb 2006 09:17:16 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: dup a lexical filehandle
Message-Id: <dska2s$m7d$1@mamenchi.zrz.TU-Berlin.DE>
<xhoster@gmail.com> wrote in comp.lang.perl.misc:
> How do you dup a lexical file handle?
>
> With old fashioned handles, you could do:
>
> open my $new_fh, "<&FH" or die $!;
open my $new_fh, '<&', $fh or die "dup: $!";
Anno
--
$_='Just another Perl hacker'; print +( join( '', map { eval $_; $@ }
'use warnings FATAL => "all"; printf "%-1s", "\n"', 'use strict; a',
'use warnings FATAL => "all"; "@x"', '1->m') =~
m|${ s/(.)/($1).*/g; \ $_ }|is),',';
------------------------------
Date: Sat, 11 Feb 2006 00:50:35 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: <vxaHf.458$Eq.141@trnddc02>
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?
jue
------------------------------
Date: Sat, 11 Feb 2006 19:51:47 +1300
From: "Tintin" <tintin@invalid.invalid>
Subject: Re: FAQ 4.18 Does Perl have a Year 2000 problem? Is Perl Y2K compliant?
Message-Id: <MPfHf.141424$vH5.1179717@news.xtra.co.nz>
"Jürgen Exner" <jurgenex@hotmail.com> wrote in message
news:vxaHf.458$Eq.141@trnddc02...
> 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?
Could change it to Y2010, Y2100 or Y2032 :-)
I can guarantee when 2010 comes around, a lot of broken Perl code is going
to pop up.
------------------------------
Date: Sat, 11 Feb 2006 01:16:47 GMT
From: "Joey" <clever.joeyNOSPAM@gmail.com>
Subject: Need to add something to form to make file uploads possible.. but what?
Message-Id: <3WaHf.86170$zt1.62186@newsfe5-gui.ntli.net>
Hi, I apologize in advance for what will sound like ridiculous questions,
but I have never even attempted to dabble with 'cgi' or perl or whatever
until today...
Basically I am trying to finish the final page of my photo restoration
website, where I want to be able to let users fill out a contact form and
upload some photos before they 'submit' the information.
I found a really useful tutorial for cgi beginners
(http://www.cyberface-support.co.za/escgiemail.html) which i followed and to
my amazement it worked - I was able to set up the script and when I tested
the online form it did indeed get emailed to me etc.
The only problem is - the tutorial did not mention uploading files. I found
some html code somewhere on the web to create the buttons and on the web
page it looks perfect, works perfect - I am able to browse for the files,
but of course when I hit 'submit' the 'uploaded' files don't go anywhere -
since there is no mention of them in the email 'template.txt' of where
exactly they should go. Ideally I want them attached to the email, but I
would settle just for them being uploaded to a directory on my server.
I have pasted my embarassing 'script' below - can someone tell me if there
is something I could change to make this possible?
PS - I also want the Max File size to be bigger - what figure do I need to
put in to limit each upload to 5 MB?
Thanks in advance,
Joanna
PS (The web page mentioned here in the code is currently not active - but
will be)
</font></p>
<form action="/cgi-sys/cgiemail/template.txt" method="post"
name="order">
<font face="Verdana" size="2"><input name="success"
value="http://www.fotofairy.co.uk/confirm.htm" type="hidden">
</font>
<p><font face="Verdana" size="2">NAME:
</font></p>
<p><font face="Verdana" size="2"><input name="name"
type="text"></font></p>
<font face="Verdana" size="2">
</font>
<p><font face="Verdana" size="2">EMAIL ADDRESS:
</font></p>
<p><font face="Verdana" size="2"><input name="email"
type="text"></font></p>
<font face="Verdana" size="2">
</font>
<p><font face="Verdana" size="2">DESCRIPTION OF WHAT YOU WOULD LIKE
DONE: </font></p>
<font face="Verdana" size="2"> </font>
<p><font face="Verdana" size="2"><textarea name="comments" rows="10"
cols="40"></textarea></font></p>
<p><font face="Verdana" size="2">CHOOSE THE PICTURES YOU WANT TO
SEND US: </font></p>
<p>
<font face="Verdana" size="2"><input name="MAX_FILE_SIZE" value="51200"
type="hidden">
<input name="fupload" type="file"><br>
<input name="MAX_FILE_SIZE" value="51200" type="hidden">
<input name="fupload" type="file"><br>
<input name="MAX_FILE_SIZE" value="51200" type="hidden">
<input name="fupload" type="file"><br>
<input name="MAX_FILE_SIZE" value="51200" type="hidden">
<input name="fupload" type="file"><br>
</font></p>
<font face="Verdana" size="2"><input name="MAX_FILE_SIZE"
value="51200" type="hidden">
<input name="fupload" type="file"><br>
<br>
<input type="checkbox"> < TICK HERE IF YOU REQUIRE PRINTED
PHOTOS (Extra charges apply - see <a
href="http://www.fotofairy.co.uk/prices.html"><span style="text-decoration:
underline;">Prices</span></a> for more information)<br>
<br>
<input value="Submit Order Query" type="submit">
------------------------------
Date: Fri, 10 Feb 2006 23:26:25 -0500
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: Need to add something to form to make file uploads possible.. but what?
Message-Id: <x7irrmv7v2.fsf@mail.sysarch.com>
>>>>> "J" == Joey <clever.joeyNOSPAM@gmail.com> writes:
J> I found a really useful tutorial for cgi beginners
J> (http://www.cyberface-support.co.za/escgiemail.html) which i
J> followed and to my amazement it worked - I was able to set up the
J> script and when I tested the online form it did indeed get emailed
J> to me etc.
that isn't a tutorial on cgi. it is a simple howto on using that
particular cgi script that sends email for you.
J> The only problem is - the tutorial did not mention uploading files.
J> I found some html code somewhere on the web to create the buttons
J> and on the web page it looks perfect, works perfect - I am able to
J> browse for the files, but of course when I hit 'submit' the
J> 'uploaded' files don't go anywhere - since there is no mention of
J> them in the email 'template.txt' of where exactly they should go.
J> Ideally I want them attached to the email, but I would settle just
J> for them being uploaded to a directory on my server.
the script itself needs to handle the upload. you can't write html to
make the script do something it isn't programmed to do. it is designed
to send email and not do upload (at least according to what i read. the
cgi source appears to be private).
J> I have pasted my embarassing 'script' below - can someone tell me if there
J> is something I could change to make this possible?
that isn't a 'script. it is html which is just fancy looking text with
some form stuff. it won't do anything unless there is a web server with
cgi (or other technology) that will handle the html forms.
you need to find a file upload script (or write one) and a hoster that
will let you run it.
uri
--
Uri Guttman ------ uri@stemsystems.com -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs ---------------------------- http://jobs.perl.org
------------------------------
Date: Sat, 11 Feb 2006 09:07:44 GMT
From: Tim Hammerquist <penryu@saiyix.ath.cx>
Subject: Re: Perl vs. Python
Message-Id: <slrndurab0.310d.penryu@haruko.saiyix>
Patrick M. Rutkowski <rutski89@gmail.com> wrote:
[ snip ]
Troll or no, you'd think I'd have learned not to remove the
'\<vs?\>' line from my killfile...
Once again we've covered ESR's various personality defects.
ESR has made some really good arguments. And also some really
bad ones. He's also made some really interesting software. And
some really bad. And yet we still give ESR top billing whenever
he issues his opinion.
It's sort of like Jerry Lewis. Or a trainwreck.
YMMV,
Tim Hammerquist
------------------------------
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 8942
***************************************