[15809] in Perl-Users-Digest
Perl-Users Digest, Issue: 3222 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed May 31 18:05:56 2000
Date: Wed, 31 May 2000 15:05:26 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <959810726-v9-i3222@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Wed, 31 May 2000 Volume: 9 Number: 3222
Today's topics:
[newbie] I'm a retard (pls. Recom. Regex help src.) stanwalters@hotmail.com
Re: [newbie] I'm a retard (pls. Recom. Regex help src.) <care227@attglobal.net>
Re: [newbie] I'm a retard (pls. Recom. Regex help src.) <lr@hpl.hp.com>
AAAARRRRGGHHH! Please help <edge@gecko.org>
Re: AAAARRRRGGHHH! Please help <tina@streetmail.com>
Re: AAAARRRRGGHHH! Please help <bmb@ginger.libs.uga.edu>
Re: AAAARRRRGGHHH! Please help <tina@streetmail.com>
Re: AAAARRRRGGHHH! Please help <lr@hpl.hp.com>
Re: AAAARRRRGGHHH! Please help <care227@attglobal.net>
Re: AAAARRRRGGHHH! Please help <lr@hpl.hp.com>
Re: AAAARRRRGGHHH! Please help <herr_stumpfenstiel@lycosmail.com>
Re: AAAARRRRGGHHH! Please help <care227@attglobal.net>
Re: actinic catalog intergrating dynamic html help!! <aharon1@yahoo.com>
Re: Activestate down? <latsharj@my-deja.com>
Re: Activestate down? <phalanxii@excite.com>
Re: Activestate down? (Elaine -HFB- Ashton)
Activestate Perl - Fork, Threads, and Process jgore@home.com
Re: Activestate Perl - Fork, Threads, and Process (Clinton A. Pierce)
Re: Binary To ASCII <lr@hpl.hp.com>
Re: Binary To ASCII (Bart Lateur)
C to perl? <nobody@none.com>
Re: C to perl? (Daniel Winsor - HESE)
Re: C to perl? (brian d foy)
Re: C to perl? (Greg Bacon)
Re: C to perl? (Clinton A. Pierce)
can't locate object method "new" via net::ftp linuxluva@yahoo.com
Re: can't locate object method "new" via net::ftp <tony_curtis32@yahoo.com>
Re: CGI for WHOIS queries - Advice please <callcalinc@aol.com>
Re: CGI Forms: Save File Dialog instead of processing f <dmeyers@panix.com>
gif and jpg, height and width <tanderse@fsl.noaa.gov>
Re: gif and jpg, height and width <ozette.brown@infotechfl.com>
global subroutine <jerrad@networkengines.com>
Re: global subroutine (Charles DeRykus)
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 31 May 2000 20:35:23 GMT
From: stanwalters@hotmail.com
Subject: [newbie] I'm a retard (pls. Recom. Regex help src.)
Message-Id: <8h3t2b$o8j$1@nnrp1.deja.com>
Can anyone recommend a good source of net-based explanation of RegExps?
I'm trying to get the following:
$STRNG="rMAN, rWOMAN, rFREDDY, rTOMMY=29919"
into individual variables, or an array, or anything. The problem is
$STRNG has anywhere from 1 to 10 of the r* items in the list. I've
been tearing through RegExps to try to match n number of matches, but I
can't seem to find the right combination of things.
/(.*),{0,}\s{0,}/ doesn't work
/(.*,{0,}\s{0,})/ doesn't work
/(r.*){0,}/ doesn't work
/(\w*),{1,}/ comes closest, but still doesn't work
I won't bore you with the other thousand or so variations on these that
seemed logical to me at various times. Any opinions as to whether or
not I'm on the right track here or if I should go buy visual basic :(
appreciated.
thx
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Wed, 31 May 2000 17:14:01 -0400
From: Drew Simonis <care227@attglobal.net>
Subject: Re: [newbie] I'm a retard (pls. Recom. Regex help src.)
Message-Id: <39358099.EC0BCC67@attglobal.net>
stanwalters@hotmail.com wrote:
>
> Can anyone recommend a good source of net-based explanation of RegExps?
>
> I'm trying to get the following:
> $STRNG="rMAN, rWOMAN, rFREDDY, rTOMMY=29919"
$ perldoc -f split
$STRNG="rMAN, rWOMAN, rFREDDY, rTOMMY=29919"
@stringettes = split(/,/, $STRNG);
------------------------------
Date: Wed, 31 May 2000 14:15:37 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: [newbie] I'm a retard (pls. Recom. Regex help src.)
Message-Id: <MPG.139f20d58d7215a98ab11@nntp.hpl.hp.com>
In article <8h3t2b$o8j$1@nnrp1.deja.com> on Wed, 31 May 2000 20:35:23
GMT, stanwalters@hotmail.com <stanwalters@hotmail.com> says...
> Can anyone recommend a good source of net-based explanation of RegExps?
>
> I'm trying to get the following:
> $STRNG="rMAN, rWOMAN, rFREDDY, rTOMMY=29919"
> into individual variables, or an array, or anything.
The hard way (IMO), using a regex as you tried:
my @a = $string =~ /[^,\s]+/g;
The easy way (IMO) using the split() function:
my @a = split /, +/, $string;
> I won't bore you with the other thousand or so variations on these that
> seemed logical to me at various times. Any opinions as to whether or
> not I'm on the right track here or if I should go buy visual basic :(
> appreciated.
With so many ways to do anything in Perl, why look for more troubles?
:-)
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Wed, 31 May 2000 18:18:51 GMT
From: Edge <edge@gecko.org>
Subject: AAAARRRRGGHHH! Please help
Message-Id: <8h3l1v$isr$1@nnrp1.deja.com>
I have a text file (generated by a database dump) of > 150,000 records,
some records are blank others start with a '/' I need a script that
will parse through the file, and if the first character is either a
blank or '/' to change the record to Unknown. What I have is:
#!/usr/bin/perl
open(INPUT,'buh.data');
while (<INPUT>) {
foreach $rec (@input) {
$a = substr($rec, 0, 1);
if ($a eq "/") {
$rec = "Unknown";
}
}
print "$rec\n";
}
If I run this, I get > 150,000 blank lines appearing on my screen - no
record data is displayed, just empty space. What am I doing wrong, and
is there a better way to do this?
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: 31 May 2000 18:51:29 GMT
From: Tina Mueller <tina@streetmail.com>
Subject: Re: AAAARRRRGGHHH! Please help
Message-Id: <8h3mvh$2ajuf$1@fu-berlin.de>
hi,
Edge <edge@gecko.org> wrote:
> #!/usr/bin/perl
#!/usr/bin/perl -w
this will help you to find the errors you made in the script
> open(INPUT,'buh.data');
open(INPUT,'buh.data') or die "Could not open buh.data: $!";
> while (<INPUT>) {
> foreach $rec (@input) {
hm, what is in the array @input?
you want to process each line, and the line stands
in $_.
so just type:
$rec = (m!^/!) ? "Unknown" : $_;
> $a = substr($rec, 0, 1);
> if ($a eq "/") {
> $rec = "Unknown";
> }
> }
that is not necessary any more
> print "$rec\n";
> }
tina
--
http://www.tinita.de \ enter__| |__the___ _ _ ___
tina's moviedatabase \ / _` / _ \/ _ \ '_(_-< of
search & add comments \ \ _,_\ __/\ __/_| /__/ perception
------------------------------
Date: Wed, 31 May 2000 14:52:38 -0400
From: Brad Baxter <bmb@ginger.libs.uga.edu>
Subject: Re: AAAARRRRGGHHH! Please help
Message-Id: <Pine.A41.4.21.0005311447500.13070-100000@ginger.libs.uga.edu>
On Wed, 31 May 2000, Edge wrote:
> I have a text file (generated by a database dump) of > 150,000 records,
> some records are blank others start with a '/' I need a script that
> will parse through the file, and if the first character is either a
> blank or '/' to change the record to Unknown. What I have is:
>
> #!/usr/bin/perl
> open(INPUT,'buh.data');
> while (<INPUT>) {
> foreach $rec (@input) {
You haven't put anything in @input.
> $a = substr($rec, 0, 1);
> if ($a eq "/") {
> $rec = "Unknown";
> }
> }
> print "$rec\n";
> }
>
> If I run this, I get > 150,000 blank lines appearing on my screen - no
> record data is displayed, just empty space. What am I doing wrong, and
> is there a better way to do this?
while( defined( my $rec = <INPUT> ) ) {
$rec = "Unknown\n" if $rec =~ m{^[/ ]};
print $rec;
} # while
--
Brad
------------------------------
Date: 31 May 2000 18:52:46 GMT
From: Tina Mueller <tina@streetmail.com>
Subject: Re: AAAARRRRGGHHH! Please help
Message-Id: <8h3n1t$2ajuf$2@fu-berlin.de>
hi,
i forgot to say: please don't shout.
and think of a better subject, then you will get more
help.
Edge <edge@gecko.org> wrote:
> I have a text file (generated by a database dump) of > 150,000 records,
> [...]
--
http://www.tinita.de \ enter__| |__the___ _ _ ___
tina's moviedatabase \ / _` / _ \/ _ \ '_(_-< of
search & add comments \ \ _,_\ __/\ __/_| /__/ perception
------------------------------
Date: Wed, 31 May 2000 12:16:16 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: AAAARRRRGGHHH! Please help
Message-Id: <MPG.139f04dbd96c1ea498ab0d@nntp.hpl.hp.com>
[In the future, please choose a Subject that describes the problem
itself, not what it is doing to you. And don't shout about it! :-]
In article <8h3l1v$isr$1@nnrp1.deja.com> on Wed, 31 May 2000 18:18:51
GMT, Edge <edge@gecko.org> says...
> I have a text file (generated by a database dump) of > 150,000 records,
> some records are blank others start with a '/' I need a script that
> will parse through the file, and if the first character is either a
> blank or '/' to change the record to Unknown. What I have is:
>
> #!/usr/bin/perl
> open(INPUT,'buh.data');
You start out with three errors in those two lines. Look at the end of
this post to see how they should read. The '-w' flag would have helped
with a warning about using uninitialized variables. The 'use strict;'
would require you to declare all your variables (though in fact no
variables are needed to solve this problem :-). The parenthesizing of
the open() statement is up to you.
> while (<INPUT>) {
> foreach $rec (@input) {
Where did @input come from? Possibly you replaced code that looked like
this:
chomp(@input = <INPUT>);
which would be the wrong approach, by the while() statement, which is
the right approach. But each line of input is now in $_.
> $a = substr($rec, 0, 1);
> if ($a eq "/") {
> $rec = "Unknown";
> }
> }
> print "$rec\n";
> }
>
> If I run this, I get > 150,000 blank lines appearing on my screen - no
> record data is displayed, just empty space. What am I doing wrong, and
> is there a better way to do this?
#!/usr/bin/perl -w
use strict;
open INPUT, 'buh.data' or die "Couldn't open 'buh.data'. $!\n";
print substr($_, 0, 1) eq '/' ? "Unknown\n" : $_ while <INPUT>;
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Wed, 31 May 2000 15:57:14 -0400
From: Drew Simonis <care227@attglobal.net>
Subject: Re: AAAARRRRGGHHH! Please help
Message-Id: <39356E9A.3D3099DF@attglobal.net>
Larry Rosler wrote:
> > open(INPUT,'buh.data');
>
> You start out with three errors in those two lines. Look at the end of
> this post to see how they should read. The '-w' flag would have helped
> with a warning about using uninitialized variables. The 'use strict;'
> would require you to declare all your variables (though in fact no
> variables are needed to solve this problem :-). The parenthesizing of
> the open() statement is up to you.
Wow. I see a 4th error, and you fixed it later. Maybe not syntatic,
but not testing for failure on that open is a sure fire mistake.
------------------------------
Date: Wed, 31 May 2000 13:19:33 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: AAAARRRRGGHHH! Please help
Message-Id: <MPG.139f13b3e8050a4a98ab0f@nntp.hpl.hp.com>
In article <39356E9A.3D3099DF@attglobal.net> on Wed, 31 May 2000
15:57:14 -0400, Drew Simonis <care227@attglobal.net> says...
> Larry Rosler wrote:
>
> > > open(INPUT,'buh.data');
> >
> > You start out with three errors in those two lines. Look at the end of
> > this post to see how they should read. The '-w' flag would have helped
> > with a warning about using uninitialized variables. The 'use strict;'
> > would require you to declare all your variables (though in fact no
> > variables are needed to solve this problem :-). The parenthesizing of
> > the open() statement is up to you.
>
> Wow. I see a 4th error, and you fixed it later. Maybe not syntatic,
> but not testing for failure on that open is a sure fire mistake.
No, that was the third error.
1. No '-w' flag.
2. No 'use strict;'.
3. No check for failure to open the file.
What was the fourth one that you spotted, which I didn't?
The 'real' error -- reading the input from where it wasn't -- came later
on.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Wed, 31 May 2000 22:57:17 +0200
From: "Herr Stumpfenstiel" <herr_stumpfenstiel@lycosmail.com>
Subject: Re: AAAARRRRGGHHH! Please help
Message-Id: <8h3u7v$8jg37@mx2.hrz.uni-essen.de>
Hmm, we should close the file, shouldn't we?
#!/usr/bin/perl -w
use strict;
open INPUT, 'buh.data' or die "Couldn't open buh.data. $!\n";
while (<INPUT>) {
print m!^[/ ]! ? "Unknown\n" : $_;
}
close INPUT;
Herr_Stumpfenstiel@lycosmail.com
------------------------------
Date: Wed, 31 May 2000 17:10:08 -0400
From: Drew Simonis <care227@attglobal.net>
Subject: Re: AAAARRRRGGHHH! Please help
Message-Id: <39357FB0.7BD64390@attglobal.net>
>
> No, that was the third error.
>
> 1. No '-w' flag.
>
> 2. No 'use strict;'.
>
> 3. No check for failure to open the file.
>
I thought you were indicating the () to open as an outdated
syntax as the 3rd error.
------------------------------
Date: Wed, 31 May 2000 18:30:06 GMT
From: Aaron <aharon1@yahoo.com>
Subject: Re: actinic catalog intergrating dynamic html help!!
Message-Id: <sjamhes95pj150@corp.supernews.com>
Trevor,
I've been using Actinic for a couple of months now. The Good thing about
it is that they include the perl scripts for you. (all of the files that
say pl or pm) Almost everything is customizable from there. If you need
to learn perl scripting go to webmonkey.com or htmlgoodies.com those
really have helped me.
Oh yeah, don't worry about that guy (ass) at upenn that posted that. What
a freak!
sincerely,
Aaron
t wrote:
>
>
>
>
> I wonder if you may be aware of a solution to a problem I have. We have
been
> using actinic catalog for around 1 year buy due to the size of our
database
> this software is too slow and the data file are 30mb plus this is due
due to
> the fact that we have 3,000 products. We have since designed dynamic web
> pages in cgi that create every product/directory on the fly. my question
is
> this. how do i create a buy script in the same manner that will
integrate my
> front end with the actinic catalog shopping system.
>
> Yours
>
>
> Trevor Ambrose
>
>
--
Posted via CNET Help.com
http://www.help.com/
------------------------------
Date: Wed, 31 May 2000 18:47:35 GMT
From: Dick Latshaw <latsharj@my-deja.com>
Subject: Re: Activestate down?
Message-Id: <8h3mo4$k29$1@nnrp1.deja.com>
In article <8h3a39$347$1@news.surfnet.nl>,
"Real" <real@earthling.net> wrote:
> Been there today, about 3 hours ago. Now it seems to be gone. Perhaps
> they are updating their site ?
Probably switching over to WinNT, IIS, ASP, VBScript, so as to keep Big
Bill happy. :(
--
Regards,
Dick
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Wed, 31 May 2000 12:16:08 -0700
From: PhalanxII <phalanxii@excite.com>
Subject: Re: Activestate down?
Message-Id: <15a02300.516a1944@usw-ex0101-008.remarq.com>
>Probably switching over to WinNT, IIS, ASP, VBScript, so as to
>keep Big Bill happy. :(
I wouldn't doubt it. Perhaps I need to use IE to access it :-)
It worked earlier, then I tried again and it was down, so I'm not
sure what the scoop is...
Phalanx2
http://members.xoom.com/Phalanx2/
* Sent from RemarQ http://www.remarq.com The Internet's Discussion Network *
The fastest and easiest way to search and participate in Usenet - Free!
------------------------------
Date: 31 May 2000 21:30:31 GMT
From: elaine@chaos.wustl.edu (Elaine -HFB- Ashton)
Subject: Re: Activestate down?
Message-Id: <slrn8jb10v.2iq.elaine@chaos.wustl.edu>
In article <8h3mo4$k29$1@nnrp1.deja.com>, Dick Latshaw wrote:
>In article <8h3a39$347$1@news.surfnet.nl>,
> "Real" <real@earthling.net> wrote:
>> Been there today, about 3 hours ago. Now it seems to be gone. Perhaps
>> they are updating their site ?
>
>Probably switching over to WinNT, IIS, ASP, VBScript, so as to keep Big
>Bill happy. :(
Oh, now why do people say that? They run, actually, a mixture of
Linux and NT and Solaris which is representative of the platforms
they now support. Bill probably has better things to worry about.
Also, I might add here that web sites do occasionally go down for a
few hours and that it's really damn annoying to watch people post
'what happened' notes only a few hours into it. It could be many
different things but unless it's been down for more than 24 hours
cut the people a break as I'm sure they are busting ass to fix it.
Damn, I remember waiting a week for a site to return..of course, this
was long before the .com's and such came along with throngs of ADD
impaired people :)
e.
------------------------------
Date: Wed, 31 May 2000 18:49:37 GMT
From: jgore@home.com
Subject: Activestate Perl - Fork, Threads, and Process
Message-Id: <39355814.66473610@24.14.77.5>
Threads don't seem to work at all in Activestate Perl. People
at Activestate just tell you to use Fork instead.
Limits of Fork:
"This includes any limits imposed by the operating system on the number of open file,
directory and socket handles, limits on disk space usage, limits on memory size, limits on
CPU utilization etc."
And:
"In the eyes of the operating system, pseudo-processes created via the fork()
emulation are simply threads in the same process."
Hmmm....that doesn't sound like what I'm after. I need about 10+ processes to work at the
same time (routine is mostly waiting for html pages to arrive. But, it does take some
cpu processing. It takes about 60 seconds).
What If:
What if I use the Win32::Process module. That creates a REAL second process.
Would I gain anything by making that routine an EXE (Perl2EXE) so as not to load Perl again?
I could keep the routine on a Ram disk as well. Should speed things up right?
And, there isn't a good way to pass large amounts of data (other than a Ram disk - how primitive!).
Has anyone else used Win32::Process as a sort of Thread maker?
Did it use too many resources? Things I should watch for?
Is there any other way to create a real process with Activestate Perl?
1) Activestate Perl doesn't support threads.
2) Fork is an emulation and not true threads. has too many limits.
3) Win32::Process may be an alternative by starting a whole new process.
4) Any others?
------------------------------
Date: Wed, 31 May 2000 21:55:16 GMT
From: clintp@geeksalad.org (Clinton A. Pierce)
Subject: Re: Activestate Perl - Fork, Threads, and Process
Message-Id: <8TfZ4.96183$h01.690102@news1.rdc1.mi.home.com>
[Posted and mailed]
In article <39355814.66473610@24.14.77.5>,
jgore@home.com writes:
> Threads don't seem to work at all in Activestate Perl. People
> at Activestate just tell you to use Fork instead.
> [...]
> Hmmm....that doesn't sound like what I'm after. I need about 10+ processes to work at the
> same time (routine is mostly waiting for html pages to arrive. But, it does take some
> cpu processing. It takes about 60 seconds).
This is right up fork()'s alley. There are limitations to native threads
under Win32, pardner. It's not just fork(). There are limits under Unix.
Deal with them, and write some code.
> 4) Any others?
In IRC #perl, we call this an XY Problem. An XY Problem is where you're
trying to do X because you want to accomplish Y, except that you shouldn't
be worrying about X in the first place because there's a relatively simple
way to get to Y. What are you really trying to do, and what are you
afraid of?
Code it up with fork() -- realize that you can't fork() forever -- and go
on with life. If you keep flapping yer jaw instead of coding, you won't
know what you're missing.
--
Clinton A. Pierce Teach Yourself Perl in 24 Hours!
clintp@geeksalad.org for details see http://www.geeksalad.org
"If you rush a Miracle Man,
you get rotten Miracles." --Miracle Max, The Princess Bride
------------------------------
Date: Wed, 31 May 2000 11:36:22 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: Binary To ASCII
Message-Id: <MPG.139efb7f5bb1dd2898ab0a@nntp.hpl.hp.com>
In article <8h2tce$eko$1@nntp9.atl.mindspring.net> on Wed, 31 May 2000
07:34:38 -0400, Jane H. <memberjh@yahoo.com> says...
> I have a binary file I am trying to open and save as ASCII. I know this is
> easy, I just can't figure it out. Any help is appreciated. Thanks in
> Advance, Jane.
Please be more specific about your needs. What is the operating
environment (Unix, Windows/DOS, Mac)? What do you want to do about
apparent newlines in the binary file?
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Wed, 31 May 2000 21:09:32 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Binary To ASCII
Message-Id: <393577ae.866441@news.skynet.be>
Jane H. wrote:
>I have a binary file I am trying to open and save as ASCII. I know this is
>easy, I just can't figure it out. Any help is appreciated. Thanks in
>Advance, Jane.
As Larry said. What's so special about the file? Why do you call it a
"binary file"? What does "converting to Ascii" mean?
--
Bart.
------------------------------
Date: Wed, 31 May 2000 21:47:50 +0200
From: Michel <nobody@none.com>
Subject: C to perl?
Message-Id: <39356C66.DDC60593@none.com>
Hi there!
Can anyone tell me how to translate a C program to perl? Or where can I
get c2perl?
Thnx!
Michel
------------------------------
Date: 31 May 2000 20:13:34 GMT
From: dwinsor@Eng.Sun.COM (Daniel Winsor - HESE)
Subject: Re: C to perl?
Message-Id: <8h3rpe$suh$3@eastnews1.east.sun.com>
In article DDC60593@none.com, Michel <nobody@none.com> writes:
>Hi there!
>
>Can anyone tell me how to translate a C program to perl?
By typing?
>Or where can I
>get c2perl?
We're called programmers.
---
Dan Winsor
------------------------------
Date: Wed, 31 May 2000 16:49:12 -0400
From: brian@smithrenaud.com (brian d foy)
Subject: Re: C to perl?
Message-Id: <brian-ya02408000R3105001649120001@news.panix.com>
In article <39356C66.DDC60593@none.com>, Michel <nobody@none.com> posted:
> Can anyone tell me how to translate a C program to perl? Or where can I
> get c2perl?
there are things that you can do in C that you can't do in Perl.
thus, you cannot translate C into Perl. however, if you want to
access your C stuff from perl, see the perlxstut man page, for
starters.
good luck (you'll need it...)
--
brian d foy
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
Perl Mongers <URL:http://www.perl.org/>
------------------------------
Date: Wed, 31 May 2000 20:52:44 GMT
From: gbacon@HiWAAY.net (Greg Bacon)
Subject: Re: C to perl?
Message-Id: <sjaussj45pj134@corp.supernews.com>
In article <39356C66.DDC60593@none.com>,
Michel <nobody@none.com> wrote:
: Can anyone tell me how to translate a C program to perl? Or where can
: I get c2perl?
Any mechanical translation from C to Perl is likely to generate really
awful code. Humans are going to outperform machines at solving this
problem. I recommend reading the FAQ; it will give you lots of useful
code and a better feel for the higher level perspective from which Perl
programmers operate.
Greg
--
And I'm ever so glad that the user interface is being discussed now.
Perhaps the pioneers won't suffer quite so many arrows in their backs.
-- Chip Salzenberg
------------------------------
Date: Wed, 31 May 2000 21:41:45 GMT
From: clintp@geeksalad.org (Clinton A. Pierce)
Subject: Re: C to perl?
Message-Id: <tGfZ4.96180$h01.690102@news1.rdc1.mi.home.com>
[Posted and mailed]
In article <39356C66.DDC60593@none.com>,
Michel <nobody@none.com> writes:
> Can anyone tell me how to translate a C program to perl? Or where can I
> get c2perl?
First, you write a VM that uses Perl for its native opcodes.
Next, write a C compiler for your Perl VM.
The compiled C which you get as a result will be in Perl instructions for
your native VM.
Implementation is left as an exercise for the reader.
--
Clinton A. Pierce Teach Yourself Perl in 24 Hours!
clintp@geeksalad.org for details see http://www.geeksalad.org
"If you rush a Miracle Man,
you get rotten Miracles." --Miracle Max, The Princess Bride
------------------------------
Date: Wed, 31 May 2000 21:42:29 GMT
From: linuxluva@yahoo.com
Subject: can't locate object method "new" via net::ftp
Message-Id: <8h4103$r0c$1@nnrp1.deja.com>
i get this error message with the canned ftp code "see net::ftp"
i got this error then i found out i have to install libnet, so i did
via PPM of course and i still get the same error! why?
i know libnet has the net::ftp module in it. why i am not seeing it i am
not sure? help!
let me just make sure i am doing the right thing:
c:\perl>set http_proxy = http://foo.bar.com:8080
ppm>search libnet
ppm>install libnet
ppm>exit
then i should be able to run my code
c:\perl>perl code.plx
and i still get the same error as in subject
thanx in advance
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: 31 May 2000 17:02:41 -0500
From: Tony Curtis <tony_curtis32@yahoo.com>
Subject: Re: can't locate object method "new" via net::ftp
Message-Id: <87aeh6s7i6.fsf@limey.hpcc.uh.edu>
>> On Wed, 31 May 2000 21:42:29 GMT,
>> linuxluva@yahoo.com said:
> i get this error message with the canned ftp code "see
> net::ftp" i got this error then i found out i have to
> install libnet, so i did via PPM of course and i still
> get the same error! why?
> then i should be able to run my code c:\perl>perl
> code.plx and i still get the same error as in subject
It's virtually impossible to tell without seeing the code.
Are you using -w and "use strict;" ?
hth
t
--
"Trying is the first step towards failure"
Homer Simpson
------------------------------
Date: Wed, 31 May 2000 20:30:04 GMT
From: callcal <callcalinc@aol.com>
Subject: Re: CGI for WHOIS queries - Advice please
Message-Id: <sjatic4m5pj86@corp.supernews.com>
Paul Knighton
We will soon be able to give you the advice you seek and could use your
help.
We are starting a new Internet company that will connect you to individuals
and groups who can give good advice and information on virtually any
specific topic or situation, be that business or personal. For this the
advisor will be paid by the minute. We are trying to establish an interest
in our concept at both the advisor and consumer levels, and would like to
know what you think. Thank you for your time.
You can contact us at our temporary E-mail address, callcalinc@aol.com, or
fax us
904-389-0702. All names and addresses will remain confidential. Thanks
again.
Your friends at Call Cal, Inc.
--
Posted via CNET Help.com
http://www.help.com/
------------------------------
Date: 31 May 2000 14:15:41 -0400
From: David Meyers <dmeyers@panix.com>
Subject: Re: CGI Forms: Save File Dialog instead of processing form data
Message-Id: <yobbt1mvb5e.fsf@panix3.panix.com>
9jerry9@my-deja.com writes:
> print "Content-type: text/plain.\n\n" ;
It's that period at the end. Should be:
print "Content-type: text/plain\n\n" ;
Not really a perl issue as such. Just that browsers
don't know what to do with a "text/plain." so they
ask you if you want to save whatever it is.
--d
------------------------------
Date: Wed, 31 May 2000 12:41:29 -0600
From: "Travis" <tanderse@fsl.noaa.gov>
Subject: gif and jpg, height and width
Message-Id: <8h3mcq$k8k$1@peabody.colorado.edu>
Hi,
Does anyone know if there is a way to figure out what the height and width
are of a graphic file using perl?
Thanks
Travis
------------------------------
Date: Wed, 31 May 2000 15:17:26 -0400
From: Ozette Brown <ozette.brown@infotechfl.com>
To: Travis <tanderse@fsl.noaa.gov>
Subject: Re: gif and jpg, height and width
Message-Id: <39356546.5019A587@infotechfl.com>
Yes,
Try the Image::Size module.
Cheers,
Ozette
Travis wrote:
> Hi,
>
> Does anyone know if there is a way to figure out what the height and width
> are of a graphic file using perl?
>
> Thanks
>
> Travis
------------------------------
Date: Wed, 31 May 2000 14:52:34 -0400
From: jerrad pierce <jerrad@networkengines.com>
Subject: global subroutine
Message-Id: <39355F72.C3EC7B0D@networkengines.com>
Hi, I'm trying to make a subroutine I have global (available in all namespaces without explicitly supplying the subs name space)
After reading perlsub I thought this might work...
package mypackage;
use subs qw(mysub);
@EXPORT = 'mysub';
Exporter::export('mypackage', 'CORE::GLOBAL', 'mysub');
but you actually have to call
CORE::GLOBAL::mysub
Any ideas how I can achieve this?
PS> Yes, I know it's not generally kosjer to do.
But it's the optimal solution in this case...
Thanks!
------------------------------
Date: Wed, 31 May 2000 20:22:17 GMT
From: ced@bcstec.ca.boeing.com (Charles DeRykus)
Subject: Re: global subroutine
Message-Id: <FvFxx5.49z@news.boeing.com>
In article <39355F72.C3EC7B0D@networkengines.com>,
jerrad pierce <jerrad@networkengines.com> wrote:
>Hi, I'm trying to make a subroutine I have global (available in all namespaces without explicitly supplying the subs name space)
>
>After reading perlsub I thought this might work...
>
>package mypackage;
>use subs qw(mysub);
>@EXPORT = 'mysub';
>
>Exporter::export('mypackage', 'CORE::GLOBAL', 'mysub');
>
>but you actually have to call
>CORE::GLOBAL::mysub
>
You could pollute UNIVERSAL although that's
not much shorter:
package UNIVERSAL;
sub mysub {}
package mypackage;
mypackage->mysub;
--
Charles DeRykus
------------------------------
Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 16 Sep 99)
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: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.
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 V9 Issue 3222
**************************************