[19102] in Perl-Users-Digest
Perl-Users Digest, Issue: 1297 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Jul 13 09:06:38 2001
Date: Fri, 13 Jul 2001 06:05:16 -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: <995029516-v10-i1297@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Fri, 13 Jul 2001 Volume: 10 Number: 1297
Today's topics:
Re: Active State <Stewy@Chartermi.net>
Re: argument in regular expression <leclerc.fabrice@wanadoo.fr>
Re: Array Sorting-Looping-Number Formatting <abe@ztreet.demon.nl>
Re: Catch errors raised within PerlIsql.pm <Tassilo.Parseval@post.rwth-aachen.de>
Check for Dups! <millettNOSPAM@lblueyonder.co.uk>
Re: Check for Dups! <krahnj@acm.org>
Re: easy multi-file find & replace? <nospam-abuse@ilyaz.org>
FAQ: Archives of comp.lang.perl.misc <faq@denver.pm.org>
Finding size of HTML page via HTTP <jeremyalansmith@netscapeonline.co.uk>
Re: Finding size of HTML page via HTTP <gnarinn@hotmail.com>
Re: Finding size of HTML page via HTTP <laszlo.gerencser@portologic.com>
Re: Finding size of HTML page via HTTP <gtoomey@usa.net>
How do I detect an asf file <pneal@neptune.com>
Re: How do I detect an asf file <laszlo.gerencser@portologic.com>
Re: How to resolve multi process issue??? <gnarinn@hotmail.com>
List files in a directory <jocke30_gbg@hotmail.com>
Re: List files in a directory (Logan Shaw)
Re: List files in a directory <andrew@mvt.ie>
Re: List files in a directory (Logan Shaw)
Re: List files in a directory <ccx138@coventry.ac.uk>
Re: LOOKING FOR PERL JOBS <arfry@lineone.net>
newbie question regarding tables in perl <my@email.address>
Re: newbie question regarding tables in perl <gnarinn@hotmail.com>
Re: newbie question regarding tables in perl <laszlo.gerencser@portologic.com>
newbie question <marco.gouveia@optimus.pt>
Re: newbie question nobull@mail.com
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 13 Jul 2001 07:34:29 -0500
From: "Adam Stewart" <Stewy@Chartermi.net>
Subject: Re: Active State
Message-Id: <tktnbkipt03k84@corp.supernews.com>
No... I know how to use my os. Along with DOS. I just did not know what it
was talking about when it said command line. I thought it was referring to
something I installed along with it. It didn't say the command line is at
DOS, and actually I know how to change DIRs and all that stuff. Second, I
tried using DOS before I actually asked this question, but it didn't work.
The thing is I just forgot to restart my computer, and when I tried it
later it worked fine.
Chris Stith <mischief@velma.motion.net> wrote in message
news:tkrsrsspu9mff4@corp.supernews.com...
> Tim Schmelter <tschmelter@statesman.com> wrote:
> > Drew wrote:
>
> >> "Adam Stewart" <Stewy@Chartermi.net> wrote in message
news:<tkoose7di0467d@corp.supernews.com>...
> >> > For a while now I have been interested in learning perl. So I
recently
>
> That's good.
>
> >> > installed Active State Perl on my computer. My operating system is
Windows
> >> > 98, just so you know. First thing is it says to run there example
program to
>
> That's, um, passable.
>
> >> > make sure it is working correctly. Now the problem is where do I run
this
> >> > program from? It says to type <perl example.pl> at the command line,
but it
> >> > doesnt say where this command line is, and i've looked all over with
out
> >> > success.
>
> Perhaps before you learn Perl you should learn how to use the OS on your
> computer. No, I'm not insulting you. I'm just saying life's going to be
> easier and much more pleasant if you learn how to use software before
> learning to write it.
>
> >> >
> >> > Does anyone understand what I am saying? Your help is appreciated.
Actualy I
> >> > would prefer for you to email me than to respond here as I may not
get back
> >> > here for a few days.
>
> If the question is here, the answer is here. This is a public discussion
> group, not a private tutoring service for your benefit.
>
>
> >> "Command line" refers to does command prompt. click "start" -> "run"
> >> -> type "command". use the CD command to get the directory where the
> >> file is. then type "perl example.pl".
>
> This should help the OP, but I don't think it will help much. It's
difficult
> to learn to program if you don't know how to use the tools given.
>
> > I don't know about anyone else, but I actually *felt* myself lock into a
generation gap reading this
> > thread. :-(>>>~ (Which is the emoticon for "I've got a long gr[ea]y
beard", I'm going to say.)
>
> Generation gap? I'm not sure about that... I'm only 25, and my first
computer
> had 48k of RAM and built-in BASIC. My first PC compatible came with a
20Mhz
> processor, 1 meg of RAM, a 40-meg hard drive, 5 1/4" and 3 1/2" floppies,
> and an EGA video system. It ran DOS 5.0 and eventually 6.2 rather well,
> but no Windows. I think maybe it's more of a geekiness gap than anything.
> All these newcomers just weren't interested in computers before the
> Pretty Picture Revolution made it the PCs.
>
> Chris
>
> --
> Where there's a will, there's a lawyer.
>
------------------------------
Date: Fri, 13 Jul 2001 10:09:32 +0200
From: Fabrice Leclerc <leclerc.fabrice@wanadoo.fr>
Subject: Re: argument in regular expression
Message-Id: <leclerc.fabrice-BF6C5D.10093213072001@persmail.uhp-nancy.fr>
In article <m3vgkxvdcr.fsf@dhcp9-161.support.tivoli.com>, Ren Maddox
<ren@tivoli.com> wrote:
> On Thu, 12 Jul 2001, leclerc.fabrice@wanadoo.fr wrote:
>
> > I just realized that it doesn't do exactly what I want. There are
> > some particular cases where the pattern /position:<number>-/ appears
> > twice or more in the same paragraph. Everytime it occurs, only the
> > first pattern is identified and the following ones are omitted. For
> > example, if I have two patterns: /position:200-/ and
> > /position:2000-/ in this order in the same paragraph:
> >
> > the perl command:
> > perl -ne '$/ = "\n\n"; print if /position:(\d+)-/ and $1 >= 200 and $1
> > <= 250;'
> > gives the paragraph which contains both patterns (/position:200-/ and
> > /position:2000-/)
> >
> > the perl command:
> > perl -ne '$/ = "\n\n"; print if /position:(\d+)-/ and $1 >= 2000 and $1
> > <= 2500;'
> > does not give any hit.
> >
> > Is there any way to fix this problem.
>
> perl -n000e 'print if /position:(\d+)(?(?{ $1 >= 2000 && $1 <= 2500
> })|(?!))/'
>
> which can be simplified slightly by inversion:
>
> perl -n000e 'print if /position:(\d+)(?(?{ $1 < 2000 || $1 >
> 2500})(?!))/'
>
> The point is to make the match fail if the number is out of range so
> that it can backtrack and try to match a different place in the
> paragraph.
>
> See perlrun(1) for the -0 option to replace setting $/. This does
> assume that you are OK with paragraph slurping, which is slightly
> different from what you were doing (the way it handles extra blank
> lines differs).
if I just replace the \d+ in the initial perl command by \d{2,}, it
doesn't stop the search after the first hit:
perl -ne '$/ = "\n\n"; print if /position:(\d{2,})-/ and $1 >= 2000 and
$1 <= 2500;'
I guess it will also find all the possible matches in one paragraph,
won't it ?
------------------------------
Date: Fri, 13 Jul 2001 13:06:42 +0200
From: Abe Timmerman <abe@ztreet.demon.nl>
Subject: Re: Array Sorting-Looping-Number Formatting
Message-Id: <niktktshk8adk5oe7t6bb34hn5qm5gk3j0@4ax.com>
On Mon, 9 Jul 2001 09:29:27 -0400, tadmc@augustmail.com (Tad McClellan)
wrote:
[ snipped ]
>
> Here is a complete program that sorts a LoH in the manner you
> have requested:
>
> ----------------------
> #!/usr/bin/perl -w
> use strict;
>
> my @records = (
> { status => 'status4', index => 4 },
> { status => 'status1', index => 10 },
> { status => 'status3', index => 3 },
> { status => 'status1', index => 1 },
> { status => 'status2', index => 2 },
> { status => 'status3', index => 1 },
> { status => 'status1', index => 12 },
> { status => 'status3', index => 10 },
> );
>
>
> my @sorted = map { $_->[0] }
> sort { $a->[1] cmp $b->[1] or
> $b->[2] <=> $a->[2]
> }
> map { [ $_, $_->{status}, $_->{index} ] } @records;
Why use a transform when you don't transform anything? I presume you
chose the LoH data structure to avoid just that.
my @sorted = sort {
$a->{status} cmp $b->{status} or
$b->{index} <=> $a->{index}
} @records;
--
Good luck, Abe
Amsterdam Perl Mongers http://amsterdam.pm.org
perl -we '$_="rekcah lreP rehtona tsuJ";print$2while s/(.*)(.)/$1/g'
------------------------------
Date: Fri, 13 Jul 2001 12:29:59 +0200
From: Tassilo von Parseval <Tassilo.Parseval@post.rwth-aachen.de>
Subject: Re: Catch errors raised within PerlIsql.pm
Message-Id: <3B4ECDA7.6070106@post.rwth-aachen.de>
Hi,
Pyxos wrote:
>Hi,
>
>I use PerlIsql.pm and I want to know if it is possible to catch errors
>like this described below and therefore put the message in a log file
>and act as it needs :
>
Yes, you can do that. Errors and warnings go to STDERR, so what you can
do is add something like:
open STDERR, ">logfile";
Alternatively on the command-line assuming script.pl is the program you
run: (perl) script.pl 2> logfile. '2' stands for the stderr-stream.
You can even be more tricky be, let's say, only logging things that
would let the program die:
$SIG{__DIE__} = sub { ... }
Try 'perldoc -q trap' to get a useful entry on that in the FAQ. Apart
from the standard POSIX-signals described by 'man 7 signal' Perl has two
internally defined pseudo-signals, namely __DIE__ and __WARN__.
If you want to stop the program from dying at all, you can even do
$SIG{__DIE__} = $SIG{__WARN__}.
Regards,
Tassilo
--
Is this TERMINAL fun?
------------------------------
Date: Fri, 13 Jul 2001 08:04:09 GMT
From: "millside" <millettNOSPAM@lblueyonder.co.uk>
Subject: Check for Dups!
Message-Id: <ZXx37.54036$aE6.4616334@news1.cableinet.net>
hi,
I have a program which was written some time ago and error checking works
just fine.
However someone has submitted same email address (subscribed to my
newsletter) about 60 times- presumably just for the fun of it!
I would like to protect against multiple entries being written to my flat
file in future and was wanting a sub routine to do it. The test code I have
written below just throws up my errorpage no matter what email address was
specified- legit or not!
Could someone show me how to modify this please using seek as I don't think
grep is appropriate here?
Also is it necessary to lock file for appending?
########## SUBSCRIBE NEW EMAILS ##########
########## CHECK EXISTING EMAIL ADDRESSES FOR DUPLICATES BEFORE WRITING TO
FILE ##########
&check_data;
sub check_data{
open (EMAILS, "+< address.txt") or die ("Can't open $email: $!");
@addresses=<EMAILS>;
@add = grep{ /$email{'address'}/i } @addresses;
if (@add) {
$errormessage = ("The address you entered, <B>$email{'address'}</B> is
already in our mailing list");
&errorpage;
exit;
}
close (EMAILS);
exit;
} #end of sub check_data
#------------------------------------------------------------
Thanks for the help
--
millside
_____________
------------------------------
Date: Fri, 13 Jul 2001 10:04:52 GMT
From: "John W. Krahn" <krahnj@acm.org>
Subject: Re: Check for Dups!
Message-Id: <3B4EC7BB.A6D4766B@acm.org>
millside wrote:
>
> hi,
> I have a program which was written some time ago and error checking works
> just fine.
> However someone has submitted same email address (subscribed to my
> newsletter) about 60 times- presumably just for the fun of it!
> I would like to protect against multiple entries being written to my flat
> file in future and was wanting a sub routine to do it. The test code I have
> written below just throws up my errorpage no matter what email address was
> specified- legit or not!
> Could someone show me how to modify this please using seek as I don't think
> grep is appropriate here?
> Also is it necessary to lock file for appending?
>
> [ snip code ]
use a tied hash instead of a flat file for your e-mail addresses.
perldoc -f tie
perldoc DB_File
perldoc AnyDBM_File
John
--
use Perl;
program
fulfillment
------------------------------
Date: Fri, 13 Jul 2001 07:30:40 +0000 (UTC)
From: Ilya Zakharevich <nospam-abuse@ilyaz.org>
Subject: Re: easy multi-file find & replace?
Message-Id: <9im830$1vo3$1@agate.berkeley.edu>
[A complimentary Cc of this posting was sent to
Craig Berry
<cberry@cinenet.net>], who wrote in article <tks6o9spcjt176@corp.supernews.com>:
> If you can identify the text files by pattern (say, they all end in
> .html), this should do it from the shell:
>
> find public_html -name '*.html' -exec perl -pi -e 's/foobar/fubar/' {} \;
pfind ./public_html '/\.html$/' '=~ s/foobar/fubar/g'
Hope this helps,
Ilya
------------------------------
Date: Fri, 13 Jul 2001 12:17:02 GMT
From: PerlFAQ Server <faq@denver.pm.org>
Subject: FAQ: Archives of comp.lang.perl.misc
Message-Id: <2FB37.84$T3.192949248@news.frii.net>
This message is one of several periodic postings to comp.lang.perl.misc
intended to make it easier for perl programmers to find answers to
common questions. The core of this message represents an excerpt
from the documentation provided with every Standard Distribution of
Perl.
+
Archives of comp.lang.perl.misc
Have you tried Deja or AltaVista? Those are the best archives. Just look
up "*perl*" as a newsgroup.
http://www.deja.com/dnquery.xp?QRY=&DBS=2&ST=PS&defaultOp=AND&LNG=ALL&format=terse&showsort=date&maxhits=25&subjects=&groups=*perl*&authors=&fromdate=&todate=
You might want to trim that down a bit, though.
You'll probably want more a sophisticated query and retrieval mechanism
than a file listing, preferably one that allows you to retrieve articles
using a fast-access indices, keyed on at least author, date, subject,
thread (as in "trn") and probably keywords. The best solution the FAQ
authors know of is the MH pick command, but it is very slow to select on
18000 articles.
If you have, or know where can be found, the missing sections, please
let perlfaq-suggestions@perl.com know.
-
Documents such as this have been called "Answers to Frequently
Asked Questions" or FAQ for short. They represent an important
part of the Usenet tradition. They serve to reduce the volume of
redundant traffic on a news group by providing quality answers to
questions that keep coming up.
If you are some how irritated by seeing these postings you are free
to ignore them or add the sender to your killfile. If you find
errors or other problems with these postings please send corrections
or comments to the posting email address or to the maintainers as
directed in the perlfaq manual page.
Answers to questions about LOTS of stuff, mostly not related to
Perl, can be found by pointing your news client to
news:news.answers
or to the many thousands of other useful Usenet news groups.
Note that the FAQ text posted by this server may have been modified
from that distributed in the stable Perl release. It may have been
edited to reflect the additions, changes and corrections provided
by respondents, reviewers, and critics to previous postings of
these FAQ. Complete text of these FAQ are available on request.
The perlfaq manual page contains the following copyright notice.
AUTHOR AND COPYRIGHT
Copyright (c) 1997-1999 Tom Christiansen and Nathan
Torkington. All rights reserved.
This posting is provided in the hope that it will be useful but
does not represent a commitment or contract of any kind on the part
of the contributers, authors or their agents.
02.15
--
This space intentionally left blank
------------------------------
Date: Fri, 13 Jul 2001 11:59:56 +0100
From: "jeremyalansmith" <jeremyalansmith@netscapeonline.co.uk>
Subject: Finding size of HTML page via HTTP
Message-Id: <8uA37.25090$WS4.3837144@news6-win.server.ntlworld.com>
Hi!
I'm writing a small browser, and wondered how to find out the size of the
HTML page, so I can make enough memory available to load it into memory
(instead of saving to a file as I am now doing).
Thanks,
Jeremy.
------------------------------
Date: Fri, 13 Jul 2001 11:01:14 +0000
From: gnari <gnarinn@hotmail.com>
Subject: Re: Finding size of HTML page via HTTP
Message-Id: <995022074.179066593293101.gnarinn@hotmail.com>
In article <8uA37.25090$WS4.3837144@news6-win.server.ntlworld.com>,
jeremyalansmith <jeremyalansmith@netscapeonline.co.uk> wrote:
>
>I'm writing a small browser, and wondered how to find out the size of the
>HTML page, so I can make enough memory available to load it into memory
>(instead of saving to a file as I am now doing).
>
you are writing a browser in Perl?
gnari
------------------------------
Date: Fri, 13 Jul 2001 11:32:47 GMT
From: Laszlo Gerencser <laszlo.gerencser@portologic.com>
Subject: Re: Finding size of HTML page via HTTP
Message-Id: <3B4EDC99.91157C35@portologic.com>
jeremyalansmith wrote:
>
> Hi!
>
> I'm writing a small browser, and wondered how to find out the size of the
> HTML page, so I can make enough memory available to load it into memory
> (instead of saving to a file as I am now doing).
>
> Thanks,
>
> Jeremy.
Well, it's not a perl question.
Perl UA should communicate with HTTP protocol.
So the question is how to get a file size with HTTP.
First of all you should read the HTTP RFCs.
(You should find them at www.w3c.org)
Then you probably will find a "standard" solution.
But current HTTP implementations not necessairely follow the RFCs.
So why not using the LWP module? It has an user agent class that can be
used.
And you can spare a lot of testing and doing workarounds to get the best
result.
Bu if you don't want to use modules, I recommend you to examine the LWP
module code.
I'm sure that you will find a lot of useful solutions to your current
and future problems implementing your own UA.
Hope, this helps.
--
Laszlo Gerencser
PortoLogic Ltd.
------------------------------
Date: Fri, 13 Jul 2001 22:51:39 +1000
From: "Gregory Toomey" <gtoomey@usa.net>
Subject: Re: Finding size of HTML page via HTTP
Message-Id: <5XB37.576$a04.2706@newsfeeds.bigpond.com>
"jeremyalansmith" <jeremyalansmith@netscapeonline.co.uk> wrote in message
news:8uA37.25090$WS4.3837144@news6-win.server.ntlworld.com...
> Hi!
>
> I'm writing a small browser, and wondered how to find out the size of the
> HTML page, so I can make enough memory available to load it into memory
> (instead of saving to a file as I am now doing).
>
> Thanks,
>
> Jeremy.
>
The average HTML page is about 40K. The average PC or Unix box has >= 256M
RAM and gigabytes of virtual memory.
You're not going to run out of memory.
BTW, if you are saving it to a file, doesn't that mean you are loading it
into memory already?
gtoomey
------------------------------
Date: Tue, 10 Jul 2001 12:18:02 -0700
From: "Phillip Neal" <pneal@neptune.com>
Subject: How do I detect an asf file
Message-Id: <zsI27.35783$XX5.62790@news03.micron.net>
Dear Perl People,
How do I detect a micrsoft asf video file with Perl ?
For instance, in a qtime movie you have the 'moov', in a jpeg you have JFIF,
but what about for asf ?
I tried using the MPEG::ID3v... stuff. But that returns nothing.
Thanks,
Phil
------------------------------
Date: Fri, 13 Jul 2001 10:08:48 GMT
From: Laszlo Gerencser <laszlo.gerencser@portologic.com>
Subject: Re: How do I detect an asf file
Message-Id: <3B4EC8EB.73722812@portologic.com>
Phillip Neal wrote:
>
> Dear Perl People,
>
> How do I detect a micrsoft asf video file with Perl ?
>
> For instance, in a qtime movie you have the 'moov', in a jpeg you have JFIF,
> but what about for asf ?
What about getting one and opening it with a hexa editor?
I'm sure you will find what you are looking for...
--
Laszlo Gerencser
PortoLogic Ltd.
------------------------------
Date: Fri, 13 Jul 2001 10:47:05 +0000
From: gnari <gnarinn@hotmail.com>
Subject: Re: How to resolve multi process issue???
Message-Id: <995021225.499611284118146.gnarinn@hotmail.com>
In article <23c54ab6.0107121536.536df790@posting.google.com>,
Gururaj Upadhye <gururaj@powertec.com> wrote:
>nobull@mail.com wrote in message news:<u9g0c284ei.fsf@wcl-l.bham.ac.uk>...
>> gururaj@powertec.com (Gururaj Upadhye) writes:
>>
(snipped problem with mod_perl)
>
>The script that is producing this result is user_manage.cgi. I
>downloaded it from capn site. I am a novice of perl and not an expert
>in Apache.
>
can you provide a link to this script? i did not find it
gnari
------------------------------
Date: Fri, 13 Jul 2001 09:41:45 +0200
From: "JJ" <jocke30_gbg@hotmail.com>
Subject: List files in a directory
Message-Id: <9im8me$jkh$1@vg170.it.volvo.se>
Hi,
I need to get all files in a directory that have the suffix *.sql and store
then in a array.
But how?
Best regards
Joacim Jarkeborn
------------------------------
Date: 13 Jul 2001 03:57:01 -0500
From: logan@cs.utexas.edu (Logan Shaw)
Subject: Re: List files in a directory
Message-Id: <9imd4t$jdo$1@charity.cs.utexas.edu>
In article <9im8me$jkh$1@vg170.it.volvo.se>,
JJ <jocke30_gbg@hotmail.com> wrote:
>I need to get all files in a directory that have the suffix *.sql and store
>then in a array.
"*.sql" is a strange suffix. With a suffix like that, you'd expect to
see files named things like "foo*.sql" and "bar*.sql".
Anyway, I think you want to do something like this:
@my_array = glob "*.sql";
Or maybe the longer but more flexible way:
opendir (DIR, "/some/directory") or die;
while (defined ($dir = readdir DIR))
{
push (@my_array, $dir) if $dir =~ /\.sql$/;
}
closedir DIR;
"perldoc -f glob", "perldoc -f opendir", etc. will give you more
information.
- Logan
--
my your his her our their _its_
I'm you're he's she's we're they're _it's_
------------------------------
Date: Fri, 13 Jul 2001 09:58:55 +0100
From: "Andrew" <andrew@mvt.ie>
Subject: Re: List files in a directory
Message-Id: <9imd8n$fav$1@kermit.esat.net>
"JJ" <jocke30_gbg@hotmail.com> wrote in message
news:9im8me$jkh$1@vg170.it.volvo.se...
> Hi,
>
> I need to get all files in a directory that have the suffix *.sql and
store
> then in a array.
>
> But how?
>
> Best regards
> Joacim Jarkeborn
You could try this:
#!/usr/bin/perl
use strict;
my @files;
while(<*.sql>)
{
push @files,$_;
}
for (0..$#files)
{
printf "$files[$_]\n";
}
Andrew
------------------------------
Date: 13 Jul 2001 04:12:08 -0500
From: logan@cs.utexas.edu (Logan Shaw)
Subject: Re: List files in a directory
Message-Id: <9ime18$km8$1@charity.cs.utexas.edu>
In article <9imd8n$fav$1@kermit.esat.net>, Andrew <andrew@mvt.ie> wrote:
>for (0..$#files)
>{
> printf "$files[$_]\n";
>}
That's not really very much in the Perl idiom. It's much more natural
to just do this:
foreach (@files)
{
print "$_\n";
}
That is precisely what "foreach" is for, after all.
Personally, I like this better, though:
print map ("$_\n", @files);
- Logan
--
my your his her our their _its_
I'm you're he's she's we're they're _it's_
------------------------------
Date: Fri, 13 Jul 2001 11:48:27 +0100
From: John Tutchings <ccx138@coventry.ac.uk>
Subject: Re: List files in a directory
Message-Id: <3B4ED1FB.E725E6DE@coventry.ac.uk>
JJ wrote:
> Hi,
>
> I need to get all files in a directory that have the suffix *.sql and store
> then in a array.
>
> But how?
>
> Best regards
> Joacim Jarkeborn
@array = `ls *.sql`;
If you put a path in there e.g. /usr/local/sqlscripts/*.sql the path is put in
the array as well so you could do a chdir first.
They will also have the newline on the end so you could chomp(@array)
John
--
------------------------------
Date: Fri, 13 Jul 2001 11:43:22 +0100
From: "Andrew Fry" <arfry@lineone.net>
Subject: Re: LOOKING FOR PERL JOBS
Message-Id: <tktjso9vqk89c@corp.supernews.co.uk>
Stop using this NG for advertising/job-hunting purposes. It is not
appreciated.
"dot-comet" <cometlinear@yahoo.com> wrote in message
news:120720011641194147%cometlinear@yahoo.com...
> I am looking for intermediate-level PERL jobs. I am willing to work
> inexpensively in exchange for experience.
>
> Please contact me through the website below, or call me at: 916-996-3334
>
>
>
> Thank you,
> -joshua
>
> http://dot-comet.com
------------------------------
Date: Fri, 13 Jul 2001 11:24:26 GMT
From: JuRo el Muerto <my@email.address>
Subject: newbie question regarding tables in perl
Message-Id: <3B4EDBB1.9B887F43@email.address>
hi ² all!
i'm working on a cgi-prog of mine and came up with a question:
i have a group of products (productnumber, description, price in ATS,
price in euro, amount ordered) - yes, you have guessed right, it is a
simple order-cgi. all the attributes are fixed, except for the amount
ordered, which is passed on by a html-form. now i have a whole lot of
product and don't want to use a variable for every one, so i guess i put
it into an array. now here's the question: how can i put theses
attributes into an array and how do i refere to these? it all boils down
to how to "import" a table full of values into perl .....
thanx for your answers....
------------------------------
Date: Fri, 13 Jul 2001 11:05:58 +0000
From: gnari <gnarinn@hotmail.com>
Subject: Re: newbie question regarding tables in perl
Message-Id: <995022358.389404777437449.gnarinn@hotmail.com>
In article <3B4EDBB1.9B887F43@email.address>,
JuRo el Muerto <my@email.address> wrote:
>hi ² all!
>i'm working on a cgi-prog of mine and came up with a question:
>
>i have a group of products (productnumber, description, price in ATS,
>price in euro, amount ordered) - yes, you have guessed right, it is a
>simple order-cgi. all the attributes are fixed, except for the amount
>ordered, which is passed on by a html-form. now i have a whole lot of
>product and don't want to use a variable for every one, so i guess i put
>it into an array. now here's the question: how can i put theses
>attributes into an array and how do i refere to these? it all boils down
>to how to "import" a table full of values into perl .....
>
>thanx for your answers....
>
you want a List Of Lists. see:
perldoc perllol
you may also want to look at these:
perldoc perlref
perldoc perlreftut
perldoc perldsc
good luck
gnari
------------------------------
Date: Fri, 13 Jul 2001 11:41:49 GMT
From: Laszlo Gerencser <laszlo.gerencser@portologic.com>
Subject: Re: newbie question regarding tables in perl
Message-Id: <3B4EDEB6.44F62430@portologic.com>
JuRo el Muerto wrote:
> how can i put theses
> attributes into an array and how do i refere to these? it all boils down
> to how to "import" a table full of values into perl .....
It depends on the format your data have now.
If it's a text file then you can read it and store values as you want.
Useful commands are: open, close <FILEHANDLE> split
If it's a database then you probably should go for DBI module.
In case of other format you shold go to CPAN (www.cpan.org) and find a
module there that can read or convert the format you need.
--
Laszlo Gerencser
PortoLogic Ltd.
------------------------------
Date: Fri, 13 Jul 2001 09:16:08 +0100
From: "Marco Gouveia" <marco.gouveia@optimus.pt>
Subject: newbie question
Message-Id: <O5y37.34875$_k4.53204059@newsserver.ip.pt>
Hello,
I'm trying to run a code sample that uses socket library (use Socket;).
However, I get the following error:
"use" may clash with future reserved word at perltest.pl line 3.
syntax error in file test2 at line 3, next 2 tokens "use Socket"
How do I correct this problem ?
Thanks
Marco Gouveia
------------------------------
Date: 13 Jul 2001 13:12:52 +0100
From: nobull@mail.com
Subject: Re: newbie question
Message-Id: <u94rsh81tn.fsf@wcl-l.bham.ac.uk>
"Marco Gouveia" <marco.gouveia@optimus.pt> writes:
> "use" may clash with future reserved...
Since "use" is now a _present_ reserved word it follows that your
Perl interpreter is from the past.
> How do I correct this problem ?
Install Perl5.
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
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 1297
***************************************